Saving received image in OPENMV H7 plus internal flash

Hello, I’m trying to save an image to the internal flash of OPENMV H7 plus ( from another OPENMV H7 plus) which isn’t working great.

This is the code I’ve been trying to use.

Receive image from CAM2

cs.low()
spi.send(b'SEND')
ack = spi.recv(320 * 240 * 2)  # QVGA and RGB565 format
cs.high()

# Save received image
img = image.Image(ack, sensor.RGB565, (320, 240))
img.save("/flash/img_slave.jpg")

This hasn’t worked well for me. it throws OSError, so i tried
if “/flash” not in os.listdir():
os.mkdir(“/flash”).
Still doesn’t work. What can i do about this ?

Hi, we mount disks differently than normal MicroPython. If no SD card is installed you don’t need to use the flash folder. It’s mounted by default as root. If you do have an sd card installed, then that’s root and the flash file system is hidden.

So, you just need to save an image in root.

Also, I highly recommend not saving images to the flash file system. Use an SD card.

Please use the RPC library for doing this. There’s an example.