Hi, so, I’ve tried with the M7 with v2.7.0 and v2.8.0 and gotten no errors with this:
import sensor, image, time, pyb, mjpeg
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time = 2000)
m = mjpeg.Mjpeg('openmv_video.mjpeg')
clock = time.clock()
start = pyb.millis()
with open("time_stamps.txt", "wb") as f:
while(True):
clock.tick()
f.write("%d\n" % pyb.elapsed_millis(start))
m.add_frame(sensor.snapshot())
print(clock.fps())
if pyb.elapsed_millis(start) > 100000:
print('over')
#print(time)
m.close(clock.fps())
break
It’s the same code as before. However, I was able to reproduce the issue… when the SD card was not mounted straight. Please check that your OpenMV Cam’s SD card is fully inserted and that the pads are coming off of the SD card socket. I have a cam that’s got a damaged SD card socket and I was getting all kinds of errors.
Hmm… I made sure that the SD card was firmly in place, but I still have the same problem. I now also get an EIO5 error after I reconnect the camera… I will try using maybe on older firmware?
Ibrahim is digging deeper into this problem. He doesn’t quite know what it is yet. But, it will get solved. There’s definitely something funny going on with using the “with open” construct related to MicroPython - we’ve noticed that if you stop the cam using that call it crashes. If you try to open and close a file in the regular way things might improve.
no I copied and pasted the file location into the box and pressed run to upload the firmware. I tried it again as you requested and it still doesn’t work.
Hi, I’m attaching a new image, can you give it a try and let me know if it fixes the issue ? Note I changed the fw version to 2.9.1 to avoid any confusion. Also I’d format the SD first. firmware.zip (1.06 MB)
It sounds like you may just have an IDE timeout issue and it’s disconnecting because the camera didn’t respond to a command in time. If the light keeps flashing then the camera is working fine and it’s just the IDE disconnecting.
import sensor, image, time, pyb, mjpeg
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time = 2000)
led0 = pyb.LED(1)
led1 = pyb.LED(2)
m = mjpeg.Mjpeg('openmv_video.mjpeg')
clock = time.clock()
start = pyb.millis()
led0.on()
with open("time_stamps.txt", "wb") as f:
while(True):
clock.tick()
led1.toggle()
f.write("%d\n" % pyb.elapsed_millis(start))
m.add_frame(sensor.snapshot())
print(clock.fps())
if pyb.elapsed_millis(start) > 100000:
print('over')
#print(time)
m.close(clock.fps())
break
led0.off()
I am using the code in this discussion but am unable to get images or videos (jpg or mjpeg) to save. The file name will only show up on my computer once I have disconnected the device and reconnected it but will have zero bytes in it.
Are you still having this problem ? You should use the IDE to reset the camera instead of disconnecting it to give it a chance to unmount the filesystem.