# custom uart usage

Source: https://forum.modalai.com/topic/3830/custom-uart-usage
Category: VOXL SDK and Software (https://forum.modalai.com/category/47/voxl-sdk-and-software)
Tags: voxl-sdk
Posted: 2024-09-25 09:02:07 UTC by giladWDS
Replies: 4 · Views: 860

## giladWDS · 2024-09-25 09:02:07 UTC

Hi, 
I wanted to add a custom sensor to my voxel-2 through j19 UART.
now I see that this UART is reserved to RC-inputs. but even when I  disabled those in /etc/modalai/voxl-px4.conf, I still can't access the port.
I looked a bit and found this:
https://gitlab.com/voxl-public/voxl-sdk/core-libs/libqrb5165-io/-/tree/master/python?ref_type=heads
and tried using it with port 7.
when I tried to write it gave me the following:
ERROR:   voxl_uart_write: Bus '17' is not initialized
and on init, it gave:
Sending library name request: libslpi_qrb5165_io.so
Sending initialization request
Received standard error event SNS_STD_ERROR_NOT_SUPPORTED
Couldn't configure flight_controller sensor
ERROR:   fc_sensor_initialize failed
ERROR:   Failed to initialize slpi
ERROR:   Encountered error while initializing bus 17

so it looks like it is still looking for some RC sensor.
I guess my real question is how can I access SLPI UART as a user since I don't see them in /dev/tty*
Thank you

## Reply by giladWDS · 2024-09-25 13:20:53 UTC

@giladWDS To specify. my sensor is connected to a microcontroller. so also I prefer UART I can do i2c(I have tried and it didn't work as well) and I can do SPI if it works better.

## Reply by Eric Katzfey (ModalAI staff) · 2024-09-25 16:10:13 UTC (in reply to giladWDS)

@giladWDS The I/O on J19 is only for use with the DSP, not the Linux processor. If you are running PX4 then you would need to write a custom PX4 driver for your sensor. The libqrb5165-io library would allow access to the UART but only if PX4 is not already running on the DSP. It's either PX4 or libqrb5165-io, you cannot use both at the same time. You can get an applications processor (Linux processor) UART via some of our add-on boards but there isn't one available directly from any of the I/O connectors on VOXL 2.

## Reply by giladWDS · 2024-09-29 15:05:14 UTC (in reply to Eric Katzfey)

@Eric-Katzfey 
Thank you for the reply
The only board I have no for testing is:
MCCA-M0151-1
I use the USB portion for the wifi and see that it exposes a uart port- HS1 for the external USB board.
I can't seem to communicate with this HS0 port as a standalone port.
Is it only for external Flight controllers?

I looked into this:
https://docs.modalai.com/usb2-type-a-breakout-add-on/
but it seems to expose the same uart I can not talk to.
Can you please recommend me a board that won't affect the wifi capability but would add uart ports that I desperately need?

* EDIT:
also if push comes to shove I would appreciate sources on how to write and compile a px4 driver that reads from the uart on j19.

Thank you and best regards,
Gilad

## Reply by Eric Katzfey (ModalAI staff) · 2024-09-30 15:43:10 UTC (in reply to giladWDS)

@giladWDS M0151 should expose /dev/ttyHS1 for use. It's just a UART so it isn't specific to external flight controllers.
