open mv: everytime try to change main.py white led flashes, 'cannot write file...disk full!?' error

I have a simple script running

# connection handler camera receiving commands from computer
import io
import rpc
import struct
import sys
import utime
import pyb

blue = pyb.LED(3) # blue led
# The RPC library above is installed on your OpenMV Cam and provides mutliple classes for

##############################################################
# Call Backs
##############################################################
def hello_world(data):
    # current_time = "HH:MM:SS"
    # return struct.pack('%s', current_time)
    blue.on() # blue + green make a turqoise
    # return(struct.pack('s', b'hello'))
    return(struct.pack('6s', ('hello', 'utf-8')))

##############################################################
# Main
##############################################################
green = pyb.LED(2)
green.on()
interface = rpc.rpc_usb_vcp_slave()
# interface = rpc.rpc_uart_slave(baudrate=115200)
interface.register_callback(hello_world)
interface.loop()

whenever I want to change the code, I launch the IDE, try to connect (bottom corner click on usb) and then run tools/save as main. Then the IDE hangs and the camera flashes white LED. I must unbrick the camera after this and delete file system. THIS HAPPENS EVERY TIME.

is there a way to avoid this? Is there a way to write directly to the camera’s main (currently when the camera is mounted it is mounted as read only file system’(

am running the ubuntu version of the IDE version 2.6.8


I should clarify, I use the IDE to save the script as main and disconnect the IDE to run the camera headless. Do some rpc work, change to code, crash. Thanks!!! :slight_smile:

Hi, can you use an SD card with the system? The internal storage shouldn’t be full. But, you generally get these problems when the internal storage is full.

I don’t see any danger in your script otherwise.

I’ll add an sd card however Im concerned that there is some other behavior going on im not sure.

Do you think there is need to close() the interface loop of the slave device to ensure that port gets closed?

No, that’s not required. It happens automatically whenever the script execution stops.