Camera disconnects from IDE when running script (sometimes)

I tried the ide you just uploaded above and I’m still seeing the disconnection issue with my main.py script. However, the example scripts work as expected and don’t cause a disconnection. Can you try to test on your end with the main.py script in the google drive link I sent you to confirm or deny what I’m seeing? In the meantime I’ll grab some usb packet traces with the latest ide. If you rev the ide again could you update the version to 1.8.1 or something so I’m sure that I’m running the correct thing? Thanks!

I am also having the issue. I’m using the 1.8.1 IDE and 2.7.0 firmware. Earlier in the thread it was said that your fix would look for firmware version 9.9.9. Is this still the case?

I also downloaded and ran Wireshark. I tried to upload the output but the forum doesn’t allow the .pcapng extension. The other extensions I can save to are all .pcap. I don’t know what those are.

Is there another way to get you the info.

FYI, it seems to break if the script size > 11,009 in size.

I can see my script being sent in the Wireshark packets. But other than that I don’t know what to look for.

Just zip the files.

As for the problem… It’s a weird subtle issue with how we’re using the serial port. Please upload the files in zip form and I can confirm.

FYI, it seems to break if the script size > 11,009 in size.

Yeah, so, the issue is that our USB serial protocol requires serial packets which are delivered 64 bytes at a time to not have two commands in them. However, we’re using the VCP protocol to send data which merges byte streams as efficiently as possible. Breaking this requirement.

So, to ensure this in OpenMV IDE we repeatedly flush the serial port until all bytes are sent. On linux and windows this means the bytes made it to the target. On Mac this means they made it to the OS kernel… which is not what we want.

For the latest IDE I put a small 3ms delay on Mac. I can increase that again to make this problem stop happening.

A better fix would be to make the USB DBG code better. But, going there is an issue.

What OS are you using? I can cut a new IDE for it very quickly.

Files? Plural? Wireshark just saved it as one file. I’ll upload that. If there is something else, let me know.

I’m using macOS High Sierra 10.13.3.
wireshark.pcapng.zip (90.7 KB)

Yeah, the same issue is still happening. Really need to get this fixed on the camera.

Okay, I’ll get a Mac IDE really quick with a fix.

http://upload.openmv.io/openmv-ide-mac-1.8.2/openmv-ide-mac-1.8.2.dmg

Let me know if the fixed worked. I just increased some command timeouts. Not a great fix… but, it should do the trick.

Yes! It works! :smiley: Thanks!

Okay, I’ll just leave this IDE up here then.

I’ll commit these changes.