Script Size Limit

Is there a limit on the size of the python script being run from the IDE?

I’m using the OpenMV-7 board and my .py file consist of 198 lines and it’s size is ~5KB, but I’m now reaching a point where I have to remove lines to be able to run it from the IDE.

Um, you shouldn’t be anywhere near the limit with a script that small. What’s the issue you are getting?

Try running some of the larger example scripts like pixy emulation.

I just tested using the example and the same problem occurred. It refuses to run it (I sent you video as PM). It works fine with smaller .py examples like the I running with them without the SD card inserted though.

I’ll run the test when I get home. That said, I just saw a video for the code. Not the code.

I didn’t send you my code since I was able to reproduce it with the example.

Hi, this looks like the weird Mac problem we’ve seen forever… it’s not an issue with the camera. The IDE is just not getting a response from the camera after sending the script. The script size probably has something to do with how USB packets are sent to the camera. The same script for me works on my PC with the same firmware version.

I have an idea. So, I’ll be down in the South Bay area next week to support a Rocket Launch at Planet Labs (day job). While I’m down there. I can bring my USB analyzer with me and scope out the packets sent to the OpenMV Cam by the PC. Fixing this issue would be really good for our Mac users.

To bypass the USBDBG stack… do this. Use the Open Terminal feature to open the serial port your OpenMV Cam is on. Do this without connecting the camera. Then, hit the run button to run the script in the editor window. The script should start outputting text. To see the frame buffer just add a:


At the end of the main loop. You should get the same performance as with the native USBDBG protocol.

I’m still having this problem with the latest IDE (v1.8.0) running on a Mac. Small scripts run fine from the IDE, but large scripts like the just don’t run. However, it runs fine on Windows.

I don’t really follow your instructions above. In particular where you ask to open the serial port where my OpenMV Cam is on, but do this without connecting the camera. If I don’t connect the camera, then /dev/tty.usbmodem1411 is not listed. Sorry I might be missing something.
Screen Shot 2017-12-17 at 8.44.17 AM.png

Hi, the Open Terminal feature needs the camera connected to the PC. What I was saying is not to press the “connect” button in the IDE. Open terminal just connects to any serial port and talks standard serial IO.

Um, I’m going to have a test image for Mac that may fix issues out this week. I’m just finish up a feature for a customer this weekend.

Got it now. Thanks for the clarification. The workaround is not ideal, but it works for now. Please let me know when I can download the fixed version to test it.

Screen Shot 2017-12-17 at 2.24.26 PM.png

See Camera disconnects from IDE when running script (sometimes) - OpenMV Products - OpenMV Forums.