Two http connection on Nicla Vision

Context

I I use nicla to stream video over http connection. Client side, I use OpenCV/FFMPeg.

I want to send /retrieve custom data over another http connection

Question

How wo managed two http connection with openmv. Have you got a sample ?

thanks !

Hi, we don’t have code available for that right now. However, you can technically just create two copies of whatever streaming object you have and run both at the same time.

The RTSP video streamer example code just does one interface. It’s totally possible to make it handle multiple connections.

Hi,
I want to manage two connections:

  • One for video stream (using basique JPEG to reduce latency)
  • One for command (like sensor data…)

but I don’t know how to manage two connection on micropython and with these sample.
After opening one connection, python code can’t handle another connection.

I need to use usyncio?

Hi,
I want to manage two connections:

  • One for video stream (using basique JPEG to reduce latency)
  • One for command (like sensor data…)

but I don’t know how to manageg two connection on micropython and with these sample.
After opening one connection, python code can’t handle another connection.

I need to use usyncio?

It really depends how you structure your code. The RTSP server example just handles one stream at a time. Note that you don’t need to block on socket calls.

Yeah, usyncio is for doing more than one connection at a time. I don’t know how well it works though. An alternative is just to set the blocking time to be low on the socket calls. E.g. https://github.com/openmv/openmv/blob/master/scripts/libraries/rtsp.py#L354C38-L354C38

Then you can just poll for new data.

OK thanks.
I will test and update this topic after