Author Topic: Typology - Is this one to one or one to many?  (Read 5140 times)

tony.huy

  • NewMember
  • *
  • Posts: 7
Typology - Is this one to one or one to many?
« on: June 08, 2015, 12:55:33 PM »
Hi,

Is the RFM69W a one to one connection or can it handle say N senders to 1 receiver? If so, what how many senders?

Thanks in advance.
Tony

EloyP

  • Jr. Member
  • **
  • Posts: 58
Re: Typology - Is this one to one or one to many?
« Reply #1 on: June 08, 2015, 01:18:13 PM »
Hi,

Is the RFM69W a one to one connection or can it handle say N senders to 1 receiver? If so, what how many senders?

Thanks in advance.
Tony

Radio frequency (RF) signals travel through the air, and the air is by definition a shared medium, so any node can transmit and all other nodes will receive. So it is not one to one but one to many, or many to one.

How many senders are possible depends on how often each nodes transmits -- the medium (air) is shared but only one node can be transmitting at any point in time, otherwise a collision occurs and the data the other nodes receive is more likely corrupted because of the collision. For example, you can only have two nodes (1 sender and 1 receiver) but if the sender is transmitting 100% of the time then you cannot add a second sender as there would be collisions 100% of the time.

Cheers,

Eloy Paris.-

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: Typology - Is this one to one or one to many?
« Reply #2 on: June 08, 2015, 01:47:16 PM »
The Moteino transmission packet has three fields that are directly related to the 'points' in a link, and one 'field' that is indirectly defines to the link.  There was a good diagram of this floating around on the lowpowerlab site, but I can't seem to find it any more.
There is a good description of the network packet at: http://lowpowerlab.com/blog/2013/06/20/rfm69-library/

The three direct fields are: Network ID, Sender ID, Target ID.  These IDs are 8 bits long and support a direct Point to Point connection, each field providing 254 choices (255 is 'special').   A node defines its own target, and there is nothing to prevent multiple receiving nodes from using the same address so this supports one to one and one to many.  The 'special' targets ID is 255 which is a Broadcast address and this supports one to ALL (on the same 'network').  Note, when a target responds, only one target with a duplicate node ID can transmit at a time, otherwise, as Eloy explained, collisions can occur.

The 'indirect field' is used to optionally control encryption of the data.  It's not really a field in the packet, but it controls how the transmitted packet is encoded, consequently it is another means to control whether other nodes 'see' the packet or not.

So, to summarize, any network has two or more nodes.  Senders use their ID to send to one or more Target nodes in the network.  You have 255 potential networks and 255 potentially unique nodes.  You can send one to one, or one to many.  You just can't send many to one AT THE SAME TIME.  You can have a topology with one central node and many nodes that send to the central one, but they need to send at unique points in time.  The protocol has collision detection and 'some' limited correction in the form of retries.

Tom
« Last Edit: June 08, 2015, 01:50:20 PM by TomWS »

tony.huy

  • NewMember
  • *
  • Posts: 7
Re: Typology - Is this one to one or one to many?
« Reply #3 on: June 08, 2015, 01:52:22 PM »
Thanks EloyP.

In the NRF24L01 modules, there's a channel setting that moves the frequency 1MHz off the 2.4GHz baseline. It can go up to 127 MHz. In addition, it can handle 6 senders as each sender as an address it uses. I assume the address is used as some code modulation mechanism on the same frequency.

Does the RFM69W have something similar, or is coordination of one to many or many to one all done at the application level?

Does network ID and Node ID effect this or are those items simply part of the data transmitted and is handled in the firmware/application?

Thanks

tony.huy

  • NewMember
  • *
  • Posts: 7
Re: Typology - Is this one to one or one to many?
« Reply #4 on: June 08, 2015, 02:42:35 PM »
Hi TomWS,

That was great info. Thanks. Can I ask some followup questions:

(1) If you have two networks in the same area (ie. two sets of RFM69W) configured to different network IDs, does that cause a problem?

(2) Do all the radios run on the same rf frequency regardless of what the network, node, and target id is set to ?

THanks

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: Typology - Is this one to one or one to many?
« Reply #5 on: June 08, 2015, 03:21:19 PM »
Hi TomWS,

That was great info. Thanks. Can I ask some followup questions:

(1) If you have two networks in the same area (ie. two sets of RFM69W) configured to different network IDs, does that cause a problem?
Define 'problem'.  If you have both 'network's configured with the standard library, yes, they share the same frequency and will collide if sending simultaneously.  The filter in the RFM69HW will detect this and not give either radio 'garbage' data, but will not pass any information to either radio.  However, the library has a method that automatically looks for an acknowledge from the target and, if missing, will resend.  This can be used to provide a fairly reliable connection, especially if you have different Ack delay parameters for the different networks (the simultaneous collision won't occur again).
(2) Do all the radios run on the same rf frequency regardless of what the network, node, and target id is set to ?
Normally they do operate at the same frequency, but the library does have the ability to shift the frequency so you could set up different networks with different frequencies.  I haven't found this necessary as I only occasionally will have a collision that doesn't recover (I use the same Ack delay on all my networks).  I currently have 3 networks and probably 30 nodes in total.  My traffic is periodic, typically one transmission and one Ack for each node every ten minutes.  The nodes tend to self align, in that, when a collision occurs, one node sees it, the other is able to complete the transmission so, after a while, the nodes tend to 'avoid' each other naturally.

Tom

tony.huy

  • NewMember
  • *
  • Posts: 7
Re: Typology - Is this one to one or one to many?
« Reply #6 on: June 08, 2015, 03:35:04 PM »
When you say the library has the ability to shift frequency, I assume that means the radio has the ability to do that and the library capitalizes on it?

My project has up to 50 sensors needing to report to a central node that then takes the data and uploads it to the cloud. The data comes at a decent rate, every 2-3 seconds, all asynchronously on the 50 sensors. Have any suggestions?

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Typology - Is this one to one or one to many?
« Reply #7 on: June 08, 2015, 04:39:25 PM »
Yeah just use Gateway and Node, establish your settings. Then just change the NodeID for the 50 nodes. That's about it. Your gateway listens all the time. Your nodes "try hard" to get a message to the gateway in the sense that they avoid collisions by listening before sending.

tony.huy

  • NewMember
  • *
  • Posts: 7
Re: Typology - Is this one to one or one to many?
« Reply #8 on: June 08, 2015, 06:18:32 PM »
Thanks Felix. Can you explain "They try hard" to listen.... the nodes in my case are running on batteries and I need to stretch them as much as possible, so I try to have them sleep as much as possible every second.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Typology - Is this one to one or one to many?
« Reply #9 on: June 08, 2015, 06:30:21 PM »
See send vs sendWithRetry() in the library.
Also "try hard" means they will use a CSMA approach, they will sense the channel for activity and send only when clear. Much like polite humans, they talk one at a time, after the other has finished talking.

EloyP

  • Jr. Member
  • **
  • Posts: 58
Re: Typology - Is this one to one or one to many?
« Reply #10 on: June 08, 2015, 06:50:35 PM »
Also "try hard" means they will use a CSMA approach, they will sense the channel for activity and send only when clear. Much like polite humans, they talk one at a time, after the other has finished talking.

You forgot the "/CD" part after CSMA, i.e. CSMA/CD  ;)

Cheers!

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Typology - Is this one to one or one to many?
« Reply #11 on: June 09, 2015, 07:40:13 AM »
Yes ...it's  CarrierSenseMultipleAccess with CollisionDetection