send values to serial port

Hi again,

Any news on that matter. I should also mention than when I connect the camera, I get a pop up message asking me if I want to update the firmware. When I try to update, I get an error message telling me I cannot connect to the cam’s normal bootloader. Might it be related?

In fact, I don’t need to pass a lot of data. Just a simple signal (string… or position value but it’s not even crucial) that I can easily detect with my Processing script.

Thanks for your help.
Olivier

Hi, yes, the interface library is finally out. I need to write documentation for the release before I can push the new binaries to OpenMV IDE.

As for your firmware update… what system are you using? Mac? Can you try twice?

Latest firmware is here: Releases · openmv/openmv · GitHub

If you have an H7 then the firmware to install is the OPENMV4/firmware.bin file using the Tools->Run Bootloader option in OpenMV IDE.

Once you do that checkout this script (it will be inside of OpenMV IDE soon) https://github.com/openmv/openmv/blob/master/scripts/examples/34-Remote-Control/popular_features_as_the_remote_device.py

And put that on the OpenMV Cam.

Then here’s the documentation on the interface library for Python: openmv/README.md at master · openmv/openmv · GitHub

Note that if you are using the USB VCP it is very difficult to debug the OpenMV Cam.

Given your requirements… however, just use print() to print text to OpenMV IDE. Then, once you are done with your OpenMV Cam script you can just open the same VCP port in processing and that text will appear on the serial port. The interface library is only needed if you are doing complex things.

Adding this to the documentation:

Please note that if you only need to read print() output from a script running on the OpenMV Cam over USB then you only need to open the OpenMV Cam’s Virtual COM Port and read lines of text from the serial port. For example (using Welcome to pySerial’s documentation — pySerial 3.0 documentation):

import serial

ser = serial.Serial("COM3", timeout=1, dsrdtr=False)

while True:
    line = ser.readline().strip()
    if line: print(line)

The above code works for Windows, Mac, or Linux. You just need to change the above port name to the same name of the USB VCP port the OpenMV Cam shows up as (it will be under /dev/ on Mac or Linux). Note that if you are opening the USB VCP port using another serial library and/or language make sure to set the DTR line to false - otherwise the OpenMV Cam will suppress printed output.

Hi,

All right, thanks so much. I will give it a go asap.

As for the print() function, that’s exactly what I used to do and it used to work perfectly. For some reason, it ceased to work when I tried to use the cam again recently. Maybe because of the firmware update. I’ll check.

Thanks again.
Olivier