removed service section from readme
This commit is contained in:
93
README.md
93
README.md
@@ -306,99 +306,6 @@ timestamp,temperature_raw_c,temperature_c,pressure_hpa,humidity_percent,light_lu
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 🔄 Running as a Service
|
|
||||||
|
|
||||||
For 24/7 operation, configure systemd services:
|
|
||||||
|
|
||||||
### Weather Tracker Service
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo nano /etc/systemd/system/weather-tracker.service
|
|
||||||
```
|
|
||||||
|
|
||||||
```ini
|
|
||||||
[Unit]
|
|
||||||
Description=Lab Weather Tracker with Temperature Compensation
|
|
||||||
After=network.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
User=pi
|
|
||||||
WorkingDirectory=/home/pi/raspi-enviro
|
|
||||||
ExecStart=/usr/bin/python3 /home/pi/raspi-enviro/weather_tracker.py
|
|
||||||
Restart=on-failure
|
|
||||||
RestartSec=10
|
|
||||||
StandardOutput=journal
|
|
||||||
StandardError=journal
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
```
|
|
||||||
|
|
||||||
### Web Dashboard Service
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo nano /etc/systemd/system/weather-dashboard.service
|
|
||||||
```
|
|
||||||
|
|
||||||
```ini
|
|
||||||
[Unit]
|
|
||||||
Description=Lab Weather Dashboard
|
|
||||||
After=network.target weather-tracker.service
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
User=pi
|
|
||||||
WorkingDirectory=/home/pi/raspi-enviro
|
|
||||||
ExecStart=/usr/bin/python3 /home/pi/raspi-enviro/web_dashboard.py
|
|
||||||
Restart=on-failure
|
|
||||||
RestartSec=10
|
|
||||||
Environment="FLASK_ENV=production"
|
|
||||||
StandardOutput=journal
|
|
||||||
StandardError=journal
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
```
|
|
||||||
|
|
||||||
### Enable and Start Services
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Enable auto-start on boot
|
|
||||||
sudo systemctl enable weather-tracker.service
|
|
||||||
sudo systemctl enable weather-dashboard.service
|
|
||||||
|
|
||||||
# Start services now
|
|
||||||
sudo systemctl start weather-tracker.service
|
|
||||||
sudo systemctl start weather-dashboard.service
|
|
||||||
|
|
||||||
# Check status
|
|
||||||
sudo systemctl status weather-tracker.service
|
|
||||||
sudo systemctl status weather-dashboard.service
|
|
||||||
|
|
||||||
# View logs
|
|
||||||
journalctl -u weather-tracker.service -f
|
|
||||||
journalctl -u weather-dashboard.service -f
|
|
||||||
```
|
|
||||||
|
|
||||||
### Service Management Commands
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Stop services
|
|
||||||
sudo systemctl stop weather-tracker.service
|
|
||||||
sudo systemctl stop weather-dashboard.service
|
|
||||||
|
|
||||||
# Restart services
|
|
||||||
sudo systemctl restart weather-tracker.service
|
|
||||||
sudo systemctl restart weather-dashboard.service
|
|
||||||
|
|
||||||
# Disable auto-start
|
|
||||||
sudo systemctl disable weather-tracker.service
|
|
||||||
sudo systemctl disable weather-dashboard.service
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## ⚙️ Configuration
|
## ⚙️ Configuration
|
||||||
|
|
||||||
### weather_tracker.py
|
### weather_tracker.py
|
||||||
|
|||||||
Reference in New Issue
Block a user