openmv to arduino

Discussion related to "under the hood" OpenMV topics.
hong
Posts: 3
Joined: Thu Oct 04, 2018 9:43 pm

openmv to arduino

Postby hong » Thu Oct 04, 2018 11:02 pm

Hi all,

noobie about programming here. I would like to ask if its possible for the openmv to save images directly into a microsd shield that is stack on arduino ? Rather than saving it onto the openmv microsd card slot. This is because the microsd card will log and save the data from other sensors that are connected onto arduino.

the microsd card shield is this: Image

If its possible, how do i go about it? any examples that i could follow?

Thanks in advance!
User avatar
kwagyeman
Posts: 2401
Joined: Sun May 24, 2015 2:10 pm

Re: openmv to arduino

Postby kwagyeman » Fri Oct 05, 2018 2:11 am

You have to send and image to the Arduino which doesn't have enough RAM to buffer an image...

Um, are you comfortable with serial comms and transactions over those comms? If not, then you're not going to want to go down the path your suggesting.
Nyamekye,
hong
Posts: 3
Joined: Thu Oct 04, 2018 9:43 pm

Re: openmv to arduino

Postby hong » Fri Oct 05, 2018 2:53 am

Hi,

thanks for replying.

I have the Arduino mega on standby, though it would be best if I can stick to Uno.

Well, I don't mind giving it a shot though.

For now, i have tried to copy the image from the Openmv flash drive onto the arduino microsd shield. But i can't find the path for the flashdrive.
Alternatively, I tried to redirect the sensor.snapshot().save onto the arduino shield, but no avail too.

All using UART comms.
User avatar
kwagyeman
Posts: 2401
Joined: Sun May 24, 2015 2:10 pm

Re: openmv to arduino

Postby kwagyeman » Fri Oct 05, 2018 12:01 pm

Well, once you take a picture and save it to disk on the OpenMV Cam you can open that file and stream the binary file over to the Arduino. However, the Arduino can't handle the file size in one go... so, you'll have to design a protocol to send over chunks of the image at a time to the Arduino for the Arduino to write to disk.

This is all a lot of work...
Nyamekye,
hong
Posts: 3
Joined: Thu Oct 04, 2018 9:43 pm

Re: openmv to arduino

Postby hong » Sat Oct 06, 2018 1:31 pm

hmm...

that seems to be the case. But i think i have a go at it. Is there any scripts for reference?

Also, I was just wondering if I do not use the microsd shield, it should be possible if i save the logged data onto the OpenMV cam microsd card directly from arduino since, since the data should be smaller in size? though the code would probably be more complicated? This is assuming that I do not send images from OpenMV to arduino... which means the openmv saves and logged the data received from arduino only..
User avatar
kwagyeman
Posts: 2401
Joined: Sun May 24, 2015 2:10 pm

Re: openmv to arduino

Postby kwagyeman » Sat Oct 06, 2018 1:44 pm

Sorry, I don't have any scripts for reference. Um, to be honest. I don't recommend doing what you are trying to do.

Anyway, as for the Arduino sending data to the OpenMV Cam and having the OpenMV Cam log it... that's actually much easier. Just send the data out the serial port on the Arduino and the OpenMV Cam can read the serial port and write the data to disk. For this... check out the Pixy Emulation UART scripts. They show off how to work the serial port.
Nyamekye,

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 4 guests