Welcome new user! You can search existing questions and answers without registering, but please register to post new questions and receive answers.

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


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:
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,310 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


    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.


   setmapping 1
   setpar serlog None
   setpar serout Hard

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:

as opposed to this:


...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.