Author Topic: Communication between multiple nodes and gateway  (Read 839 times)

0 Members and 1 Guest are viewing this topic.

Offline metRo_Topic starter

  • Regular Contributor
  • *
  • Posts: 90
  • Country: pt
Communication between multiple nodes and gateway
« on: February 22, 2019, 11:39:58 pm »
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

 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6830
  • Country: fi
    • My home page and email address
Re: Communication between multiple nodes and gateway
« Reply #1 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.)

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.
« Last Edit: February 23, 2019, 05:39:44 am by Nominal Animal »
 

Offline metRo_Topic starter

  • Regular Contributor
  • *
  • Posts: 90
  • Country: pt
Re: Communication between multiple nodes and gateway
« Reply #2 on: February 23, 2019, 10:12:06 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.

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?
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6830
  • Country: fi
    • My home page and email address
Re: Communication between multiple nodes and gateway
« Reply #3 on: February 23, 2019, 09:22:13 pm »
The chain idea is cheaper but if a node fails all other nodes will stop sending data.
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.
 
The following users thanked this post: metRo_


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf