radino rf serial bridge
The radino rf serial bridge is an example for a uart bridge over radio.
Currently implemented is the functionality following radino wireless chips:
- CC1101 at 868.3 MHz (radino CC1101, radino32 CC1101)
- CC1101 at 922.5 MHz (radino CC1101, radino32 CC1101)
- CC1101 at 433 MHz (radino CC1101, radino32 CC1101)
- RF69 at 433 MHz (radino RF69)
- RF233 at 2.4 GHz (radino RF233)
At the section "Main configuration" within the sketch the used hardware has to be configured.
Which serial interface to bridge over wireless
#define BRIDGED_SERIAL_SELECTION BRIDGE_HWSERIAL #define BRIDGED_SERIAL_SPEED 9600
Which wireless chip is used
#define WIRELESS_HARDWARE CC1101_868_38400_p100
If and which pin is used to enter command mode
#define CONFIG_BUTTON_PIN 5
If TX and RX LEDs should display activity on the serial interface
#define USE_SERIALLEDS true
Define bigger buffers for the radio communication is necessary. Note that this only makes sense on radino32 modules with its bigger memory.
//#define MY_RADIO_BUFSIZE 4096 //Overide Buffer for data received from radio //#define MY_UART_BUFSIZE 4096 //Overide Buffer for data received from uart
- 1 select serial to bridge. Default: HardwareSerial1
- 2 select wireless chip. Default: CC1101 at 868mHz
- 3 Upload the sketch to your radino modules.
- 4 Connect serial hardware to the interface selected in step 1.
- 5 Data received by one module is written out one the other one.
By pulling down the commandModePin the module is put into the command mode, where wireless addressing can be changed.
The module will print the info string
N)wID:00 M)yID:FF T)gtID:FF L)istenBC:1 S)tore P)ing R)eload Q)uit
NwID: Network ID. Only messages from our network are accepted
MyID: Our ID. Messages targeted at our ID are received. Is used as srcId in messages. 0xFF: BroadcastAdress->is not ACKed
TgtID: Targets ID. Messages are sent to this device. 0xFF: Broadcast
ListnBC: Are we accepting messages targeted at the Broadcast ID 0xFF
Commands consisting of up to 3 chars can then be entered.
The chars are shifted in and on '\r' or '\n' the last 3 entered ones are interpreted as command.
"nXX": set network ID to XX (Hex) "mXX": set my ID to XX (Hex) "tXX": set target ID to XX (Hex) "lXX": set broadcast listening (Hex) (0->off, else->on) "s": store values to eeprom "r": reload values from eeprom "p": ping and list devices in range "q": exit command mode
"n2m55\r" -> command "m55" is executed "l0\r" -> command "l0" is executed "sss\n" -> command "s" is executed "qss\n" -> command "q" is executed
Output of the sequence "CommandModePin LOW", "p\r\n", "q\r\n"
Entering command mode N)wID:00 M)yID:FF T)gtID:FF L)istenBC:1 S)tore P)ing R)eload Q)uit > p p: Pinging neighbours ID MyRSSI TgtRSSI FF -30.50 -29.50 OK N)wID:00 M)yID:FF T)gtID:FF L)istenBC:1 S)tore P)ing R)eload Q)uit > q q: Quitting command mode OK