Cannot run a script that executes my opencv program at startup under Linux
Hi there,
I would need some help there.
I'm trying (since this morning) to make a script that can launch my opencv program at startup. The script does work well :
#!/bin/sh
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/lemaker/Documents/Project/opencv/install/lib
/home/lemaker/Documents/Project/opencv_program
As you can see (or not), I work on a LeMaker Guitar using Ubuntu Mate.
EDIT: The thing is, the opencv_program doesnt start at startup, trying to check if it had started using htop or top. In fact, I don't even know if my script is ok, I mean : I don't have any mean to check any debug messages or something.
I explored many solutions :
- Launching my script from /etc/rc.local
- Launching my script as a Linux service
- Launching my script with crontab -e
- Launching my script after X started (in /etc/X11/xinit/xinitrc)
It does just not work. When, in my script, I put some basic commands like creating a file or something, it works. But when I try to launch my program, only its line does not work. I have to export a library path because I compiled opencv as shared libs.
I tried to do it with sudo :
#!/bin/sh
sudo -s <<EOF
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/lemaker/Documents/Project/opencv/install/lib
/home/lemaker/Documents/Project/opencv_program
EOF
This does not work too. I suspect that I have to launch my program with specific requirements but I can't find out which ones. Do I need to run my script after X started, or something ? Do you guys have any experience in launching an opencv program at startup ?
Could you please guide me ?
Thank you in advance, and have a good day !
long post, but you never say, what's going wrong
@berak Edited !
BTW, you can check with
ps -A
if your program is running. For debug messages use a logfile if you don't have a display connected (or direct access to console messages).BTW, off-topic question: what is your experience with the LeMaker Guitar board? I read very bad reviews about the Linux support of the BananaPi board (from the same company) and it's the weak point of most cheap chinese ARM boards.
@kbarni Regarding hardware components, I'm not disappointed because it is hard to find good components like Cortex-A9 and PowerVR SGX544 with this price. But you're right, I feel that I have many problems with Ubuntu MATE on this board, + the support is awful (the hotline doesn't even speak english)
For now, I have bad results with opencv but I think that it is my fault : I suppose that I don't use the full potential of this board for opencv. (I need to learn about NEON and VFP + OpenCL hardware acceleration)
Thanks for the feedback about the Lemaker Guitar! I think that the Raspberry Pi 3 is still unbeatable, as it's quite cheap, powerful, it has excellent software support and a good community.
As these boards have several cores, I prefer to parallelize the processing on the CPUs rather than going OpenCL, which can be a real PITA to debug. I suggest to use the TBB library, if it's available in the repositories.