Skip to content

Connects sensors/actuators to MQTT broker. Simpler than MQTT-SN. Runs on nRF24L01 hardware.

License

Notifications You must be signed in to change notification settings

VaclavSynacek/RF24SN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

RF24SN

Connects sensors/actuators to MQTT broker. Simpler than MQTT-SN. Runs on nRF24L01 hardware.

Overview

Overview

RF24SN consists of client and server implementations. Client implementations run on Arduino compatible microcontrollers. They can easily publish measured sensor values to MQTT broker or request values from MQTT broker to be used in actuators. The server implementations run on TCP/IP connected devices and perform translation from RF24SN protocol to MQTT protocol - they act as gateways between the relatively dumb clients and MQTT broker.

RF24SN Client

RF24SN Client is a library for Arduino compatible microcontrollers.

Publish Usage:

#define SENSOR_ID 1  //publishes to RF24SN/in/<nodeId>/1
       
float measuredValue = 3.14; //replace this line with actual sensor reading code
bool publishSuccess = rf24sn.publish(SENSOR_ID, measuredValue);

Request Usage:

#define SENSOR_ID 2  //request last payload fo RF24SN/out/<nodeId>/2
       
float requestValue;
bool requestSuccess = rf24sn.request(SENSOR_ID, &requestValue);
if(requestSuccess)
{
   Serial.println(requestValue); //replace this line with some action code (moving servo, LED on, etc.)
}

For more details see its own repository.

RF24SN Server

RF24SN Server software can be generally used as-is with only minimal configuration. It's sole purpose is to act as a gateway between RF24SN network and MQTT broker. It should be able to connect to any MQTT compatible broker - currently only mosquitto has been tested.

RF24SN on nodejs using node-nrf driver

Full featured implementation with little dependencies. Should run on all platforms where there is nodejs and the node-nrf driver / pi-spi driver - currently it has been tested on Raspberry Pi.

Usage:

sudo rf24sn -b mqtt://localhost:1883 -spi /dev/spidev0.0 -ce 25 -irq 24 -vv

For more details see its own repository.

RF24SN in C++ using RF24 driver

Full featured C++ implementation on top of RF24-rpi - a Raspberry Pi port of arduino RF24 driver. Currently only runs on Raspberry Pi.

Usage:

sudo RF24SN

For more details see its own repository.

RF24SN Spark Core Server

Full featured implementation of RF24SN for the Spark Core. It uses the SparkCore port of Arduino MQTT library and SparkCore port of Arduino RF24 library.

Usage:

flash to SparkCore, power up.

For more details see its own repository.

Compared to alternatives

RF24SN use cases are very similar to the following solutions, but with the following diferencies:

MQTT-S(N)

Both MQTT-S and RF24SN are meant to be MQTT simplifications for sensor networks with sleepy nodes communicating over unreliable radios. The differences are:

  • MQTT-S is a standard.
  • MQTT-S is closer to MQTT.
  • MQTT-S supports publish and subscribe to any MQTT topic; RF24SN supports publish and request only on predefined topic prefixes
  • MQTT-S implements subscription in MQTT sense, the gateway pushes MQTT messages to nodes when they wake up; RF24SN implements topic polling, nodes query for last known messages on a topics rather than waiting for the push.
  • RF24SN is more bit eficient.
  • RF24SN is much easier to implement
  • MQTT-S is agnostic of underlying radio tecnology, however most implementations only support ZigBee; RF24SN currently only suports nRF24l01 radio chips.

RFXduino

Both RFXduino and RF24SN implement client and server/gateway software for nRF24L01 radio networks. The differencies are:

  • RFXduino is open source and free for non-commercial use; RF24SN is open source and truly free as in speach (MIT license).
  • RFXduino suports all kinds of added logic such as email sending, SMS, shell command execution; RF24SN only supports publishing of and requests for individual values.
  • RF24SN is much easier to implement

RF24Network

Both RF24Network and RF24SN implement logic on top of RF24 driver, however with the following differencies:

  • RF24Network follows tree topology with each node capable of communication with 6 children nodes and 1 parent node; RF24SN follows star topology with the base capable of communication with 254 children nodes.
  • RF24Network supports transmission of any payload up to 32 bytes; RF24SN only supports publishing of and requests for individual float values.

About

Connects sensors/actuators to MQTT broker. Simpler than MQTT-SN. Runs on nRF24L01 hardware.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published