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.

Help debugging an initscript

0 votes

I'm trying to run the RoadNavigation module with an Arduino (no USB connection) and I'm getting errors. 

The initscript.cfg on the SD card is simply this:

setmapping 1

start

But it keeps giving me an error and not running the module. (If I connect the USB to a PC and run a video monitor, the module starts properly). The output I'm getting is this: 

INFO: JeVois 1.0command
INFO: Linux version 3.4.39
INFO: CPU: 1344MHz, 27C, load: 0.00 0.00 0.00 1/53 80
INFO: MemTotal: 238452 kB, MemFree: 194400 kB
PANGAIN 400tal:
TILTGAIN 300al:
ERR /jevois/config/initscript.cfg:2: Unsupported command
INF READY JEVOIS 1.0nitscript.cfg:2:

asked May 5, 2017 in Programmer Questions by zlite (300 points)

1 Answer

+1 vote
 
Best answer
"start" isn't a valid command, where are you getting that from? Setmapping automatically launches the selected module.

Edit: the correct command to start sending frames to a non-usb module is "streamon".
answered May 6, 2017 by pelrun (2,330 points)
edited May 6, 2017 by pelrun
Thanks. I thought "start" was in the commented-out sample script in initscript.cfg, but perhaps I was misreading it.

Also, I discovered that if you end a command line with a return in the script it will generated an "Unsupported command" error. I don't think that's documented anywhere

Moving on, now I don't get errors, but it still will only stream data if I connect via USB and start the video app. I thought that by selecting a non-USB mode (mode 1) it would not require connection to the desktop to start?

My initscript.cfg is currently just this:
    setmapping 23
    setpar serlog None
    setpar serout Hard

However, the selected RoadNavigation module isn't starting. If I connect to a PC with the default mappings, I can start that module with the video app. But for some reason it's not starting on its own when not connected via USB.

I tried setting to a non USB mode as suggested in the documentation below, but after checking with showmapping it appears that mode 1 has now been defaulted to something else, and is no long RoadNavigation, so that didn't work

AVAILABLE VIDEO MAPPINGS:

    0 - OUTPUT: NONE 0x0 @ 0fps CAMERA: YUYV 320x240 @ 60fps) MODULE: SaveVideo
    1 - OUTPUT: NONE 0x0 @ 0fps CAMERA: YUYV 320x240 @ 30fps) MODULE: RoadNavigation
    2 - OUTPUT: NONE 0x0 @ 0fps CAMERA: YUYV 320x240 @ 30fps) MODULE: SaveVideo
    3 - OUTPUT: NONE 0x0 @ 0fps CAMERA: YUYV 176x144 @ 120fps) MODULE: SaveVideo
Ok, I understand this now. You need to use "streamon", which starts the camera on non-USB modes. And then "streamoff" before you can switch to another mapping.

The "start" command you initially tried is a custom command provided by the SaveVideo module, and is for beginning a recording.
Okay, I think I finally figured it out and it's working. If this is documented anywhere, I couldn't find it, so I'm very grateful for your help -- no way I could have done it without you.

initscript.cfg:

   setmapping 1
   setpar serlog None
   setpar serout Hard
   streamon

videomappings.cfg (make sure nothing else is taking those "NONE 0 0 0 YUYV 320 240..." mappings!)

   ### Road following using vanishing point
   NONE 0 0 0 YUYV 320 240 60.0 JeVois RoadNavigation
   NONE 0 0 0 YUYV 320 240 30.0 JeVois RoadNavigation
   #NONE 0 0 0 YUYV 176 144 120.0 JeVois RoadNavigation
   YUYV 320 256 30.0 YUYV 320 240 30.0 JeVois RoadNavigation
   YUYV 176 160 120.0 YUYV 176 144 120.0 JeVois RoadNavigation


Maybe worth documenting this somewhere?

Also, I've found a few typos in the documentation as I've gone through. What's the best way to report them? (things like "setmapping2" being misspelled "setmaping2" in a command line example.)
It's actually documented just above that "setmaping2" typo :) There's definitely some need for more tutorials about common use cases like this, though.

All the documentation is generated from the files in the doc directory in the https://github.com/jevois/jevois repo; you can always commit some changes and submit a pull request to get them included (that requires understanding git and the github workflow, though.)
Great, I'll submit typo reports as PRs there.

One more suggestion for documentation is that the initscript.cfg file does not like blank lines with returns. So if you have a final command like this:

   "streamon
   "
as opposed to this:

   "streamon"

...you'll get a mysterious error. It took me ages to figure that out. Might be worth making the command parser a bit more forgiving of returns with no command, and just ignore that.
...