| Electronics > Projects, Designs, and Technical Stuff |
| Communication between multiple nodes and gateway |
| (1/1) |
| metRo_:
Hi, I'm developing a project where a gateway will get data from multiple nodes, 5 or 6 bytes of data. Each node is distanced from each other for about 1m. I need to get data from the nodes at 100hz. Right now I have two ideas to solve the problem. One is based on a RS485 bus and other is to connect the nodes on a chain where each node communicates with the next one. Considering the chain idea for 19 nodes I will have 6 bytes from Node[18] to Node[17], 12 bytes from Node[17] to Node[16],..., 120 bytes from Node[1] to Node[0], 126 bytes Node[0] to Gateway. There is a total of 1260 bytes transmitted on every event. For 100hz there is a total of 126000 what is about 1Mbaud. On a bus using RS485 there is less bytes being transmitted however I need to find a way to auto identify the nodes order on the installation and I need to use external hardware. If I choose the chain idea, should I use RS232 or it is ok to use UART? In the case of a RS485 bus what problems do you think I can face? Thank you |
| Nominal Animal:
If you treat the nodes as a shift register, the data rate is 6×19×100 = 11400 bytes per second. (12000 bytes per second for 20 nodes.) The first node will send 6 bytes 100 times each second to the second node, or 600 bytes per second. The second node will receive 6 bytes from the first node, and send 6+6 bytes 100 times each second to the third node, or 1200 bytes per second. The third node will receive 2×6 bytes from the second node, and send 3×6 bytes 100 times each second to the fourth node, or 1800 bytes per second. Node n will receive (n-1)×600 bytes from node n-1 each second, and send n×600 bytes to node n+1 (or MCU) each second. I don't see where you get that 1260 bytes per event, and thus the 126,000 bytes per second data rate. |
| metRo_:
--- Quote from: Nominal Animal on February 23, 2019, 05:34:59 am ---If you treat the nodes as a shift register, the data rate is 6×19×100 = 11400 bytes per second. (12000 bytes per second for 20 nodes.) ... I don't see where you get that 1260 bytes per event, and thus the 126,000 bytes per second data rate. --- End quote --- Thank you, I was mixing up two concepts. The calculations I did tell me the baudrate needed to get the data from the farthest node in under 1/100s but that is not a requisite. The chain idea is cheaper but if a node fails all other nodes will stop sending data. Using a RS485 bus, if a node fails it could also block the bus, can't it? |
| Nominal Animal:
--- Quote from: metRo_ on February 23, 2019, 10:12:06 am ---The chain idea is cheaper but if a node fails all other nodes will stop sending data. --- End quote --- Depends on the software. The way I'd do a simple chain, the nodes beyond the failed one would stop sending data. Another option is to make it a ring. Assuming ~ 1m intervals between nodes, and two UARTs per node, you could use ~ 2m cables between each pair: ╔═════╗╔════════╗╔════════╗╔══════ ═ ═╗ Hub N1 N2 N3 N4 N5 N6 Nn ╚══════════╝╚════════╝╚════════╝╚═ ═ ═╝ Note that this essentially makes the ring Hub - N1 - N3 - N5 - Nn - N6 - N4 - N2 - Hub. This way, the hub knows if the ring is intact or not, and can handle the failure of a single node. If a node fails, the hub can find out exactly where that node is. If multiple nodes fail, the hub can treat the two as separate chains, so that the still working nodes closest to the hub can still transmit data to/from the hub. |
| Navigation |
| Message Index |