LowPowerLab Forum

Hardware support => Moteino => Topic started by: gianmarko on October 29, 2014, 09:37:03 AM

Title: broadcasting messages to a network of moteino
Post by: gianmarko on October 29, 2014, 09:37:03 AM
Hello to the local experts

i am using several moteino for home automation. i have a new application in mind, but in this application any moteino in the network must be able to broadcast a message that is received by all others, and then must wait for broadcasts from any other mote in the network

is this possible with the current hardware setup and the current libraries?

thanks

gm
Title: Re: broadcasting messages to a network of moteino
Post by: Felix on October 29, 2014, 03:07:01 PM
Hi,
If you look at RFM69.h there is this line:

#define RF69_BROADCAST_ADDR 255

So just send your message to node ID=255 and all listening nodes will receive it.
Title: Re: broadcasting messages to a network of moteino
Post by: gianmarko on October 29, 2014, 03:14:27 PM
thanks a lot! going to test on the just orderes mote's :-)

gm
Title: Re: broadcasting messages to a network of moteino
Post by: Bruno on December 09, 2014, 06:25:28 AM
he is the same function for the network ID ?
For example, send a message to all the nodes #1 of all networks [1..255].
Title: Re: broadcasting messages to a network of moteino
Post by: Felix on December 18, 2014, 10:48:46 AM
Quote from: Bruno on December 09, 2014, 06:25:28 AM
he is the same function for the network ID ?
For example, send a message to all the nodes #1 of all networks [1..255].
If I read that right, there is no broadcasting to all networks, only to all nodes on the same network.
The network ID is part of the SYNC header, see this blog post (http://lowpowerlab.com/blog/2013/06/20/rfm69-library/) for more details about the packet structure:
(http://lowpowerlab.com/wp-content/uploads/2013/06/RFM69_library_packet_structure.png)
Title: Re: broadcasting messages to a network of moteino
Post by: Bruno on December 19, 2014, 11:04:15 AM
When there are multiple Network, how to know those who are already taken ? (and therefore, those available).
A table in a reference gateway ? A loop?

And then how to transmit the Network ID to the nodes ? Via a reserved Network ?
Title: Re: broadcasting messages to a network of moteino
Post by: Steinarrr on December 19, 2014, 11:54:31 AM
You generally don't want your systems interfering with each other and i think that's why the network is defined in the code.

#define NETWORKID   100
#define GATEWAYID   1


Moteinos on different networks shouldn't be communicating, and what would be the point. i'm pretty certain Felix wouldn't want his garage door opened every time he gets mail hehe. Of course you can very easily tweak your code to allow this behavior, just call radio.initalize again with a different networkId. (I haven't tried it so i'm not 100% sure if re-initializing is okay)
Title: Re: broadcasting messages to a network of moteino
Post by: TomWS on December 19, 2014, 12:15:02 PM
Quote from: Steinarrr on December 19, 2014, 11:54:31 AM
...just call radio.initalize again with a different networkId. ...
See post: https://lowpowerlab.com/forum/index.php/topic,620.msg3988.html#msg3988  for method to set network id.