usage

Discussion related to "under the hood" OpenMV topics.
pcls1026
Posts: 115
Joined: Tue Aug 22, 2017 1:33 am

usage

Postby pcls1026 » Thu Nov 14, 2019 1:32 pm

OpenMV Cam M7
I need an explanation of how to save an image frame buffer to the sd card; and then copy it back into the frame buffer so I can see it.

Also,
I still can't get UART3 to output the correct waveform. The waveform timing is correct but the voltage levels are wrong. [low=2.94V and high=3.26V.}

Jim Sullivan
User avatar
kwagyeman
Posts: 4003
Joined: Sun May 24, 2015 2:10 pm

Re: usage

Postby kwagyeman » Thu Nov 14, 2019 2:33 pm

Code: Select all

sensor.snapshot().save("/IMG.bmp")
img = Image("/IMG.bmp", copy_to_fb=True)
I don't know what's wrong with your UART. The code to send data via the UART works. Your camera I/O pin may be damaged.
Nyamekye,
pcls1026
Posts: 115
Joined: Tue Aug 22, 2017 1:33 am

Re: usage

Postby pcls1026 » Thu Nov 14, 2019 4:59 pm

I checked continuity and there are no shorts.
Why Can't I use UART-1?
pcls1026
Posts: 115
Joined: Tue Aug 22, 2017 1:33 am

Re: usage

Postby pcls1026 » Thu Nov 14, 2019 5:10 pm

I tried the code you sent me and I get OS ERROR: failed to write requested bytes.

I Used helloworld_1.py from the examples. I removed the while loop.

You spelled sensor wrong.

Jim Sullivan
User avatar
kwagyeman
Posts: 4003
Joined: Sun May 24, 2015 2:10 pm

Re: usage

Postby kwagyeman » Fri Nov 15, 2019 1:37 am

Sorry for the misspelling. I answer some of these posts on the phone on the go.

Code: Select all

import sensor, image, time

sensor.reset()                      # Reset and initialize the sensor.
sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sensor.QVGA)   # Set frame size to QVGA (320x240)
sensor.skip_frames(time = 2000)     # Wait for settings take effect.
clock = time.clock()                # Create a clock object to track the FPS.

sensor.snapshot().save("/IMG.bmp")
img = image.Image("/IMG.bmp", copy_to_fb=True)

while(True):
    pass
This works on my camera with an SD card.

Yes, you should be able to use UART 1. It's defined to be on. Does it not work?
Nyamekye,
pcls1026
Posts: 115
Joined: Tue Aug 22, 2017 1:33 am

Re: usage

Postby pcls1026 » Fri Nov 15, 2019 11:45 am

If it wasn't for the SPELLCHECKER I would misspell every thing.

I will try the code you sent.

I have not tried UART1, but I will.

I'll be back!! (A quote from Arnold S.)

Thanks,
Jim Sullivan
pcls1026
Posts: 115
Joined: Tue Aug 22, 2017 1:33 am

Re: usage

Postby pcls1026 » Fri Nov 15, 2019 11:57 am

Hi,
I tried your code above. It still gets the OSERROR.

Type "help()" for more information.
>>>

Traceback (most recent call last):
File "<stdin>", line 9, in <module>
OSError: Failed to write requested bytes!
MicroPython v1.11-omv OpenMV v3.5.0 2019-11-04; OPENMV3-STM32F765
Type "help()" for more information.
>>>
I'm haven't tried UART1 yet.

Jim Sullivan
User avatar
kwagyeman
Posts: 4003
Joined: Sun May 24, 2015 2:10 pm

Re: usage

Postby kwagyeman » Fri Nov 15, 2019 11:58 am

Do you have a uSD card inserted that the camera is able to read? When you plug the camera into the PC with the uSD card inserted you should be able to see files on it using whatever desktop explorer you have on your PC.
Nyamekye,
pcls1026
Posts: 115
Joined: Tue Aug 22, 2017 1:33 am

Re: usage

Postby pcls1026 » Fri Nov 15, 2019 12:22 pm

when I plug in the camera removable disk K shows up under computer in windows explorer.

However, using properties it says it has 80 KB which is not the size of the SD card.

I tried UART1 and the transmitter works correctly. So, I can use UART1 instead of UART3.

Jim
User avatar
kwagyeman
Posts: 4003
Joined: Sun May 24, 2015 2:10 pm

Re: usage

Postby kwagyeman » Fri Nov 15, 2019 12:40 pm

Ah, okay, that's why. The uSD card is not being found. That's the internal flash disk. You can't write images to that. Try another uSD card.
Nyamekye,
pcls1026
Posts: 115
Joined: Tue Aug 22, 2017 1:33 am

Re: usage

Postby pcls1026 » Fri Nov 15, 2019 12:43 pm

In the last post I forgot the most important thing. I had removed the SD card.

Now, when I put the SD card in the camera (with the 8 traces facing down in the connector) I get the same response in windows explorer.

I will get a new SD like you suggested and see if it works.

Just out of curiosity what the heck can go wrong with an SD card?

Jim
User avatar
kwagyeman
Posts: 4003
Joined: Sun May 24, 2015 2:10 pm

Re: usage

Postby kwagyeman » Fri Nov 15, 2019 1:22 pm

Typically the file system may get corrupted. Alternatively, we might just not be able to initialize it. The SD card standard let's manufacturers implement the cards in wildly different ways leading to you not being able to know how many clocks to give the card to startup. SD cards are not like SPI flash devices. They are much more complex.
Nyamekye,

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 6 guests