OK so I’ve spent this afternoon trying to get Aurora equipped with wireless sync using nRF24L01 2.4GHz radios. I’ve used these radios for other projects, and they work great. They are not technically a “WiFi” and do not connect to any network, but instead create their own mesh networks. One radio can “speak” to up to five others, and they cost $2 each. Using the brilliant RF24 library communication between them is a breeze. Well, most of the time
What the hell am I doing?:
So I have Aurora running on SmartMatrix with no SD card, but with the MSGEQ7 chip, and the infrared receiver. Audio input and audio-sensitive patterns work great, infrared control also works.
I want to have several SmartMatrices running Aurora but synced over the wireless network. Imagine a four corner dancefloor. Each corner has a SmartMatrix. One of the four is connected to the live audio input, and transmits 30 times a second the following info: current playlist, current pattern, and the 7 audio bands. This allows the other 3 matrices to show the same patterns, and to “react” to the same beat without being actually wired to the audio. Neat? I think so. I really thought I could do this all in one Sunday, and to be honest I got ridiculously close. The only issue now is that when combined with the Aurora software, RF24 library spews corrupted data, and acts as if there is data to receive all the time.
There are two versions of the RF24 library:
- the original: https://github.com/maniacbug/RF24
- and this fork updated for Teensy: GitHub - nRF24/RF24: OSI Layer 2 driver for nRF24L01 on Arduino & Raspberry Pi/Linux Devices
I’ve mapped the radio to the pins unused by the matrix. I can load the radio sketch onto the Teensy while it’s connected to SmartMatrix, and it works like a charm, communicating with another teensy. So the hardware is wired correctly and definitely works. The issue is in the software somewhere.
To get RF24 spew crap here is what I added:
// somewhere at the top
#include <RF24.h>
RF24 radio(15,16); // chip select, CS (note that I commended out SD card pin reset)
.....
void setup() {
Serial.begin(115200);
delay(250);
radio.begin();
radio.printDetails();
}
The printDetails() method normally (and without Aurora on the same hardware) prints the following info:
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0x7276636552 0x72646e6553
RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0x7276636552
RX_PW_P0-6 = 0x20 0x20 0x00 0x00 0x00 0x00
EN_AA = 0x3f
EN_RXADDR = 0x03
RF_CH = 0x4c
RF_SETUP = 0x03
CONFIG = 0x0e
DYNPD/FEATURE = 0x00 0x00
Data Rate = 1MBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_LOW
However: when the same code is run together with Aurora, it outputs this garbage:
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0x7276636552 0x72646e6553
RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0x7276636552
RX_PW_P0-6 = 0x20 0x20 0x00 0x00 0x00 0x00
EN_AA = 0x3f
EN_RXADDR = 0x03
RF_CH = 0x4c
RF_SETUP = 0x03
CONFIG = 0x0e
DYNPD/FEATURE = 0x00 0x00
Data Rate = FF� F
Fodel = 0����p FF
��d(��Fd$)F"F H
�.� Kp K` K�\CK<`��p@��詿
CRC Length = ��d(��Fd$)F"F H
�.� Kp K` K�\CK<`��p@��詿
PA Power = �C�FKFFF
Obviously subsequent to this, using radio is useless, so I am trying to get just this part working – simple radio initialization. If anyone had seen this problem before or knows where to look, I’d be much obliged. Thanks!
Konstantin