SiKset.py, a python script to easily control your RFD900, 3DR radio from the command line

Want to control your serial radio from the command line?
Don’t want to remember the AT command set?

Introducing:

SiKset.py

A command-line tool to update settings on SiK firmware based radios, such as:

  • RF Designs RFD900+ (RFD900p, RFD868) serial
  • 3DR serial/USB radio

The idea behind this is to create a tool which, in the future, could be called by the ReachView app for easy viewing and control of the radio settings.

3 Likes
  • v0.0.7 is an Alpha release
  • limited to setting Air Data Rate only
  • designed to run directly on the Reach device
  • communicates with SiK version 2.x (multipoint firmware only)
  • compatible with Reach image v1.2 (current)
    • which uses python 2.7.3
    • and also uses pyserial module version 2.4

reach_2:~/serial-radio$ ./SiKset0.0.7.py --help
Usage: SiKset0.0.7.py [-p port_filepath] [-b baud]

Options:
–version show program’s version number and exit
-h, --help show this help message and exit
-v, --verbose Enables extra information output
-p PORT, --port=PORT Serial port filepath
-t, --test-baud Test serial port for correct baud rate
-l, --local Work with the local radio
-r, --remote Work with the remote radio
-b BAUD, --baud=BAUD Speed in baud. Valid speeds: [2400, 4800, 57600,
9600, 38400, 19200, 115200]. If no baud specified, it
will test.
–set-adr=SET_ADR Set the air data rate. Valid speeds: 4, 8, 16, 24, 32,
64, 96, 128, 192, 250


example command line:

$ cd /home/reach/serial-radio $ python SiKset0.0.7.py -v -p /dev/ttyMFD2 -l -b 57600 --set-adr=32

Download:

SiKset0.0.7.zip (3.0 KB)

-suggested install directory: /home/reach/serial-radio/
-you should run with the --verbose option to get a feel for what the script is doing and how long it takes to run
-please report any bugs
-feel free to improve the script and repost in this thread, or upload your own creation


Known bugs:
  • reports wrong version (v0.0.5)
1 Like

Very nice! One thing I’m not seeing is the NetID setting. Is this on Github so you can accept pull requests?

I was just going to post updates in this thread, but feel free to put it on Github if you like. I plan to add all the settings, but if you beat me to NETID, then that’s great!

  • v0.0.8 is an alpha release
  • adds ability to set: NETID, ECC, MAVLINK, OP_RESEND @mr337

reach_2:~/serial-radio$ python SiKset0.0.8.py --help
Usage: SiKset0.0.8.py [-p port_filepath] [-b baud]

Options:
–version show program’s version number and exit
-h, --help show this help message and exit
-v, --verbose Enables extra information output (debugging).
-p PORT, --port=PORT Serial port filepath. Default: /dev/ttyMFD2
-t, --test-baud Test serial port for correct baud rate.
-l, --local Work with the local radio. Default. Can’t be used simultaneously with remote option.
-r, --remote Work with the remote radio.
-b BAUD, --baud=BAUD Speed in baud (SERIAL_SPEED). Valid speeds: [2400, 4800, 57600, 9600, 38400, 19200, 115200]. If no baud specified, it will test… (factory default: 57
–adr=ADR Set the air data rate (AIR_SPEED) in kbps. Valid speeds: 4, 8, 16, 24, 32, 64, 96, 128, 192, 250. (factory default: 128)
–netid=NETID Network ID number (NETID). Valid IDs: 0 to 499 (factory default: 25)
–ecc-on Enable ECC.
–ecc-off Disable ECC. (factory default)
–mavlink-on Enable MAVLINK.
–mavlink-off Disable MAVLINK. (factory default)
–or-on Enable opportunic resend (OP_RESEND)
–or-off Disable opportunic resend (OP_RESEND) . (factory default)


example command line:

time python SiKset0.0.8.py -v -l -b 57600 --adr=16 --mavlink-off --or-off
verbose output / make changes on local radio / serial port @57600baud / set Air Data Rate to 16kbps / turn Mavlink off / turn OpportunicResend off

runtime: 37 seconds

Download:

SiKset0.0.8.zip (3.5 KB)


Known issues:
  • can’t set ECC (with the script or by hand) without ERROR
  • trouble getting a response when setting boolean (ON/OFF) values on remote radio

p.s. don’t forget to update your Reach units! ReachView 0.4.9 was released earlier today!

woot, you beat me to it. I’ve been hashing out my GNSS system.

If its ok I’ll throw this up on github when I get back from vaca, and put a credit to you and this post.

  • v0.0.9 is an alpha release
  • adds ability to set radio SERIAL_SPEED and will report EEPROM parameters
  • patch included to ReachView0.4.9, a framework with no functionality yet. It just shows future radio configuration parameters (all disabled at the moment).

Usage: SiKset0.0.9.py [-p port_filepath] [-b baud]

Options:
–version show program’s version number and exit
-h, --help show this help message and exit
-v, --verbose Enables extra information output (debugging).
-p PORT, --port=PORT Serial port filepath. Program default: /dev/ttyMFD2
-t, --test-baud Test serial port for correct baud rate.
-l, --local Work with the local radio. Program default. Can’t be
used simultaneously with remote option.
-r, --remote Work with the remote radio.
–show-parameters Shows all user settable EEPROM parameters.
-b BAUD, --baud=BAUD Choose our serial connection speed to the radio in
baud. Valid speeds: [2400, 4800, 57600, 9600, 38400,
19200, 115200]. If no baud specified, it will test.
(factory default: 57600)
–serial-speed=SERIAL_SPEED
Set the radio’s serial speed in baud (SERIAL_SPEED).
Valid speeds: [2400, 4800, 57600, 9600, 38400, 19200,
115200]. (factory default: 57600)
–adr=ADR Set the air data rate (AIR_SPEED) in kbps. Valid
speeds: 4, 8, 16, 24, 32, 64, 96, 128, 192, 250.
(factory default: 128)
–netid=NETID Set the network ID number (NETID). Valid IDs: 0 to
499 (factory default: 25)
–ecc-on Enable error correcting code (ECC).
–ecc-off Disable error correcting code (ECC). (factory default)
–mavlink-on Enable MAVLink framing and reporting (MAVLINK).
–mavlink-off Disable MAVLink framing and reporting (MAVLINK).
(factory default)
–or-on Enable opportunic resend (OP_RESEND)
–or-off Disable opportunic resend (OP_RESEND). (factory
default)


example command line:

python SiKset0.0.9.py --remote --baud=57600 --show-parameters
connect at 57600 baud / output settings from the remote radio

Download:

SiKset0.0.9.zip (5.8 KB)


Known issues:

  • same as v0.0.8
  • takes too long to finish (for now)

Hey!

Nice work. Is the project on Github?

Thanks!

Naw, but @mr337 volunteered to do it:

Hopefully you don’t mind me bumping the thread for updates in the meantime.

You really should, that would be a popular utility. We might be interested in using this too :wink:

Thanks for the encouragement. I will think about it.

OK, I have added the sikset script to GH https://github.com/mr337/sikset. I left out the ReachView patch as I didn’t feel like it should belong in the repo, but a PR against ReachView repo.

@bide I think you should reconsider creating a GH profile so you can be in charge in accepting new requests etc. Once you do I’ll be happy to transfer the repo to you!

1 Like