OPC UA - String as Default - opc-ua

I'm working with a vendor which has delivered an OPC UA Client, which we have been using for some time now.
Three months ago we got into a situation where the data format somehow changed on all our readings.
For example value before, was 22,34, but suddenly this was displayed as 2234 after a server Reboot.
Note: We use Danish format which has a comma as decimal point.
The last three months we have been troubleshooting this issue and today we received the answer, including the root cause.
Response from vendor:
As discussed on the phone after speaking with the developers they have advised that the issue seen is actually working as designed and that when an item is bad upon initial subscription it will have the data type of big string.
I have been unable to find the Answer whether or not this is According to the opa ua standard.
I find it very hard to believe that a Real should be converted to string, just because opc ua server is offline during subscription, because this could happen Daily All over the World
If some opc ua expect could help, then please let me know if the data type is changed to Big string by default whenever a subscription is made on an item that is bad.
Thx

Nope, this is 100% behavior of the application they delivered and has nothing to do with the spec.

Related

Is it feasible to setup DRM license servers by our own

We want to add DRM encryption in our content and want to know if its actually feasible to have our own DRM server or should go with third party ? Also if feasible can we implement all 3 fairplay, playready, widevine ?
It is feasible in theory - companies have done that. It is, however, quite a lot of work... think about:
User authentication: is user XYZ a valid subscriber, whatever that means?
Entitlement management: does user XYZ have a right to access movie "The Hangover"? And if so, is it for a limited time? Are they allowed to view it in 4K? Can the output go via HDMI and if so, which HDCP version? Etc... All these things are spelled out in the studios license agreement, and therefore need to be enforced.
Keeping the server key material up to date: keeping the various server certificates up to date by dealing directly with Apple, Microsoft, Google; ensure reasonable key rotation, etc.
Interfacing with media encoders: you probably have a streaming server powered by an encoder (AWS Elemental, Harmonic, Bitmovin, etc.), which means you need to ensure the license servers share key material with the encoder, so that the stream gets protected with the correct key. Again, think about key rotation, especially for live events.
I could go on for a while, but this should give a hint of the extra effort involved when running it by yourself as opposed to licensing a pre-packaged multi-DRM solution.

'Activate' Bluetooth LE Energy Data stream

For a student project, we're working on connecting a Bluetooth LE device (that both transmits and receives) to an iPhone or iPad in order to read data from it to display to the user in realtime. We have proof that this is doable by the company that made the device and we've actually managed to get a connection and get some data.. however it pings every 5-10 seconds and seems to be a random subset of numbers with minimal changes after changing something on the device which is making us none the wiser.
Now, of course, we went to the company that made the device and app first and we do have approval for us to use their hardware, but haven't been able to get a SDK / API from them to use with the application. So, our plan is to make our own way through it and find what we need.
This is where we're getting stuck. We have the following:
Connection based on Name or Bluetooth Device Address
Scan services (and cascading scan in case the services have services within them as specified in the CoreBluetooth documentation)
Read Characteristics from said services.
Decrypt value into 8bit UInt so we get some actual readable data.
This is an example of what we've got with the value still as it comes in.
Service: 0x1c0476440, is Primary = yes. UUID: 058d0001-ca72-4c8b-8084-25e049936b31
value <53636da1 7a616c74 73616c74 73616c74 73616c27>
Now, looking at this all, I presume the service here is some kind of 'staying alive' ping and it's giving some auxiliary info about the device's current state.
The question we have then boils down to this:
How can we further 'explore' the device? We don't seem to be getting any additional output aside from this however looking in the device manager from windows we get a couple of hits that look like this (Example):
{058d0001-ca72-4c8b-8084-25e049936b31}[6]
Which have values in either a hexidecimal value, boolean or datetime without clear identifiers. Is there a way for us to send a message to the device to change the value in that uuid using Swift, or is this impossible?
While solved now, I'm not accepting this as the answer. My solution? Try things. Stupid 'Needle in a haybale' things.
I changed the uuid from 058d0001-ca72-4c8b-8084-25e049936b31 to 058d0002-ca72-4c8b-8084-25e049936b31
and voila. I could do more. I tried 3, and again, a new result and a working data stream...
#Paulw11's comment is also a good way to solve this issue we found out.

Is there any way to get the tamper-proof date and time on iPhone?

For various reasons I need to get from the iPhone the current date and time that can't be meddled with by the user. Yes, I've seen how one can check a server (e.g., here), but that's not invulnerable to tampering if you take a moment to reflect.
There are two knee-jerk reactions I'm expecting to hear:
Use the GPS time.
It can't be done.
In answer to another question, I've described my researches into this matter. To summarize them:
The GPS time shifts with the user-defined settings.
The iPhone definitely has an internal tamper-proof time and date, as shown when date-time reverts after Set Automatically in Settings > General > Time & Date is turned back to on even in a fallout shelter.
What I want to know is how to access this tamper-proof time.
Edit
Just to be clear, the server-based solution is not suitable. For one, it could be faked. For another, the app needs to work without a network connection.
Assuming you always have Internet available, you could implement a class or object that connects to a remote Network Time Protocol server.
Here's an open source GitHub project that should get you started, and the related StackOverflow question I found it at.

Network Time Protocol for iPhone

I am writing an application that requires accurate timing. After asking this question, I have decided to investigate using NTP or maybe Simple NTP.
Is there any open source implementation of these protocols for the iPhone? So far I have managed to find a broken link. I am also aware that NTP has a C reference implementation, so I am trying to see how much effort it would require to make it work on the iPhone.
Update: I thought I had a working link, but it is to the Wayback Machine, which only saves text, not files link that works.
There's a small iOS library named ios-ntp. I have used it in one project in the past and it seemed to work reasonably well.
As of mid 2013 the original ios-ntp project has a few missing pieces, so I have mirrored the original svn repository to github. You can checkout out a working version of the code here: https://github.com/jessedc/iOS-ntp
I would probably start by pulling code from OpenNTPD.
If you're not developing a commercial application, peek at the linux source.
http://packages.ubuntu.com/source/lucid/ntp
If you need to use NTP, but don't want to trust the iPhone (or iPod's) clock, you can always just use sockets (or Cocoa streams) and query the server yourself. It's one of the simplest network transactions out there.
Cocoa Streams
I don't know what application you're creating, but if trusting the clock is a critical feature of its security or (in the case of game) cheat prevention, etc, then you need to be very careful of open protocols like NTP-- a cheater could do a man-in-the-middle on your NTP request and tell your app what he wanted you to hear.
If this is potentially a concern, you'll want to build your own trustable source of truth for time into your server (e.g. build your own time service, and sign your responses with PK crypto), and set your app's internal clock to that within some acceptable clock skew.
Since you are developing a commercial app, if all else fails, RFC 2030 describes the SNTP protocol. I have no information on commercially available libraries that do not require a background task, which the iPhone won't let you use.
You can use that open source: https://github.com/huynguyencong/NHNetworkTime
[[NHNetworkClock sharedNetworkClock] syncWithComplete:^{
NSLog(#"%s - Time synced %#", __PRETTY_FUNCTION__, [NSDate networkDate]);
}];
And use:
NSDate *networkDate = [NSDate networkDate];

Third party data delivery of lots of data

Does anyone know how sites that have a real-time feed of a lot of data work? I am referring to something like a stock site, where they can tell you in real time (well, 20 minute delay mostly, but still real-time - 20 minutes as I understand it).
They have thousands of data pieces delivered to them every second, I would imagine: MSFT 25.00 +.23 VOL 12000 ???? for each stock that had a change during some interval.
So, is there just a constant feed of small pushes going on? Or do you think a site will pull from the place that has the real data and say "give me all changes since 12:23:45 CST to now" type query?
I ask this because at work we might have a situation where we need to have at our application's fingertips real time information like this, and it won't make sense to hit our third party provider over and over and over again every second...
Generally there is a server/client protocol defined between the 2 parties. In the company I work for the connection is maintained at all times.
Here is info on real time data feeds to go with your stock example
NYSE,NASDAQ
It is common for data providers to also have FTP sites with (delayed) batched data. One that comes to mind is the NWS EMWIN
Sites like Twitter feed data to certain approved sites in real-time via XMPP (Wiki link).
In the broadest terms, a push model is going to be the best way of achieving "real time" transfer, particularly if you're talking about a large amount of data.
However you do always have a problem when using a purely push model of how to recover from missed data.
Depending on the nature of your data that may not be a problem (thinking of video delivery as an analogue, where the amount of data is huge but there is sufficient redundancy for it to recover from missing data). And if you have any control over the data you may be able to build some redundancy in. For example, on every change event you can provide absolute values rather than changes, or previous value and new value.
I've done this making an attempt to retrieve the stock quote from the source, and falling back to a timestamped on-disk cache of the quote when the main source fails or times out.