I am using a Raspberry Pi 3 Model B Rev 1.2 running Raspbian 10 (Buster). My project is additionally using a USB Webcam
I have a python project that displays an OpenCV GUI which I wanted to run on boot. I couldn't find a great way to initialize the OpenVINO environment properly on boot after many searches and different methods so I currently have my pi launch an instance of LXTerminal on boot and my .bashrc does the rest.
Every time the pi is booted, it can't seem to detect my NCS. This never seemed to be an issue before. I've tried both the NCS1 and 2 but the results are the same. The only way for them to be detected is to simply plug/unplug them after boot, which is impractical for my project.
What could be the issue? I'm not very experienced with working on the Raspberry Pi so I'm assuming I've made some sort of mistake along the way.
Edit: The behaviour is even stranger than I initially thought. When booting then plugging in the NCS causes it to not be recognized, but after a few attempts at starting the script it suddenly detects (it wasn't a time based fix).
Any help is appreciated, and if there's a better way to do the auto-run python script + initialize OpenVINO please let me know.
- Raspberry Pi
Thank you for reaching out.
Please make sure that you added the USB Rules using:
sudo usermod -a -G users "$(whoami)"
Please note that after this, you will need to log out and log in for it to take effect.
You can check all the steps to install OpenVINO™ toolkit for Raspbian* OS here.
I followed the steps for installing the toolkit the first time, but redid them just now.
Unfortunately this did not resolve my issues. I've tried running the script normally and I still get the NC_ERROR. Additionally, after getting the script to run (often through a series of plugging/unplugging and rerunning the script) and quitting, a subsequent run does not guarantee a connection. I can't seem to find a pattern for when the NCS connects, I'll update this reply if I do
edit: After further inspection I've come to realize that this seems to be a timing issue, the NCS is detected, but as ID 03e7:f63b Intel for a while before changing to ID 03e7:2485 Intel Movidius MyriadX.
I'm now hoping that there's a way to speed up this process, as this ~30 second delay is undesirable for my use case. Thanks
Thank you for your response.
Which version of OpenVINO™ toolkit are you using?
The NCS should be detected as 03e7:2485 (NCS 2) or 03e7:2150 (NCS) when you plug it in. It should be available ready to use. When the device is detected as 03e7:f63b, the device is running inference.
Having this in mind, can you check if your program finished running or is not running a second instance in the background?
Also, you can check this article on how to start one of the sample demos on boot.
I just updated to the newest release of OpenVINO™ for Raspbian.
I previously followed the article you linked, but I don't believe it is suited for my program, as I need to access a webcam and display a GUI. I'll try it again in the meantime.
As for the chance the program is running in the background, I have checked my crontab, autostart, and previous attempts at using system services and don't see any possibility for there to be a background instance. I'll continue looking for now.
Hello, can you try the following, please:
Description=Init OpenVINO env and run python interactive face demo
/home/pi/app/interactive_face_detection_demo -i cam -d MYRIAD -m /home/pi/app/face-detection-adas-0001.xml
Thanks for your help so far, sorry for the staggered response time, our time zones are likely far apart.
I wasn't able to follow your exact instructions, I couldn't find the "interactive_face_detection_demo" in python, so I followed with my own.
I added `on_reboot.sh` to my /home/pi/app folder with contents:
#!/bin/bash source /opt/intel/openvino/bin/setupvars.sh /usr/bin/python3 /home/pi/app/run.py
and changed the permissions with
chmod u+x on_reboot.sh
then created the service file under /etc/systemd/system with the content you posted.
When running :
sudo systemctl enable openvino-benchmark-app.service
and rebooting, the status initially showed:
Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
which I was able to fix by installing the 'at-spi2-core' package.
Currently, when rebooting and checking the status, I see:
systemd: on_reboot.service: Failed with result 'exit-code'. systemd: on_reboot.service: Service RestartSec=100ms expired, scheduling restart systemd: on_reboot.service: Scheduled restart job, restart counter is at 5 systemd: Stopped Initialize OpenVINO environment and run python script systemd: on_reboot.service: Start request repeated too quickly. systemd: on_reboot.service: Failed with result 'exit-code'. systemd: Failed to start Initialize OpenVINO environment and run python script
I'll update this if I make any progress.
Thank you for your response.
Could you please test the service when the Pi boots and GUI interface is up, following the next steps:
- Open Terminal
- sudo systemctl start openvino-benchmark-app.service
- sudo systemctl status openvino-benchmark-app.service
Thanks for all the help, I was able to get the system service working this time, although I'm not sure what exactly I did differently.
These are the steps I took on Buster in case anyone has the same issues:
- Created script that initializes OpenVINO and launches my script using:
#!/bin/bash source /opt/intel/openvino/bin/setupvars.sh /usr/bin/python3 /path/to/script/run.py
2. Changed bash script permissions and ownership:
chmod u+x ~/openvino-app-script
3. Created service file using:
sudo nano /etc/systemd/system/openvino-app.service
[Unit] Description=OpenVINO Python Script After=network.target [Service] Environment="DISPLAY=:0" Environment="XAUTHORITY=/home/pi/.Xauthority" ExecStart=/home/pi/openvino-app-script WorkingDirectory=/home/pi StandardOutput=inherit StandardError=inherit Restart=on-failure User=pi [Install] WantedBy=graphical.target
6. Then lastly activated the service with:
sudo systemctl enable openvino-app.service
Works perfectly with a stream from a USB webcam, no issues with the NCS not being detected.