Hello,
I don't know if this is the correct forum for this topic, sorry if not...
I have a customer that produces electronic devices and we developed a desktop application to connect a PC to one of these devices using serial port (USB). The aim of the application is to read and write device configuration. The communication between PC and device is made with a protocol designed by the customer. This protocol is based on bytes and it has 3 parts: header (10 bytes with sesion info, command,...), length (2 bytes) and data (length bytes). Maximum length is 1000 bytes, so when you need to read/write more data bytes the information is divided in several data frames. In this communication the PC is the master, so when the PC sends a command the device does the work and replies with some data. The device doesn't send data on its own, only synchronization data frames. For example, to read information this is the protocol:
- UI >>> Device: Read data (header [10 bytes] + length [2 bytes] + data [1 byte: subcommand byte] = 13 bytes)
- UI <<< Device: Data lengh, for example 3456 (header + length + data [5 bytes: subcommand byte, length 4 bytes] = 17 bytes)
- UI >>> Device: Accept length (header + length + data [1 byte: subcommand byte] = 13 bytes)
- UI <<< Device: Data sending (first 999 data bytes) (header + length + data [1000 bytes: subcommand byte, data 999 bytes] = 1012 bytes)
- UI <<< Device: Data sending (next 999 data bytes) (header + length + data [1000 bytes: subcommand byte, data 999 bytes] = 1012 bytes)
- UI <<< Device: Data sending (next 999 data bytes) (header + length + data [1000 bytes: subcommand byte, data 999 bytes] = 1012 bytes)
- UI <<< Device: Data sending (last 459 data bytes) (header + length + data [460 bytes: subcommand byte, data 459 bytes] = 1012 bytes)
- UI <<< Device: Finish OK (header [10 bytes] + length [2 bytes] + data [2 bytes: subcommand byte, ok byte] = 14 bytes)
- UI >>> Device: Finish OK (header [10 bytes] + length [2 bytes] + data [2 bytes: subcommand byte, ok byte] = 14 bytes)
I explained this to get an idea how the communication, device and PC work. And I have to say that this protocol can't change, I have to work with this.
Then the customer added a system to the device to connect it to the internet, so storing the IP address on the cloud and doing some changes in the application (using ASP.NET Identity for login), now we are able to connect the PC and the device through the internet. And this is posible without changing the protocol. In this case, first, you login with ASP.NET Identity account to get all available devices (and IPs) and then you connect to specific device using sockets. Remote control is done!
Now we have another goal: instead of direct connection between PC and device, we want to use Azure in the middle. In this case we want to use Azure to save historic data on the data base, control all changes made by users. The communication would be like this (using the same protocol):
UI >>> Azure >>> Device
UI <<< Azure <<< Device
Also we want to read some data from all connected devices every few minutes without user activity to monitor devices states (alarms, logs, energy consumption...).
I don't know if I explained very well all these things, if you don't understand I can try to explain in other way.
After that, this is my question: what Azure services/features can help me in these tasks? I know that there are a lot of ways and services (workers, jobs, virtual machines, IoT services,...) but I don't know them in deep. I suppose that there are more services that I didn't hear about. I want to know what would be the architecture that I should use.
Thanks in advance,
Jon.