RF24Ethernet - For DIY Internet of Things and Home Sensor Networks
Adding internet connectivity to RF24Networks using nrf24l01+ modules as ethernet cards
RF24Ethernet, What is it and how does it work?
For anybody not familiar with my blog, I have done a lot of recent work in improving the radio driver and related network library for NRF24L01+ radio modules, using Arduino and Raspberry Pi. These very inexpensive and feature-rish devices can be used to create your own home sensor network, with very little cost when compared to most available solutions.
RF24Ethernet will allow you to use a Raspberry Pi as the 'gateway' machine to your network, and lets you connect to your sensors directly, using any device that has a web-browser, whether it is an iPod, PC, etc. or your sensors can connect out to the internet for information.
RF24 - OSI Layer 2 radio driver for nrf24l01+ modules
RF24Network - OSI Layer 3 network driver for RF24
RF24Ethernet - OSI Layer 4 Protocol (TCP/IP) driver for RF24Network
RF24Mesh - Mesh networking layer for RF24Network (Dynamic config and topology)
How it works:
The RF24Ethernet library is currently in the proof of concept/development stage, so the interface is very basic, and uses the UIP TCP/IP stack. As of the initial release, it only supports TCP, not UDP, and is not very user friendly. The interface will likely be developed to match the standard Arduino Ethernet library as closely as possible, as the UIPEthernet library has done.
Actual usage is very limited now, with no translation being done between IP addresses and RF24Network addresses, so it will really only work between two designated nodes, until further development takes place. Eventually, it will be much simpler to configure and use.
Setup (Arduino & RPi):
a: Install RF24 lib
b: Install RF24Network (Development Fork)
c: Install RF24toTUN library
c: Install RF24Ethernet library
The current proof of concept interface borrows directly from the SerialIP library, using the UIP TCP/IP stack. Since testing seems very succesful at this point, the library will most likely be developed to provide a simpler user interface, similar to the Arduino Ethernet library. In its current form, a node running RF24Ethernet can act as a standard TCP server, and can function as a telnet or web server, by modifying the included example.
The library can be configured to use either a TCP/IP tunnel (TUN) or to work over Ethernet (TAP), as is the default, which allows your sensor network to be connected to your LAN in any number of ways.
How can this be used?
The possibilities from here are virtually endless, with very inexpensive sensor networks being provided with direct TCP/IP connectivity. At first, addressing etc, could be handled through IP protocols, saving the end-user the need of address configuration etc. This could even allow RF24Network to be utilized as a bridge betwen LANs, using sensor networks for emergency commuinications etc, when main connections are down. Testing shows that speeds across the network are slightly better than or equivalent to a dial-up connection, so it seems to provide a practical solution for low-speed data transfers like sensor data, text-based email or chat.
Results of Testing:
The above picture presents an idea of the latency, etc when sending ping requests of varying sizes from the RPi master node to a connected sensor node.
The only documenation currently available is right here, but the SerialIP and UIP libraries can be used as a reference for now. This post will be updated with links etc, as development takes place, and further blog posts will likely be made as things take shape. An example is included with the library
See https://github.com/TMRh20 for all related code/library downloads, and http://tmrh20.github.io/ for available documentation.