serial data save in MySQL database and video stream display at host pc

Discussion related to "under the hood" OpenMV topics.
winccwolf
Posts: 5
Joined: Fri Oct 26, 2018 4:05 am

serial data save in MySQL database and video stream display at host pc

Postby winccwolf » Fri Oct 26, 2018 7:14 am

Hi I have an application which I want to show the video streaming as it is now in the IDE but I want to be able to access the blob's data sent in the terminal so i can save them in MySQL database via another script in the host pc. Is there any way to use the data from the IDE show in the terminal window otherwise is there any other method or programme which i can display the video as normal but interact with the blob data they are sent to virtual serial?
Thanks in advance
User avatar
kwagyeman
Posts: 2387
Joined: Sun May 24, 2015 2:10 pm

Re: serial data save in MySQL database and video stream display at host pc

Postby kwagyeman » Fri Oct 26, 2018 3:52 pm

Hi, when you execute the print() statement and there's no IDE connected the data from the print statement is sent over the serial port to the PC via the VCP UART the OpenMV Cam appears as. Any application can open the serial port can read the data. Make sure to set the DTR line high when doing this.
Nyamekye,
rister
Posts: 14
Joined: Wed Oct 24, 2018 3:23 pm

Re: serial data save in MySQL database and video stream display at host pc

Postby rister » Sat Oct 27, 2018 10:05 am

Ok I tried this but I couldn't get it to work. Here's how I set it up. I saved the helloworld.py script to the camera then disconnected the IDE (even closed the IDE). On my pc you can see the COM6 port. So I opened up an Arduino IDE and was able to attach at the same baud 115200 but couldn't see the fps time that you can see when printing it out on OPENMV IDE terminal.

The difference is that when you open the OPENMV ide terminal you have to press the play button to start seeing the stream and with the Arduino (like you would do if you opened the terminal in a python script) this features seems not to be available.
User avatar
kwagyeman
Posts: 2387
Joined: Sun May 24, 2015 2:10 pm

Re: serial data save in MySQL database and video stream display at host pc

Postby kwagyeman » Sat Oct 27, 2018 5:36 pm

You need to make the DTR line high.

Please use another serial terminal in which you can control the DTR line. Parallax serial terminal will work. Google that term. Parallax serial terminal.
Nyamekye,
rister
Posts: 14
Joined: Wed Oct 24, 2018 3:23 pm

Re: serial data save in MySQL database and video stream display at host pc

Postby rister » Sat Oct 27, 2018 5:57 pm

Ok this makes no sense????? Good grief you are like a riddler. :roll: Who uses Parallex now adays anyway. Hell you have arduino references in your IDE but you can't get demonstrate how to use the arduino IDE?
User avatar
kwagyeman
Posts: 2387
Joined: Sun May 24, 2015 2:10 pm

Re: serial data save in MySQL database and video stream display at host pc

Postby kwagyeman » Sat Oct 27, 2018 6:09 pm

Hi, in the passenger seat in a car on my phone. I answer most of these help support emails on my phone. I just thought of a serial terminal that works that I've used before.

Arduino IDE does not set the DTR line. Note that the OpenMV Cam does not work with that IDE. We aren't an Arduino and don't advertise this...

As for why this behavior it's because of how the creator of MicroPython programmed the REPL system. He made it not output data on the DTR line being low. Since we are a MicroPython board we act like one using as much of the MicroPython stack as possible.

Since the Arduino IDE doesn't have a checkbox for setting the line you can't use it. You can use something like Terra term or other if you want to use a different serial terminal.

Note that in most programming languages you can control these lines directly in the API for a serial port object. For example, a pyserial object has a setDTR() method that causes things to work once turned on.
Nyamekye,
winccwolf
Posts: 5
Joined: Fri Oct 26, 2018 4:05 am

Re: serial data save in MySQL database and video stream display at host pc

Postby winccwolf » Fri Nov 02, 2018 4:27 am

Hi,
I think "rister" is misleading my question, all i wna to do is both stream the video to host pc and access the data which arrive at the terminal so i can save them in mysql via a script.
Thanks
winccwolf
Posts: 5
Joined: Fri Oct 26, 2018 4:05 am

Re: serial data save in MySQL database and video stream display at host pc

Postby winccwolf » Sun Nov 04, 2018 1:41 pm

Super doupler ! Thanks, that is awesome :D
You are doing a great job guys, much appreciated

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests