update
This commit is contained in:
@@ -12,6 +12,8 @@ echo "-------------------"
|
||||
|
||||
echo "NebuleAir pro started at $(date)"
|
||||
|
||||
chmod -R 777 /var/www/nebuleair_pro_4g/
|
||||
|
||||
# Blink GPIO 23 and 24 five times
|
||||
for i in {1..5}; do
|
||||
# Turn GPIO 23 and 24 ON
|
||||
|
||||
@@ -613,19 +613,13 @@ try:
|
||||
|
||||
# Send notification
|
||||
try:
|
||||
# Format the URL with the device_id
|
||||
alert_url = f'http://data.nebuleair.fr/pro_4G/alert.php?capteur_id={device_id}&error_type=serial_error'
|
||||
|
||||
# Send POST request with short timeout
|
||||
response = requests.post(alert_url, timeout=3)
|
||||
|
||||
if response.status_code == 200:
|
||||
print(f"Alert notification sent successfully")
|
||||
else:
|
||||
print(f"Alert notification failed with status code: {response.status_code}")
|
||||
|
||||
except Exception as e:
|
||||
# Catch any exception and continue
|
||||
print(f"Alert notification failed: {e}")
|
||||
|
||||
#end loop
|
||||
|
||||
Reference in New Issue
Block a user