Elixir Interface for nordic NRF24 radios
- Read/write pipe address
- Read/write tx address
- Send packets
- Receive packets
- Auto Ack packets
- Sane defaults
- Basic Usage documentation
- Processing packet data outside of the library
Be sure to check your local laws for legal radio bands. 2.4 ghz is a free band in most places, but be sure to check.
There is no common library for encoding/decoding packet data, so i decided to leave that up to the developer. So far i've tested this library with the following Arduino compatible libraries.
Currently i've only tested on Raspberry Pi, but it should work on any device that ElixirCircuits supports.
Below is an example of the most basic usage from the Elixir console
iex(1)> {:ok, pid} = RF24.start_link()
{:ok, #PID<0.1933.0>}
# cause a remote device to send a few packets..
iex(2)> flush()
{RF24, {:packet_received, 1, "Hello, world! x1"}}
{RF24, {:packet_received, 1, "Hello, world! x2"}}
{RF24, {:packet_received, 1, "Hello, world! x3"}}
iex(3)> RF24.send(pid, "Welcome to the world of radio!", true)
<<14>>
iex(4)> flush()
{RF24, {:packet_sent, 7}}
There is a complement to this arduino example in this project: [lib/rf24/simple_ping_pair.ex]
There is a repo here with some more examples
The NRF24 radios do not support hardware encryption. It is up to the developer to implement this if so desired.
The NRF24 radios do not support hardware based Received Signal Strength Indication. There is a single register that indicates if the last received packet was greater than or less than -24 dbm.