-
Notifications
You must be signed in to change notification settings - Fork 1
/
AutorunRPi.txt
42 lines (30 loc) · 1.03 KB
/
AutorunRPi.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
@chromium-browser --start-fullscreen --app=http://localhost:5000
sudo nano /etc/systemd/system/startWebApp.service
-------------------------------------------------------------------
[Unit]
Description=Start web UI
After=multi-user.target
[Service]
ExecStart=/usr/bin/python3 /home/pi/camera-box/Web_App_Integration/app.py
WorkingDirectory=/home/pi/camera-box/Web_App_Integration/
StandardOutput=inherit
StandardError=inherit
Restart=always
User=pi
Type=idle
[Install]
WantedBy=multi-user.target
--------------------------------------------------------------------
sudo chmod 644 /etc/systemd/system/startWebApp.service
sudo systemctl daemon-reload
systemctl enable startWebApp.service
--------------------------------------------------------------------
Alternative way:
sudo nano /etc/rc.local
--------------------------------------------------------------------
#!/bin/sh -e
python3 app.py &
exit 0
--------------------------------------------------------------------
sudo chmod +x /etc/rc.local