Page 1 of 1

usage

Posted: Thu Nov 14, 2019 1:32 pm
by pcls1026
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

Re: usage

Posted: Thu Nov 14, 2019 2:33 pm
by kwagyeman

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.

Re: usage

Posted: Thu Nov 14, 2019 4:59 pm
by pcls1026
I checked continuity and there are no shorts.
Why Can't I use UART-1?

Re: usage

Posted: Thu Nov 14, 2019 5:10 pm
by pcls1026
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

Re: usage

Posted: Fri Nov 15, 2019 1:37 am
by kwagyeman
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?

Re: usage

Posted: Fri Nov 15, 2019 11:45 am
by pcls1026
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

Re: usage

Posted: Fri Nov 15, 2019 11:57 am
by pcls1026
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

Re: usage

Posted: Fri Nov 15, 2019 11:58 am
by kwagyeman
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.

Re: usage

Posted: Fri Nov 15, 2019 12:22 pm
by pcls1026
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

Re: usage

Posted: Fri Nov 15, 2019 12:40 pm
by kwagyeman
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.

Re: usage

Posted: Fri Nov 15, 2019 12:43 pm
by pcls1026
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

Re: usage

Posted: Fri Nov 15, 2019 1:22 pm
by kwagyeman
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.