0
\$\begingroup\$

I have two USB Holybro 915 MHz Telemetry Radios. These are usually used with Mavlink for communication between drones and ground stations, but I would like to use them to send small amounts of data - say, an integer every few seconds - from one computer to another, without using Mission Planner or the Mavlink protocol. One radio is plugged in (USB) to my Windows 10 laptop, another is plugged in (USB) to another laptop running Ubuntu. I have written a very simple python script in an attempt to send one byte of data from the Ubuntu laptop to the Windows laptop via the radios.

Sending (Ubuntu):

import serial
ser = serial.Serial('/dev/ttyUSB0')
ser.write(b'\x00')

Receiving (Windows 10):

import serial
ser = serial.Serial('COM8')
while True:
   print(ser.read(1))

It is my understanding that, at their core, these radios are simply USB<->Serial adapters which communicate over radio, so I should be able to send serial data from one to another. However, this is not the case. I will send a byte, say b'\x00', and it will receive something like b'\xfe' on the other end instead of b'\x00'. I've tried using different byte values, but for the overwhelming majority of them (with the exception of b'\xff' and b'\xfe'), the values will be received differently. Is there an error in my setup?

Thanks

Link to the radios I am using: http://www.holybro.com/product/transceiver-telemetry-radio-v3-915mhz/

Firmware Version(installed via Mission Planner): RFD SiK 2.0 on HM-TRP

\$\endgroup\$
1
  • \$\begingroup\$ What data preamble length is needed to be sent reference this answer \$\endgroup\$ – Andy aka Mar 29 '20 at 18:26
0
\$\begingroup\$

I faced the exact same problem as I am working with a HolyBro V3. It gave me a headache for a while...

Finally, I figured it out that the Baudrate must be set to "57600" as it is the default baudrate for HolyBro chipset. Bingo was his namo!

If you want to change the baudrate, you have to somehow update the HolyBro firmware.

Here is my code for Receiver:

# Receiver
import serial

ser = serial.Serial(port='/dev/ttyUSB0',baudrate=57600,timeout=1)
while True:
    b = ser.read(50)
    print(b.decode())

and the Transmitter:

import serial
import time

ser = serial.Serial(port='/dev/ttyUSB2',baudrate=57600)
while True:
    ser.write(b'Hi There!')
    time.sleep(2.0)

Remember to set your serial port per your setup.

\$\endgroup\$
1
  • \$\begingroup\$ This works, thank you! For anyone reading this in the future, you can also use PuTTY to accomplish the same thing, given that your values for baud, data and stop bits, parity, and flow control are all the same. I actually ended up using this to run SSH on top of. Thanks for the help! \$\endgroup\$ – fleather2 Mar 11 at 15:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.