Note that there are some explanatory texts on larger screens.

plurals
  1. PORS485: simple and reliable protocol
    text
    copied!<p>I'm trying to design a simple and reliable master/slaves protocol for a 2-wires RS485 bus.</p> <p>All the nodes on the bus have a unique address. One node is the master that is the only node that is able to start communications. All other nodes can't send anything until the master sends a request to them.</p> <p>I was thinking on simple "request/response" protocol: the master sends a request to a slave and wait for its answer. After that, M sends a request to another slave. Three scenarios could happen.</p> <ol> <li>Both frames (request and response) are correctly received by the destination and the transaction ends with no problem.</li> <li>The request from the master isn't received by the slave (checksum error). After a timeout, the master sends again the request. No problem.</li> <li>The response from the slave isn't received by the master (checksum error). After a timeout, the master could send again the request.</li> </ol> <p>IMHO, the last scenario is problematic. The slave isn't able to understand if the second request is exactly the same of the first, so it processes the request two times. What happens if the request is "move the motor two steps", "give me if a switch is pressend since last request", "toggle a relay", and so on?</p> <p>I think the simplest "request/response" protocol can't work well, except if the application level knows the limitations of the protocol and avoids requests that are dangerous if transmitted two times.</p> <p>Have you some good simple and reliable protocol to suggest? I don't want to reinvent the wheel.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload