I wrote a script for object detection and if I establish ssh connection to Raspberry Pi and run it from console, everything works fine. As I would like to start the script automatically on boot, I added the entry to the cron table:
@reboot cd /home/pi/workspace/counting-objects && python3 script.py
In the script, I have added following lines before and after import to check whether the import is the issue as I noticed the script was not running:
logger.info("[INFO] Importing libraries for openvino...") from openvino.inference_engine import IENetwork, IEPlugin logger.info("[INFO] libraries imported successfully")
In the log file, I saw the first line and the second line was missing, which means an error occurred while trying to import openvino library.
Does anyone know if there is a way to "emulate ssh connection environment" or anyhow solve this issue? The problem is that the issue cannot be reproduced if the script is ran from console.