• DepthAI-v2
  • Send data from host to script using Xlink not working

I spent hours on this. I have an OAK-1 camera connected to a host through USB. The following simple program will never print "received", it seems OAK-1 hangs
Any help?

import depthai as dai
import time
pipeline = dai.Pipeline()
script = pipeline.create(dai.node.Script)
script.setScript("""
import json
while True:
b = node.io['in'].get()
node.info(f'received')
""")
xin = pipeline.create(dai.node.XLinkIn)
xin.setStreamName('q')
xin.out.link(script.inputs['in'])
with dai.Device(pipeline) as device:
qIn = device.getInputQueue("q")
while True:
test = dai.Buffer()
test.setData(bytearray([1, 5]))
qIn.send(test)
time.sleep(2)

  • Hi @Thor
    You are on wrong log level 🙂

    Either use node.warn() or

        device.setLogLevel(dai.LogLevel.INFO)
        device.setLogOutputLevel(dai.LogLevel.INFO)

    Thanks,
    Jaka

Hi @Thor
You are on wrong log level 🙂

Either use node.warn() or

    device.setLogLevel(dai.LogLevel.INFO)
    device.setLogOutputLevel(dai.LogLevel.INFO)

Thanks,
Jaka

  • Thor replied to this.