Can't get images to be written to micro-SD on OpenMV Cam H7

Can’t get images to be written to micro-SD instead of internal flash. The script includes the lines:
img = sensor.snapshot () (“example.jpg”)

The card is formatted with FAT16 under Windows and inserted into OpenMV. But the image is written to the internal flash

From manual: “8. Finally, if you insert a micro-sd card into the micro-sd card slot on your OpenMV Cam the micro-sd card will replace the internal flash drive for all of the above…Last, feel free to save pictures/video on a micro-sd card. Just don’t do this on your OpenMV Cam’s internal flash drive.”

I also read that need to transfer “OS” to the SD card for this. How to do it? Copy all files from internal flash to SD flash via PC and insert SD to OpenMV Cam? Tried it - it doesn’t work! What to do?

It’s likely the SD is not detected, if it is detected it should show up on the PC when the camera is connected like it’s a flash driver. Can you please to format it again, it’s best to use exFat if not possible use FAT32.

Did it, didn’t help!

Can you see the disk mounted when the camera is connected ? If not then it’s not detected, and you should try a different card.

Through the card reader, this SD 1gb is normally formatted and written in the system
Windows, read. Why doesn’t it fit OpenMV?

Some types of cards just have issues, please try any different type (I suggest Samsung EVO) and let us know how it goes.

I see only intermal flash and 3 files: .openmv_disk,,

Yes makes sense, the card is not detected at all, please see the reply above also might want to check the socket make sure there’s no dust inside or anything like that.

Thanks! appeared with the only .openmv_disk file. The internal disk is not visible. now. I’ll try to run the sketch.

1 Like

Can you help me more - swear if after the name I_ add a number in order of currentName:

some wrong in:‘images/’ + newName+counterNumber, quality=90)
How do you convert an int counterNumber to a string?

import  time, pyb , sensor, image, lcd, os
from pyb import  Pin, LED
sensor.reset() # Initialize the camera sensor.
sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE
sensor.set_framesize(sensor.QQVGA2) # Special 128x160 framesize for LCD Shield.
lcd.init() # Initialize the lcd screen.
pin0 = Pin('P4', Pin.IN, Pin.PULL_UP)
pin1 = Pin('P5', Pin.OUT_PP, Pin.PULL_NONE) #external LEDs

newName='I_' #prefix of file name
counterNumber=1 #numbher of file start from...
countCheck = 0


# Make a temp directory
if not "images" in os.listdir(): os.mkdir("images")

#internal LEDS
    lcd.display(sensor.snapshot()) # Take a picture and display the image.
    for i in range(4):
        if pin0.value()==0:
            countCheck += 1
            countCheck = 0
    if countCheck>=3:
          countCheck = 0
          img = sensor.snapshot() # make foto
'images/' + newName+counterNumber, quality=90)
          counterNumber +=1
          countCheck +=1

Work!!! Thanrs!!! Help me please one more. How to convert variable counterNumber from int to string? (‘images /’ + newName + counterNumber, quality = 90)

This is a very basic Python question you can find an answer to if you just Google, so please before the next question try searching first. ('images/%s%d'%(newName, counterNumber), quality = 90)

You helped me a lot, fought with SD flash for several hours!

1 Like