update
This commit is contained in:
@@ -18,6 +18,38 @@ Attention: The Raspberry Pi doesn't have analog inputs, so we need an analog-to
|
||||
|
||||
sudo /usr/bin/python3 /var/www/nebuleair_pro_4g/windMeter/read.py
|
||||
|
||||
this need to run as a service
|
||||
|
||||
--> sudo nano /etc/systemd/system/windMeter.service
|
||||
|
||||
⬇️
|
||||
[Unit]
|
||||
Description=Master manager for the Python wind meter scripts
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/python3 /var/www/nebuleair_pro_4g/windMeter/read.py
|
||||
Restart=always
|
||||
User=root
|
||||
WorkingDirectory=/var/www/nebuleair_pro_4g
|
||||
StandardOutput=append:/var/www/nebuleair_pro_4g/logs/wind.log
|
||||
StandardError=append:/var/www/nebuleair_pro_4g/logs/wind_errors.log
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
⬆️
|
||||
|
||||
Reload systemd (first time after creating the service):
|
||||
sudo systemctl daemon-reload
|
||||
|
||||
Enable (once), start (once and after stopping) and restart (after modification)systemd:
|
||||
sudo systemctl enable windMeter.service
|
||||
sudo systemctl start windMeter.service
|
||||
sudo systemctl restart windMeter.service
|
||||
|
||||
Check the service status:
|
||||
sudo systemctl status windMeter.service
|
||||
|
||||
'''
|
||||
#!/usr/bin/python3
|
||||
import time
|
||||
|
||||
Reference in New Issue
Block a user