Running Programs

General discussion about topics related to OpenMV.
pyb_
Posts: 6
Joined: Sun Apr 15, 2018 1:44 pm

Running Programs

Postby pyb_ » Sun Apr 15, 2018 1:49 pm

Hello,

Is there anyway to have the program run on the OpenMV without having it connected to the OpenMV IDE? I am new to micropython, I know it is not a compiled language, but can it run on the board without having the IDE running the program? I do not see any download buttons on the IDE.

Thanks,
User avatar
kwagyeman
Posts: 2041
Joined: Sun May 24, 2015 2:10 pm

Re: Running Programs

Postby kwagyeman » Sun Apr 15, 2018 2:07 pm

Please do:

Tools->Save Script to OpenMV Cam

And then:

Tools->Reset OpenMV Cam
Nyamekye,
pyb_
Posts: 6
Joined: Sun Apr 15, 2018 1:44 pm

Re: Running Programs

Postby pyb_ » Sun Apr 15, 2018 4:14 pm

When I do the "Tools->Save Script to OpenMV Cam", should there be any indication that the file has loaded successfully? I do "Tools->Save Script to OpenMV Cam", nothing happens, and then I do "Tools->Reset OpenMV Cam" and the LED's blink and the board resets. Everything was working earlier today, but now I try to save the same script to the OpenMV Cam and it does not seem to be working at all. If I play from the IDE, it works correctly. Not sure what I changed, but I cannot remember if there were LED's blinking or an indicator on the IDE when I "Tools->Reset OpenMV Cam"
pyb_
Posts: 6
Joined: Sun Apr 15, 2018 1:44 pm

Re: Running Programs

Postby pyb_ » Sun Apr 15, 2018 5:01 pm

I formatted my SD card and that fixed it. I believe I accidentally deleted Main and it could never rewrite it, or something along those lines.
User avatar
kwagyeman
Posts: 2041
Joined: Sun May 24, 2015 2:10 pm

Re: Running Programs

Postby kwagyeman » Sun Apr 15, 2018 5:05 pm

>> When I do the "Tools->Save Script to OpenMV Cam", should there be any indication that the file has loaded successfully?

Generally, it works on the first shot. However, the system can be hampered by corrupt disk stuff.

...

So, since the camera's file system appears tot he PC as a read-only device but is actually writable by the camera... be careful of the OS caching stuff. In particular, your PC will not write files to the camera except when it feels like it. You either need to safety remove the camera or let OpenMV IDE reset the camera to save files on the cam.

I put some extra code int the IDE also that saves the main.py file and then causes extra writes to make sure it gets flushed. But, anyway, if you're not using the two methods under tools then you'll run into weird issues related to the OS caching files to be written to the disk and not reading the disk again.

...

Yes, I wish there was a way to make this better. Note that we're using the standard MicroPython disk interface for this. All pyboards suffer from these issues and there's not really a clear fix.

That said, one nice thing... when you use an SD card with the camera your OS will use different drivers which flush all writes much more quickly than with the internal flash of the chip.
Nyamekye,

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 2 guests