Welcome new user! You can search existing questions and answers without registering, but please register to post new questions and receive answers. Note that due to large amounts of spam attempts, your first three posts will be manually moderated, so please be patient.
Because of un-manageable amounts of spam despite our use of CAPTCHAs, email authorization, and other tools, we have discontinued this forum (see the 700k+ registered users with validated email addresses at right?). Please email us any questions or post bug reports and feature requests on GitHub at https://github.com/jevois -- The content below remains available for future reference.

What could make Inventor 0.5.0 send code as if it were commands?

+1 vote

Suddenly, I can't 'save to jevois' in the code tab of inventor. Version 0.5.0. It was working....

I can 'load from jevois' OK, but when I hit the 'save to jevois' button after editing, I get the usual prompt, but then a popup with an error: "ERR: Could not write file /jevois/modules/..." and I see in the Inventor console window that I am getting a whole lot of 'unsupported command errors' from what looks like the code that I was trying to save. It's as if the code is being sent over the tty that was expecting commands. The only thing I can think that I might have done to contribute to this problem was send some binary to the console at one point.

I have taken that binary-sending code out (on the jevois as well by editing the file directly on the exported sd card) stopped and restarted Inventor and power-cycled the jevois camera a few times, switched to other vision modules etc and the problem persists. The code itself runs OK on the jevois and I can get the code back by doing 'load from jevois' OK, just can't save it back anymore.

Here's the first few errors from the Inventor console showing the USB log that makes me think the code is being sent to the wrong comms. The first line is probably where it all starts to go wrong and the rest is the first few lines of my code that I was trying to 'send to jevois'. It keeps this up for the entire file. 

ERR Unsupported command [JEVOIS_FILEPUT 29288]

ERR Unsupported command [import libjevois as jevois]

ERR Unsupported command [import cv2]

ERR Unsupported command [import numpy as np]

ERR Unsupported command [import math]

ERR Unsupported command [import sys]

ERR Unsupported command [import struct]

asked Jan 29, 2019 in User questions by Tcornall (700 points)
edited Jan 29, 2019 by Tcornall

2 Answers

+1 vote
 
Best answer
Indeed, we use the same serial-over-USB channel for both commands and to transfer data. It's a bit like in the good old days of kermit and such. After a JEVOIS_FILEPUT command, the command interpreter of JeVois is supposed to switch to receiving raw bytes that will be saved to a file.

Are you messing with the serial settings in any way (e.g., changing the line ending mode or such)?

Other than that, I have seen this problem once but could not really diagnose it as it just went away after rebooting JeVois. I had assumed then that my SD card got corrupted and writing to that specific file was not working anymore. But that does not seem to be your case. Have you also restarted the inventor? That may help as it could actually be that the cause of the problem is in the inventor rather than in the camera. Also, you are running the latest microSD card version?
answered Jan 29, 2019 by JeVois (46,580 points)
selected Jan 29, 2019 by Tcornall
Yep, rebooted everything. Problem still there.
No deliberate messing with settings or line-endings. Only 'inadvertent' messing with settings MIGHT be those binary data I sent. On Linux I've certainly seen the config of terminal emulators changed in that way and maybe something like that might be happening.
I'll check my SD image but I think it was the latest available only about a month ago, and it did work at the time.
Now that I know it uses the same channel, I can try a few things manually to see what happens, such as issue a manual JEVOIS_FILEPUT. (Is there doco about this? I'll go RTM...)
Worst case, I can try another SD card with a fresh image on it, and re-install Inventor.
Thanks!
0 votes

I cleared __pycache__ for my own code and found that suddenly the problem went away, for all modules. (I tried this after reading another similar issue on this forum) 

http://jevois.org/qa/index.php?qa=2586&qa_1=jevois-1-11-err-could-not-write-file-jevois-modules

answered Jan 31, 2019 by Tcornall (700 points)
...