How to send an image across serial port and not interrupt other output or kill frame rate?

Discussion related to "under the hood" OpenMV topics.
Plaba
Posts: 3
Joined: Wed Mar 04, 2020 4:48 pm

How to send an image across serial port and not interrupt other output or kill frame rate?

Postby Plaba » Wed Mar 04, 2020 6:11 pm

Hello! I'm rather new to OpenMV, and I'm writing a Java application that connects to the OpenMV by a serial port.

I noticed that the OpenMV IDE was capable of receiving both the frames that the OpenMV captured, and at the same time receiving the uninterrupted output of the program. What would I need to do to replicate that behavior between a Java application and the OpenMV?
User avatar
iabdalkader
Posts: 1193
Joined: Sun May 24, 2015 3:53 pm

Re: How to send an image across serial port and not interrupt other output or kill frame rate?

Postby iabdalkader » Wed Mar 04, 2020 7:41 pm

You need to port this:

https://github.com/openmv/openmv/blob/m ... yopenmv.py

And there's an example that uses that module to execute a script and read the framebuffer:

https://github.com/openmv/openmv/blob/m ... enmv_fb.py
Plaba
Posts: 3
Joined: Wed Mar 04, 2020 4:48 pm

Re: How to send an image across serial port and not interrupt other output or kill frame rate?

Postby Plaba » Wed Mar 04, 2020 10:25 pm

Thanks for your reply!

I've already ported the script to Java. It's available at https://github.com/entech281/JOpenMV.

My problem is that I need to use the serial port for other data as well. What would I need to do not have the frame data and the other data print at the same time and get mixed together?
User avatar
kwagyeman
Posts: 4271
Joined: Sun May 24, 2015 2:10 pm

Re: How to send an image across serial port and not interrupt other output or kill frame rate?

Postby kwagyeman » Thu Mar 05, 2020 12:12 am

Hi, this uses the debug mode so they are already not mixed.
Nyamekye,
Plaba
Posts: 3
Joined: Wed Mar 04, 2020 4:48 pm

Re: How to send an image across serial port and not interrupt other output or kill frame rate?

Postby Plaba » Fri Mar 06, 2020 2:49 pm

Thanks a lot!

After a little digging, I figured out that I need to use the tx_buf API call to read the output of the program.

Thanks for your help!
User avatar
iabdalkader
Posts: 1193
Joined: Sun May 24, 2015 3:53 pm

Re: How to send an image across serial port and not interrupt other output or kill frame rate?

Postby iabdalkader » Fri Mar 06, 2020 5:02 pm

Yes that's right, you just need the tx_buf_len and tx_buf commands.

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 6 guests