Dear Luxonis Team,

We're looking to connect our OAK FFC 6P device via UART and stumbled upon the documentation provided here: https://docs.google.com/document/d/1r3en4EqgDG3hum8o5yS1DJ5vSCb6aNqyA38tIM8723U/edit.

Could you provide further assistance on this matter?
We used the following information from that documentation.

UART Configuration 

Make sure your user is in dialout group to not require elevated permissions 

sudo usermod -a -G dialout [username] 

Connect the UART adapter and check the name of the device with sudo dmesg 

Open the UART terminal (example for device ttyUSB0) 

screen /dev/ttyUSB0 115200 

Use CTRL+ESC key to enter "copy mode" which allows scrolling through the terminal. 

Use CTRL+D to exit (or CTRL+K or CTRL+\ if it does not work otherwise) 

We also connected using Picocom. Both methods give us output from the Luxonis board, but we can't send any input to it. We use USB-UART adapter (FTDI) and already tried out different models.
Any idea what the issue could be? We already checked the cables, they all have connection.

With kind regards,
Karol Rösner

  • Hi, I did some more tests, also with the oak-ffc-4p. When I was working with this, the same error occurred. The depthai version installed at that time was 2.22.0.0.dev+6bca6b80dc848e7ad1a97cd6de368a754a3e5653. After I installed depthai version 2.25.1.0, the program worked. So it seems there is a bug in the depthai version.

    Thank you for your help!

20 days later

Hi, I am facing the same issue. Have you discovered any solutions for it?

@liam Hey Liam,
we thing we killed the receiver part of our board. Our FDTI used 3.3V, the other 5V, the Luxonis Boards needs 1.8V.
We will get another one, we will try again with a correct FTDI.

Hi @KarolRsner
Sorry for missing this, let me know if you manage to get it working.

Thanks,
Jaka

Hi, when I execute the python program with DEPTHAI_LEVEL=trace, I get the following output:

[4AD2D016838860C6] [192.168.197.55] [1711641505.091] [host] [trace] RPC: [1,1,5804304869041345055,[1.0]]

[4AD2D016838860C6] [192.168.197.55] [1711641505.100] [host] [trace] RPC: [1,1,10182484530226687077,[5000,10,true]]

What does this output exactly mean?

This is the python program:

import depthai as dai

import time

pipeline = dai.Pipeline()

script = pipeline.create(dai.node.Script)

script.setScript("""

import serial

import time

ser = serial.Serial("/dev/ttyS3", baudrate=115200) 

while True:

    ser.write(bytes([17]))

""")

script.setProcessor(dai.ProcessorType.LEON_CSS)

config = dai.Device.Config()

GPIO = dai.BoardConfig.GPIO

config.board.gpio[39] = GPIO(GPIO.OUTPUT, GPIO.ALT_MODE_2)

config.board.gpio[38] = GPIO(GPIO.INPUT, GPIO.ALT_MODE_2)

config.board.uart[0] = dai.BoardConfig.UART()

with dai.Device(config) as device:

print("Pipeline started")

while True:

    time.sleep(1)

Thank you for your help

    Hi, I have another question. I suspect that the output from the board could be a protocol that is outputted during the boot process via UART. The data I actually want to send might be overridden by this protocol, which is why it's not being outputted.

    So, the first question: Do you think it could indeed be a protocol?

    And the second question: If it does turn out to be a protocol, do you know how to prevent or disable the sending of this?

    liam
    Shouldn't be of any concern, it's not a relevant message, just a dump of some request.
    Can you explain what you are trying to achieve/what is not working?

    Thanks,
    Jaka

    Hi, I am still trying to send data via uart to an esp32 and wasn’t sure if the output might be relevant.

    Thank you for your help

      Hi @liam
      Trying meaning it's not working for you? If that is the case could you explain more? Thanks.

      liam wasn’t sure if the output might be relevant.

      It shouldn't be relevant, no.

      Thanks,
      Jaka

      a month later

      Hi, communication via uart between the oak ffc 6p and the esp32 is now working. The following program should work for data transmission:

      import depthai as dai
      
      import time
      
      GPIO = dai.BoardConfig.GPIO
      
      # Define outputs for serial communication
      
      uartNum = 0
      
      uarts = {
      
          0: {  # Suitable for the custom TG board
      
          	'txPin' : 15,
      
           	 'rxPin' : 16,
      
          	'txPinMode' : GPIO.ALT_MODE_2,
      
          	'rxPinMode' : GPIO.ALT_MODE_2,
      
       }
      
      }
      
      pipe = dai.Pipeline()
      
      script = pipe.create(dai.node.Script)
      
      script.setScript("""
      
         import serial
      
         import time
      
         ser = serial.Serial("/dev/ttyS3", baudrate=115200)
      
         while True:
      
          	ser.write('hello'.encode('utf-8'))
      
        	     	time.sleep(1)
      
      """)
      
      script.setProcessor(dai.ProcessorType.LEON_CSS)
      
      config = dai.Device.Config()
      
      # UART TX
      
      config.board.gpio[uarts[uartNum]['txPin']] = GPIO(GPIO.OUTPUT, uarts[uartNum]['txPinMode'])
      
      # UART RX
      
      config.board.gpio[uarts[uartNum]['rxPin']] = GPIO(GPIO.INPUT, uarts[uartNum]['rxPinMode'])
      
      # Enable UART{uartNum}
      
      config.board.uart[uartNum] = dai.BoardConfig.UART()
      
      config.version = config.version.VERSION_UNIVERSAL
      
      with dai.Device(config) as device:
      
      		device.startPipeline(pipe)
      
      		print("Pipeline started")
      
      		while True:
      
         			 time.sleep(1)

      However, this program only works for me with a delay of about one second, and board information is still being sent over this channel. The problem is that when I try to send multiple pieces of data, too much is sent at once, causing the program to hang after a while and the data transmission to stop.

      These are debug messages before this happens:

      [50D28016838860C6] [192.168.197.55] [1714573454.837] [host] [debug] Timesync thread exception caught: Couldn't read data from stream: '__timesync' (X_LINK_ERROR)

      [50D28016838860C6] [192.168.197.55] [1714573454.837] [host] [debug] Log thread exception caught: Couldn't read data from stream: '__log' (X_LINK_ERROR)

      [50D28016838860C6] [192.168.197.55] [1714573455.840] [host] [debug] Watchdog thread exception caught: Couldn't write data to stream: '__watchdog' (X_LINK_ERROR)

      How can I either disable the protocols being sent from the board on this channel or redirect them to another channel?

      Thank you for your help

      Hi, I did some more tests, also with the oak-ffc-4p. When I was working with this, the same error occurred. The depthai version installed at that time was 2.22.0.0.dev+6bca6b80dc848e7ad1a97cd6de368a754a3e5653. After I installed depthai version 2.25.1.0, the program worked. So it seems there is a bug in the depthai version.

      Thank you for your help!

      Hi, unfortunately I expressed myself a bit unclearly, I'm sorry. What I meant is that the program now works with depthai version 2.25.1.0 on the oak-ffc-4p. Since you can only establish a connection to the oak-ffc-6p with depthai version 2.22.0.0.dev+6bca6b80dc848e7ad1a97cd6de368a754a3e5653, I can only stick with that. I have already upgraded to the latest FIP, but that did not change anything. Therefore, it seems that the problem is indeed related to the depthai version.

      Thank you for your help!