Administrator
|
Hi Koch, Yes, definitely, we don’t want ascii – Juan also said the same last night. The wildcard makes sense, so from my understanding, to enroll a new device, we will need to create the Server Subscribe & Publish topics for each new unique Device and have the Device publish to the same Server Topic that all the devices use and Subscribe to its own unique Server Topic? Can you elaborate more about how that is setup on the Server and the Device. RE: MessageNumber: Will that be a 1 Byte rollover counter ? In regards the GPB, Juan says, it wont be a problem, just define the spec and he will implement it. The data coming from the Devices must go into a MySQL table and to push data to the devices, there must be an exit Table – does this make sense and are you in agreement with this approach ? Here how I picture an initialization of a new device
Now I suspect that there might be the need for separate Topic to achieve the Initialization of a New device as the SITEID# would not have been assigned by then. Let know your thoughts on that. Regards Neal From: Koch de Jager <[hidden email]> Hi Neal, I suggest we use Google Protocol Buffers to transfer the data. Rather than sending ASCII we will then send binary data which will be smaller where numbers are concerned. Even if we do not use Protocol buffers, I suggest using binary rather that ASCII as this is easier and faster for the uC to decode. An MQTT message consists of a topic and a payload. We use the SiteID in the MQTT topic. We can also put the command and a unique number in the topic. So if we look at one device talking to the server, it will be set up as follows: Server - publishes to topic 'Server/SiteID/Command/MessageNumber' - subscribes to topic 'Device/SiteID/#' (# is a wildcard and means that the server will receive everything starting with 'Device/SiteID/' Device - publishes to topic 'Device/SiteID/Command/MessageNumber' - subscribes to topic 'Server/SiteID/#' (# is a wildcard and means that the server will receive everything starting with 'Device/SiteID/' The Command identifies the structure of the payload of the MQTT message. So there is no need for a header, as the recipient derives the structure from the Command in the topic. The MessageNumber is used to identify the specific command and is incremented for each new command. It will then be in the response/acknowledgement of the command, and can be used to detect duplicate messages (if for some reason the message was resent but it was already received by the intended recipient) From what I read above the communication is always initiated by the device. case 1 Device 123 publish 'Device/123/Hearbeat/1' Server has no data publish 'Server/123/Ack/1' case 2 Device 123 publish 'Device/123/Hearbeat/2' Server has data publish 'Server/123/Upload/2' Device 123 publish 'Device/123/Ack/2' case 3 Device 123 has data publish 'Device/123/Upload/3' Server has no data publish 'Server/123/Ack/3' We need to also look at security. I will do some research on that. This is off the top of my head. Let me know what you think. Regards Koch On Thu, Jun 6, 2019 at 5:07 PM Neal Singh <[hidden email]> wrote:
|
Free forum by Nabble | Edit this page |