Welcome new user! You can search existing questions and answers without registering, but please register to post new questions and receive answers.
Welcome to JeVois Tech Zone, where you can ask questions and receive answers from other members of the community.

Is there an easier way to locate why Jevois' light turns green?

0 votes

I have been working with Jevois for almost 6 months and it is a quite nice platform for my project. But I have also struggled with debugging my codes for a long time. So I would like to ask my question here to see if there is a solution.

First of all, let me briefly introduce how I use Jevois. I am working on a project which makes the drones fly autonomously. So I use Jevois to detect objects, estimate the drone's states and finally control it. All of these tasks are done on Jevois. So my Jevois project is big which also means that debugging is complex. Since I have to test Jevois with the drone during the flight, some debugging techniques on the host computer are somehow meaningless.  

The most basic method I use to debug is logging all interesting variables and analysis them offline. This is fine for me. But sometimes when I changed some codes and turned on Jevois, the LED light changed from green to short orange and to green forever. Every time when I met this, I had no clue what was going on inside Jevois. So my question is that is that is there any way that at least I can do some printf to see at which line Jevois dies?

Jevois-inventor is a quite nice tool for debugging. But in my case, the default mode is stream-on. So in normal case, I need to type "jevois-cmd streamoff" and "jevois-inventor" to see the printf results. But before that can happen, the light has already turned to green. So I totally have no clue what's wrong with my codes. My way is to use "git diff" to compare the difference to the stable version and guess where can be wrong and comment out some blocks to test. This takes me quite a long time because every time I have to build and upload the codes.

PS: I have a small suggestion. I don't know if adding a wifi module on Jevois is on your agenda. Because in my field, robotics, it will be much much much more convenient to communicate with Jevois via wifi to see some printf messages, to tune parameters online and to see what the last error message is before Jevois dies and the drone crashes :)

Thanks in advance!
asked Jan 8 in Programmer Questions by ls90911 (210 points)

1 Answer

0 votes
Yes, I would recommend this:

- edit uEnv.txt in the BOOT partition of the microSD. Uncomment the second set of parameters (which the comments above say are for "mild debug mode"). This is to enable verbose booting to serial console. The orange LED is directly tied to powering the image sensor in jevois. When the LED first flashes orange, the kernel module for the camera sensor is loaded and the sensor is detected. Then jevois-daemon is started on the camera. Then the sensor is opened by jevois-daemon, which turns the LED solid orange. If jevois-daemon crashes, the LED will go back to green as the video sensor device is released. With the verbose boot messages you will be able to see that crash on the serial port.

- the verbose boot messages go to the hardware serial port. So you need a serial-to-USB cable, like this one: https://www.jevoisinc.com/collections/accessories/products/usb-to-micro-serial-adapter-cable-3-feet-1m-long

- or this is where you can also go wireless. I have not done this in a long time but when playing with drones we used a serial to bluetooth dongle and connected it to the serial port of jevois. Then we used an app on an iPad to connect to that dongle. The main limitation was that the bluetooth connection was slow at 9600 bauds which limited the rate of messages we could see. I have ordered some serial-to-wifi dongles (ESP-12F) but I have not found the time to try them out yet... Just remember that the red wire on the jevois serial port is an input, so you need to power your wireless module separately and then provide the logic level at which your module operates to the red wire (more info at http://jevois.org/doc/UserSerial.html )

- note that LINFO() messages will also go to the hardware serial, so you can use that to print debugging messages.

There is more info about uEnv.txt and other debugging tips, with a screenshot and video, here: http://jevois.org/doc/Debugging.html
answered Jan 8 by JeVois (34,860 points)