I'm using sdk9.1 and I'm debugging a DMS project. You need to save the image to a certain path of EMMC, and then use the algorithm SDK to identify the state of distraction or fatigue.
But I ran into some trouble, and I didn't know how to set the two actions of camera image storage and algorithm processing to start automatically when booted.
I tried putting them together with a shell script but it didn't work. Because they are all in the loop, executing one of them, and the other can only wait and wait, unable to proceed.
Here's how I did it:
1. Script content:
2. Copy dms_start.sh to the /etc/init.d directory
3. In /lib/systemd/system, create a new file service
sudo vi /lib/systemd/system/application.service
It reads as follows:
[Unit]
Description=My Shell Script
[Service]
ExecStart=/etc/init.d/dms_start.sh
[Install]
WantedBy=multi-user.target
4. Enable application.service
sudo systemctl daemon-reload
sudo systemctl enable application.service
sudo systemctl start application.service
sudo systemctl status application.service
How do you get the two parts of the script to run in sync, or do you have one of them running in the background?