Serial Data Transfer Protocol problem
Posted 13 April 2012 - 08:00 PM
So the console works wonderful and I can load dll's onto the SD card and send messages to the controller to load the dlls depending on what library I have made for each component I want to work with. Each controller library communicates in sync with a dynamic Windows user control to exchange events and values through the protocol and as a developer I no longer have to worry about the communication part and now can just create controls and snap them in on the fly depending on what I want the Netduino to control. So in theory I can control the Netduino from a windows app any way I want or control the windows app from the Netduino any way I want without knowing anything about the message layer.
Here is the problem. I got a bit cocky in that I got tired of compiling a Micro Framework dll and pulling the sd card loading the dll and resetting the netduino. So I decided to add streaming into the serial protocol that will send the dll file through serial and auto save to sd card and then load.
The main problem is since this is a protocol that has many message types once entering into a stream mode, since any byte in the file can represent 0 to 255 I no longer have a message terminator to let me know when I have sent the last byte of the file.
How to I tell my data received event I am done sending any byte 0 - 255? What kind of message End of Transmission can I use if binary data uses all of them?
I tried looking at the way the FTP protocol works to see if that would help but FTP sends a binary stream on a separate port from the one it actually exchanges messages. I do not want to use two different com ports with FTDI connections. There has got to be a better way.
- Paul Newton likes this
Posted 13 April 2012 - 08:58 PM
Posted 13 April 2012 - 09:25 PM
Posted 13 April 2012 - 09:30 PM
Posted 13 April 2012 - 09:39 PM
Posted 13 April 2012 - 10:52 PM
Posted 14 April 2012 - 04:58 AM
The Modbus protocol has been designed exactly for purposes like those.
Set this, read that...it's ridicolously simple, yet well standardized.
Have a look here:
Moreover, using such as protocol, there's literally plenty of 3rd party devices of *ANY* kind which can be connected with *no* effort.
Here is a "dummy-like" explanation of the Modbus:
Limitation of the Modbus itself:
- any message has to be no longer than 256 bytes;
- there's no any (standard) packetization for long-streams;
- no encryption;
- many more...
Hope it helps
Posted 14 April 2012 - 05:28 PM
Posted 14 April 2012 - 05:35 PM
Posted 14 April 2012 - 08:29 PM
Posted 29 September 2012 - 05:00 AM
"universal serial protocol" - that must be what they use on Star Trek to set up comms with alien races the Enterprise computers have never encountered before.
I always wondered how they did that. Commander Bendage to the bridge!
Hey Paul. Just wanted to let you know it's done. Take a look and tell me what you think.
Posted 30 September 2012 - 03:46 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users