Created
December 8, 2024 20:41
-
-
Save ricardodeazambuja/010873f7042e5379ed70d3c8e0c12439 to your computer and use it in GitHub Desktop.
CNCjs running on RPI4 as a service and with webcam enabled
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"commands": [ | |
{ | |
"enabled": true, | |
"title": "Reboot", | |
"commands": "sudo reboot now" | |
}, | |
{ | |
"enabled": true, | |
"title": "Shutdown", | |
"commands": "sudo shutdown now" | |
} | |
], | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=CNCjs with webcam | |
After=network.target | |
StartLimitIntervalSec=0 | |
[Service] | |
Type=simple | |
Restart=always | |
RestartSec=1 | |
User=pi | |
ExecStart=/home/pi/launch_cncjs.sh | |
[Install] | |
WantedBy=multi-user.target | |
# $ sudo vi /etc/systemd/system/cncjs.service | |
# $ sudo systemctl daemon-reload | |
# $ $ sudo systemctl enable cncjs.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
cncjs & | |
CNCJS_PID=$! | |
ffmpeg -input_format mjpeg -video_size 640x480 -i /dev/video0 -c copy -f mjpeg - | streameye | |
kill $CNCJS_PID | |
# $ vi /home/pi/launch_cncjs.sh | |
# $ chmod +x /home/pi/launch_cncjs.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Installing CNCjs
Installing software to enable the use of webcam
Create script (/home/pi)
Create service definition file and enable service
Versions that I'm currently using