I decided to have another look at OpenLRS and the older FPV model I have it installed into. The TX-RX link stopped working for no apparent reason a long time ago, and I hadn’t bothered to find out why or fix it.
The first problem was that I had a makeshift programming interface to the Hobbyking DIY module built into my every-day Turnigy 9X transmitter. The transmitter does have a USB ICSP programming interface built in for updating the ER-9X radio firmware. I decided to use the same USB interface and a double-pole switch to support both the radio and RF-module firmware updates. This took a couple of hours to install; having to break into the USB programmer to get access to the TXD, RXD and DTR signals for the RF module. The RF module needs a 3.3V interface and the USB FTDI is 5V. A few resistors in the data and dTR lines easily solved this problem (3.3K series resistors).
The latest version of OpenLRSng is 3.8.5. I downloaded the source zip, extracted and saved to the “sketchbook” folder and renamed to something sensible to reflect the version. NOTE: the .ino file must match the name of the folder for the Arduino IDE to find it and work.
I’m using version 1.5.5 of Arduino. Select the “Arduino Pro or Pro Mini” board and “ATMega328 (5V, 16MHz)” processor. NOTE: although the RF module is running at 3.3V, it is operating at 16MHz. This is not recommended but typical of the poor design common to this hardware.
Edit the main file to enable compiling of the TX for the Orange TX module. The OpenLRSng code then compiled and downloaded into the transmitter RF module. Without do any other configuration the channels seem to be all bunched up at about 435MHz, according to the RF-Explorer.
I had to work through and update the instructions below to get things going again. Hopefully it will be easier next time.
I decided to update the OpenLRS version I was using and adjust the channel frequencies. Having done this before I thought, no problem, I’ll just follow my previous instruction; yea right 🙁
The first minor annoyance was that Arduino prompted me to upgrade to the latest version. I had a look at it and decided that was more trouble than it was worth, considering the little use I make of it.
Following the link below to the RC Groups thread to find out what is the latest version, the first post says it is V3.7. The last version I tried was 3.5.1. Next I followed the link to the GitHub page where there’s a link to a zip file. But, the zip file is way out of date, and I can’t be bothered with GitHub at the moment. How do you find out what version OpenLRS you have already and what version you are looking at? There is a version.h file but it doesn’t contain any plain text version number, would be nice if it was in the file name ie. “version_3v51.h” or something similar.
To clone from GitHub to the PC using Linux command line: $ git clone http://github.com/openLRSng/openLRSng.git
My gripe is that for anyone stopping by infrequently or for the first time, all these silly little bugs and omissions only add to the impression that these open source projects are inferior. And IMO it’s true, simply because of presentation.
If you can get past all these silly little problems and find some basic information and instructions, it is a great project.
Sure there is a RC Groups thread full of information and helpful hints; some 375 pages effectively hiding the few bits of information that make all the difference. But this is mostly just how busy forums work; keep up or forget it.
What is OpenLRS and how to use it
Note: I use Linux; specifically, Kubuntu. Most of this should apply just the same to Windows, but I don’t know about Windows and can’t help with it; sorry.
OpenLRSng RCGroups thread Here.
The procedure is:
- flash the TX module with the latest code
- you can update the factory defaults in binding.h
- flash the receivers
- use the CLI via TX to randomise
- configure receivers via radio link from CLI if required
- bind receivers
- ready for use
Flashing, loads the firmware into the Transmitter and Receiver modules using the Arduino IDE and USB-FTDI or similar interface. The interface must be 3.3V and not 5V for the Hobbyking Orange LRS modules.
- Download the OpenLRSng zip file and extract.
- Copy the OpenLRSng folder to your Arduino sketchbook folder. (folder and sketch names must be the same)
- Run the Arduino IDE and open the OpenLRSng sketch.
- Edit OpenLRSng file to set: “COMPILATION TARGET” to compile TX, “TX BOARD TYPE” as 2 and “RX BOARD TYPE” as 3.
- Plug the module into the PC via the USB-FTDI adapter.
- Verify/Upload to compile and upload the firmware to the module.
Notes – trick and traps:
- Make sure the FTDI adapter is configured for 3.3V and the VCC output from the adapter is disabled. If VCC is supplied from the adapter, the target cannot be reset with power-on which makes it very difficult (almost impossible) to access the command line interface (CLI).
- TRAP: If the hardware type is specified twice (for TX and RX) it will only go with the RX selection (second in sequence). This will seem to load but if the wrong hardware, the red LED will blink and it will freeze. If the USB terminal is enabled it displays “hardware locked?” repeating.
Configuring – using the CLI
The Command Line Interface. You need a terminal connected to the serial port of the transmitter (the programming interface). You can use other terminals such as minicom (Linux), but I find the Arduino serial monitor (Arduino Tools menu) is simple and works well.
After flashing the modules, configuration is done via the Transmitter and the programming interface using the Serial Monitor (terminal) from the Tools menu. Set the baud rate to 115200 and “carriage return” on.
- Connect the transmitter using the FTDI programming interface and open the IDE serial monitor.
- If using the Arduino serial monitor ensure that you have set 115200 baud and “carriage return” at lower right.
To Enter CLI
Turning on the transmitter while connected to the serial monitor, it reports something like “OpenLRSng TX starting 3.8.5 on HW 2”. To enter the CLI, turn on the transmitter while holding the button; as for the binding process. While beeping, press enter on the keyboard (with the cursor in the send text line at the top of the window) to send a single CR to the transmitter. This will initiate the CLI.
- S = save and exit
- R = calculate a new random key and hop list
- I = initiate the factory defaults – I think this replaces settings in EEPROM left over from previous versions.
- F = display actual channel frequencies
- 1 = set new base frequency
- 5 = manually set hop-channels (eg. 1,5,8,12,21,2)
- 6 = datarate – set to 2 for faster servo update, 1 is probably OK for planes
Enter CLI configuration mode: something like this appear:
3.5.1 – System configuration
Use numbers [0-9] to edit parameters
[S] save settings to EEPROM and exit menu
[X] revert changes and exit menu
[I] reinitialize settings to sketch defaults
[R] calculate random key and hop list
[F] display actual frequencies used
[Z] enter receiver configuration utily
1) Base frequency: 434000000
2) RF magic: 70EB6788
3) RF power (0-7): 7
4) Channel spacing: 5
5) Hop channels: 13,37,11,47,6,45
6) Datarate (0-2): 2
7) Channel config: 8
8) Telemetry: Transparent
9) Serial baudrate:115200
0) Mute buzzer (mostly):No
A) Inverted PPM in :No
B) Micro (half) PPM :No
Calculated packet interval: 25000 == 40Hz
Now you enter the letters/numbers at the start of each line and (press enter) for that sub-menu or to edit the option.
It is advisable to always randomize to get random channels so press R to do that.
You can use the menu to change settings to your liking, but the defaults should work.
After you are happy with the settings use “S” (and enter) and the module will save and resume to sending binding packets.
- The TX is not going to transmit anything before it gets a valid PPM signal.
- Binding must be re-done if any CLI settings are changed as the settings are transferred during binding (and saved in the Receiver).
The receiver setup is done over the wireless link from the transmitter. While you still have the serial monitor connected to the transmitter, command “Z” and “enter”, then power on the receiver. You should see a menu something like this appear:
openLRSng 3.5.1 – receiver configurator, rx sw 3.5.1Use numbers [1-D] to edit ports [E-Q] for settings
[R] revert RX settings to defaults
[S] save settings to RX
[X] abort changes and exit RX config
RX type: Flytron/OrangeRX UHF 8ch
1) port 1function: RSSI
2) port 2function: PWM channel 1
3) port 3function: PWM channel 2
4) port 4function: PWM channel 3
5) port 5function: PWM channel 4
6) port 6function: PWM channel 5
7) port 7function: PWM channel 6
8) port 8function: PWM channel 7
9) port 9function: PWM channel 8
A) port 10function: AIN
B) port 11function: AIN
C) port 12function: RXD
D) port 13function: TXD
F) Failsafe delay : 1.0s
G) PPM stop delay : Disabled
H) PWM stop delay : Disabled
I) Failsafe beacon frq. : 433920000
J) Failsafe beacon delay (0-255 => 10s – 150min): 40000
K) Failsafe beacon intv. (1-255s): 10
L) PPM minimum sync (us) : 3000
M) PPM RSSI to channel : DISABLED
N) PPM output limited : N/A
O) Timed BIND at startup : Enabled
P) Slave mode (experimental): Disabled
Q) Output before link (=FS) : Disabled
- Channel 6 can be a PPM output, Orange-RX CH4 (5th from the RSSI end)
- S = save to receiver (will see “RX Acked – update successful!”)
- X = finished, return to TX menu
Hold the transmitter button and turn the transmitter on. Wait for the first beep then release the button. The beeping continues and the mode LED continues flashing green. Apply power to the receiver, which will bind and the transmitter beeping will begin again. Turn off and restart the transmitter.
Normally, NO bind plugs etc. are required on the receiver. Except: with a jumper on ch1-ch2 if you disabled ALWAYS_BIND in the OpenLRSng.ino file). The receiver should quickly light BOTH of the LEDs indicating it has been bound to the transmitter. Now power cycle the TX to resume normal operation.
NOTE: holding the button too long on the transmitter when powering on will enter adaptive channel selection. If the serial monitor is connected it may display “Entering binding mode”, or “Entering adaptive channel selection, picking 6” or similar.
Binding saves the required settings to the Receiver EEPROM allowing it to operate with that particular transmitter. many receivers can be bound to one transmitter.
Binding must be re-done if any CLI settings are changed as the settings are transferred to the receiver during binding.
Using a HS Orange Receiver as a Transmitter
Choose to compile for TX and TX board type 3 (Flytron OpenLRS Rx v2 Board / OrangeRx UHF RX / HawkEye UHF RX working as TX)
- CH4 is the CPPM signal input (5th from the RSSI end)
- CH3 is the button input (switch signal to gnd)
- CN1 is a buzzer control output (internal drive)
- RSSI is a buzzer drive output (external drive – various tones)
It needs the button available externally and a buzzer connected for binding receivers. Bringing out the LEDs is also a good idea.
Configure using the CLI configuration mode described above.
There is a base frequency specified and a channel spacing (5 = 50KHz). Hop channels are specified as numbers between 1 and 255.
434000000 = 434MHz. With a 50KHz channel spacing you get 434.05, 434.1, 434.15, 434.2 etc.
It’s probably a good idea to keep the channels reasonably close to minimize overall bandwidth, but wide enough to avoid one signal from jamming operation.