Wireless Networking Over nRF24L01 2.4GHz Radios with Raspberry Pis

nerfnet project for audio transmission over radios using TUN/TAP virtual network device API and built-in Google Protocol Buffers.

Abhishek Jadhav
3 years ago β€’ Home Automation / Communication
Implementation of streaming audio (πŸ“·: TheResistorNetwork)

A couple of days back, Andrew Rossignol employed nRF24L01 radios to establish a wireless network between two Raspberry Pi computers. These low-cost transceivers come with an SPI interface (clocked at 10MHz for the project) that enables the exchanging of 32-byte packets across a radio link that can run at up to 2MBit on-air data rates. The idea started with transmitting audio data and video data over the radios but later figured out that due to throughput it was not possible to do with video data.

The radio's nerfnet relies on a concept of primary and secondary radios in which it doesn't matter which radio is primary and which is secondary. It just indicates which system initiates the request to exchange network packets.

The implementation started with exploiting the TUN/TAP virtual network device API under Linux on a Raspberry Pi. But achieved 90kBit throughput as measured by iperf. After creating the virtual network devices, the task was to bring the interface up programmatically so that the user would not need to bring the link up after each use of nerfnet. If you remember, this same approach is used by popular VPN software such as OpenVPN.

Next, to read frames from the virtual network device and send it across the nRF24L01 radios was done in the background thread. Each network frame is pushed into a queue and is popped from this queue when ready to exchange frames.

After all this programming, it was time to move this onto the hardware. You can see the connections made on the hardware in the above figure. The protocol used is the build-in protocol using Google's Protocol Buffers. The project is ready to go and hence the implemented use case involves SSH and streaming audio.

Rossignol says that it is also possible that if two users of nerfnet reside on the same channel that their packets will cause loads of errors for each other. It would be best to avoid that by selecting different channels.

If you are interested in using Rossignol's nerfnet project or contributing towards it, you can find more details on GitHub.

Abhishek Jadhav
Abhishek Jadhav is an engineering student, freelance tech writer, RISC-V Ambassador, and leader of the Open Hardware Developer Community.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles