Communication between multiple nodes and gateway - Page 1
Forum section: electronics / projects

author: metRo_
author_rank: Regular Contributor
timestamp: February 22, 2019, 11:39:58 pm
content: 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 to Node, 12 bytes from Node to Node,..., 120 bytes from Node to Node, 126 bytes Node 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

author: Nominal Animal
author_rank: Super Contributor
timestamp: February 23, 2019, 05:34:59 am
content: 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.Nodenwill receive (n-1)×600 bytes from noden-1 each second,and sendn×600 bytes to noden+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.

author: metRo_
author_rank: Regular Contributor
timestamp: February 23, 2019, 10:12:06 am
content: Quote from: Nominal Animal on February 23, 2019, 05:34:59 amThank 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?

author: Nominal Animal
author_rank: Super Contributor
timestamp: February 23, 2019, 09:22:13 pm
content: Quote from: metRo_ on February 23, 2019, 10:12:06 amDepends 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.