send values to serial port

General discussion about topics related to OpenMV.
luisantunespena
Posts: 8
Joined: Wed Jun 06, 2018 11:11 am

send values to serial port

Postby luisantunespena » Wed Jun 06, 2018 11:24 am

Hello,
I'm using the example multi_color_blob_tracking_1.py and would like to send the main values frame size for red, green and blue to a serial port. The idea is to communicate with another program called csound (an audio processing software) which can receive serial data.
Which functions do I need for this?
Thank you.
Luis
User avatar
kwagyeman
Posts: 3205
Joined: Sun May 24, 2015 2:10 pm

Re: send values to serial port

Postby kwagyeman » Wed Jun 06, 2018 12:48 pm

Hi, for serial port sending please see the pixy emulation examples. They show off how to send data via the serial port.
Nyamekye,
luisantunespena
Posts: 8
Joined: Wed Jun 06, 2018 11:11 am

Re: send values to serial port

Postby luisantunespena » Thu Jun 07, 2018 11:00 am

Thanks for your answer. I was wondering if once the OpenMV Cam is connected via USB to the computer, if there is a simpler way to grab data from the camera. If so, could you give me an example? Thank you in advance.
User avatar
kwagyeman
Posts: 3205
Joined: Sun May 24, 2015 2:10 pm

Re: send values to serial port

Postby kwagyeman » Thu Jun 07, 2018 11:44 am

Hi, literally just use the print() method on objects. The output will then appear in the terminal in OpenMV IDE. A y program on a the computer can open the OpenMV Cam's serial port and read the print output while the script is running.
Nyamekye,
luisantunespena
Posts: 8
Joined: Wed Jun 06, 2018 11:11 am

Re: send values to serial port

Postby luisantunespena » Thu Jun 07, 2018 1:49 pm

Thanks for your kind reply! I'll try that.
Luis
User avatar
kwagyeman
Posts: 3205
Joined: Sun May 24, 2015 2:10 pm

Re: send values to serial port

Postby kwagyeman » Thu Jun 07, 2018 3:31 pm

Note you cannot use OpenMV IDE with the camera if another program is reading the serial port at the same time. To make your script permanent on the OpenMV Cam use Tools -> Save script to the OpenMV Cam.
Nyamekye,
luisantunespena
Posts: 8
Joined: Wed Jun 06, 2018 11:11 am

Re: send values to serial port

Postby luisantunespena » Fri Jun 08, 2018 3:23 am

That's it! Thank you very, very much! Now csound is receiving data from OpenMV!
And thanks for creating this wonderful project!
Luis
ondraga
Posts: 5
Joined: Thu Nov 15, 2018 11:15 pm

Re: send values to serial port

Postby ondraga » Mon Nov 19, 2018 4:02 am

kwagyeman wrote:
Thu Jun 07, 2018 3:31 pm
Note you cannot use OpenMV IDE with the camera if another program is reading the serial port at the same time. To make your script permanent on the OpenMV Cam use Tools -> Save script to the OpenMV Cam.
Hi!! I am trying to do the same. But while Save script to the OpenMV cam, I am getting an error Error: Cannot write file D:\\main.py. Disk full?!
User avatar
kwagyeman
Posts: 3205
Joined: Sun May 24, 2015 2:10 pm

Re: send values to serial port

Postby kwagyeman » Mon Nov 19, 2018 3:33 pm

Hi, please verify your drive is writable.
Nyamekye,
luisantunespena
Posts: 8
Joined: Wed Jun 06, 2018 11:11 am

Re: send values to serial port

Postby luisantunespena » Tue Dec 11, 2018 7:09 am

Hello,
is there a very simple solution to send the image of the camera to an external monitor? Do I need to run an external python script or is it possible to send a stream directly from the OpenMV IDE?
Thank you.
Luis
User avatar
iabdalkader
Posts: 918
Joined: Sun May 24, 2015 3:53 pm

Re: send values to serial port

Postby iabdalkader » Tue Dec 11, 2018 3:17 pm

luisantunespena wrote:
Tue Dec 11, 2018 7:09 am
Hello,
is there a very simple solution to send the image of the camera to an external monitor? Do I need to run an external python script or is it possible to send a stream directly from the OpenMV IDE?
Thank you.
Luis
What kind of monitor ?
luisantunespena
Posts: 8
Joined: Wed Jun 06, 2018 11:11 am

Re: send values to serial port

Postby luisantunespena » Tue Dec 11, 2018 4:46 pm

I mean one of the screens of the computer.
User avatar
kwagyeman
Posts: 3205
Joined: Sun May 24, 2015 2:10 pm

Re: send values to serial port

Postby kwagyeman » Wed Dec 12, 2018 12:46 am

Hi, the Microcontroller can't do that. It doesn't have the hardware to do so.
Nyamekye,
luisantunespena
Posts: 8
Joined: Wed Jun 06, 2018 11:11 am

Re: send values to serial port

Postby luisantunespena » Wed Dec 12, 2018 7:22 am

Thanks for you replies.
I think I might have led you to a misunderstanding.
My idea is to stream the images of the camera to a beamer in full screen. Instead of having the camera images in the OpenMV IDE, I would like to stream it to a beamer for an audio and video performance.
Is there a simple way to do this?
Thank you in advance and for your pacience.
User avatar
kwagyeman
Posts: 3205
Joined: Sun May 24, 2015 2:10 pm

Re: send values to serial port

Postby kwagyeman » Wed Dec 12, 2018 12:39 pm

Yes, as mentioned we just have a USB port. We don't have HDMI so we can't stream to a TV. You can fullscreen OpenMV IDE and resize the viewing window to make that fullscreen.
Nyamekye,
luisantunespena
Posts: 8
Joined: Wed Jun 06, 2018 11:11 am

Re: send values to serial port

Postby luisantunespena » Fri Dec 14, 2018 2:52 am

OK, I see. Thank you for your reply.
It seems like it is not ideal for the application I want to have of the camera. I need the images to be projected to an external screen and I need to send the image tracking information via serial port.
User avatar
kwagyeman
Posts: 3205
Joined: Sun May 24, 2015 2:10 pm

Re: send values to serial port

Postby kwagyeman » Fri Dec 14, 2018 9:43 am

So, we will have a solution for this soon that let's the camera transmit the image over the 5ghz spectrum using an NTSC transmitter. But, we don't have what you need now.
Nyamekye,

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 8 guests