Skip to content

User guide RFM69 09

Florian edited this page Jan 27, 2019 · 1 revision

RFM69 gateway

Not yet updated with JSON functionnality

Level of complexity: high

The RFM69 gateway enables to send and receive signal from/to another RFM69 module. It is based on the work of @bbx10 https://github.com/bbx10/nanohab

First you need to define your modules properties in config_rfm69.h

const char PROGMEM ENCRYPTKEY[] = "sampleEncryptKey"; // define your key here, it must be the same on all the modules communicating with the gateway

const char PROGMEM RFM69AP_NAME[] = "RFM69-AP"; // define here the RFM69 access point name

#define NETWORKID 200 //define here the network id the same on all nodes that talk to each other

#define NODEID 10 // define here the nodeid, in the network this is the id of the RFM69, it will be used when another module send to the gateway

#define defaultRFM69ReceiverId 99 // default receiver id, if no RFM69receiverKey is specified the gateway will send to this receiver id

//Match frequency to the hardware version of the radio

#define FREQUENCY RF69_433MHZ

//#define FREQUENCY RF69_868MHZ

//#define FREQUENCY RF69_915MHZ

#define IS_RFM69HCW true // set to 'true' if you are using an RFM69HCW module

Once your have set your parameters, you can upload the program.

If your RFM69 is correctly connected you will see on the serial monitor: RFM69 Listening and transmitting at 433 433 in this case because I selected RF69_433MHZ for the frequency module.

Receiving data from RFM signal

Subscribe to all topics with mosquitto:

sudo mosquitto_sub -t +/# -v

Generate your RF signals with an Moteino on other RFM69 based devices, you will receive :

home/RFM69toMQTT 60,-98,0

In this case "60,-98,0" is the signal sent by another RFM69 + a wemos D1 with the sample sketch rfm69send loaded in it.

Send data by MQTT to convert it on RFM69 signal

`mosquitto_pub -t home/commands/MQTTtoRFM69 -m datatosend`

This command will send by RFM69 the string datatosend to the default receiver id 99

Send data by MQTT with advanced RFM69 parameters

RFM69 sending support one advanced parameters the target receiver ID

if you want to send to a différent receiver than 99 put inside your topic RCV_34, 34 representing the receiver you want to send data to.

Example: mosquitto_pub -t home/commands/MQTTtoRFM69/RCV_34 -m 33151562 will make the gateway send to the receiver ID 34 (node number) instead of 99

RFM69 acknowledgment

Unlike RF or IR RFM69 as a complete acknowledgment mechanism. When a signal is sent the RFM69 can acknowledge the fact that the recipient received the message. In this case the gateway will publish the sent message to the topic defined by subjectGTWRFM69toMQTT macro.

Clone this wiki locally
You can’t perform that action at this time.