Using Jetson Nano to Read SBUS Receiver in Python

I am trying to read a Futaba SBUS receiver on the Jetson Nano. I am using a Python program to read from the Jetson’s RX pin (8). As per SBUS guidelines, I invert the signal using a circuit and I set the baud rate to 100000. I was also able to see the signals through an oscilloscope.

Here is the code:

#!/usr/bin/python3
import time
import serial

serial_port = serial.Serial(
    port="/dev/ttyTHS1",
    baudrate=100000,
    bytesize=serial.EIGHTBITS,
    parity=serial.PARITY_EVEN,
    stopbits=serial.STOPBITS_TWO,
)
time.sleep(1)

try:
    while True:
        data = serial_port.read()
        print(data)


except KeyboardInterrupt:
    print("Exiting Program")

except Exception as exception_error:
    print("Error occurred. Exiting Program")
    print("Error: " + str(exception_error))

finally:
    serial_port.close()
    pass

However, when I run the program, the program doesn’t show anything, as if pin 8 isn’t receiving any signals. Am I doing something wrong? Any help into this would be appreciated.

hello tomas,

the default baudrate configuration is 115200/8n1,
had you update the device tree to modify the nvidia,adjust-baud-rates property?
please check below for details, thanks
public_sources/hardware/nvidia/soc/t210/kernel-dts/tegra210-soc/tegra210-soc-base.dtsi

How do I update the device tree, and what do I do with the path you mentioned?

hello tomas,

you’ll need to download public release sources, check Jetson Linux | NVIDIA Developer for the L4T Driver Package (BSP) Sources.
please refer to developer guide and check Kernel Customization chapter to build the device tree blob. i.e. *.dtb, after that, you may see Flashing a Specific Partition session to flash a specific partition by using the command line option, ‑k.
thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.