Transfer video through uart

I have a OpenMV H7 plus. I want to transfer video through Uart of OpenMV H7 plus to IDE by pair P900 radio. I can set baud rate 230400. However, i use command: uart.send(img.compressed_for_ide()). It not run. Please help me!
This is P900 radio: Microhard - P900 Enclosed 900 MHz Spread Spectrum Wireless Modem.

This is my code:

import sensor
import time
from pyb import UART

uart = UART(1, 230400)

clock = time.clock()

while True:
img = sensor.snapshot()


You need to use Open Terminal and run the script through that.

See Tools->Open Terminal. This gives you a terminal with the ability to send scripts over it.

Then, you need to duplicate the REPL terminal over the UART which you can also do in Tools-> OpenMV Cam Settings.

1 Like

Thank you very much. You mean: copy the script into Terminal and run. i tried but but it doesn’t work. Please provide detailed instructions.

I placed OpenMV H7 on a robot. I let it run without a computer by modifying the code: while true = while(1). It’s running after the ball. Now I need to transmit video to my computer via P900 radio, wireless transmission. The first P900 radio is connected to Uart 3 of the OpenMV H7. The second P900 radio connected to my computer.

One more thing, I want to send variable values via uart, how do I do that? I tried:

uart.send(value_delta) or uart.send(108) or uart.write(108)

but none of them work

Hi, you need to enable the Tools->Openmv Cam Settings->Repl over UART feature.

Once you do this you should be able to see a repl prompt over that UART.

Once you do that the Open Terminal feature in the IDE can send scripts to the camera.

1 Like

So how should the code to be loaded into openmv be written? thank you!
Where should the code “uart.send(img.compress_for_ide())” be placed?

Once you have repl support working you use the Tools → Open Terminal feature in the IDE. From there you can click the green play button in the terminal window which will send the script you are running to the camera over the REPL UART and cause it to start running that script.

If you have that line of code in your script you will get images in the terminal.

1 Like

Hi! It ran but with the command: uart3.write(img.compress_for_ide())
Not: uart.send(img.compress_for_ide())
However, it’s very slow!
I had to compress it to get better: uart.write(img.compress_for_ide(quality=20))
But still very slow, color tracking is wrong
Thank you, I’m satisfied!

Opemv H7 is very useful, you can develop with dual core STM32 series (STM32H755ZI). Currently it has few features compared to Pixy2 Cam. I will register to become a sponsor for your team. at least $10 per month. Let’s try to make it as popular as arduino. Good luck!!! Love you guys!!!

1 Like

You need to make the UART faster if you want a faster image display. We can do 7.5Mbps on the UART if you can handle that.

1 Like