Hi,
I would like one server adafruit feather rfm69 telling two clients how to operate. All the examples and projects I can find have a 1:1 setup server : client and I cannot get 1:2 to work. I think the problem is I don't understand the syntax of the reliable datagram manager.
The relevant section of the given example is below. This is the client from the Adafruit website -
#include <SPI.h>
#include <RH_RF69.h>
#include <RHReliableDatagram.h>
/************ Radio Setup ***************/
// Change to 434.0 or other frequency, must match RX's freq!
#define RF69_FREQ 868.0
// Where to send packets to!
#define DEST_ADDRESS 1
// change addresses for each client board, any number :)
#define MY_ADDRESS 2
This works out of the box for two feathers.
If I alter it to add an additional line for three feathers, only two work. I am changing the my_address for each of the three feathers and on the two clients I am changing the dest_address to point at the server. This is the server code -
// Where to send packets to!
#define DEST_ADDRESS 2
//red, aka left
#define DEST_ADDRESS 3
//green, aka right
// change addresses for each client board, any number :)
#define MY_ADDRESS 1
I would be very grateful for all help. Kind regards, Al
If you are still looking for an answer...
Your client works (or should work) fine as it only has one destination to send its data to.
That's why you have
// Where to send packets to!
#define DEST_ADDRESS 1
// change addresses for each client board, any number :)
#define MY_ADDRESS 2
You send your data to DEST_ADDRESS in the client.
In you server code you have
#define DEST_ADDRESS 2
#define DEST_ADDRESS 3
Note that you use the same "alias" DEST_ADDRESS for two different values,
In other words, you are saying "The destination address is 2" and then "No, the destination address is actully 3", e.g. you override the address 2 with 3.
I'd say you need something like
#define DEST_ADDRESS_1 2
#define DEST_ADDRESS_2 3
and then your server sends what you need to send for 2 as