broadcasting messages to a network of moteino

Started by gianmarko, October 29, 2014, 09:37:03 AM

gianmarko

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

Felix

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.

gianmarko

thanks a lot! going to test on the just orderes mote's :-)

gm

Bruno

#3
he is the same function for the network ID ?
For example, send a message to all the nodes #1 of all networks [1..255].

Felix

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 for more details about the packet structure:

Bruno

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 ?

Steinarrr

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)

TomWS