Merge remote-tracking branch 'refs/remotes/origin/main'
This commit is contained in:
@@ -12,6 +12,8 @@ echo "-------------------"
|
|||||||
|
|
||||||
echo "NebuleAir pro started at $(date)"
|
echo "NebuleAir pro started at $(date)"
|
||||||
|
|
||||||
|
chmod -R 777 /var/www/nebuleair_pro_4g/
|
||||||
|
|
||||||
# Blink GPIO 23 and 24 five times
|
# Blink GPIO 23 and 24 five times
|
||||||
for i in {1..5}; do
|
for i in {1..5}; do
|
||||||
# Turn GPIO 23 and 24 ON
|
# Turn GPIO 23 and 24 ON
|
||||||
|
|||||||
@@ -612,19 +612,13 @@ try:
|
|||||||
|
|
||||||
# Send notification
|
# Send notification
|
||||||
try:
|
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'
|
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)
|
response = requests.post(alert_url, timeout=3)
|
||||||
|
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
print(f"Alert notification sent successfully")
|
print(f"Alert notification sent successfully")
|
||||||
else:
|
else:
|
||||||
print(f"Alert notification failed with status code: {response.status_code}")
|
print(f"Alert notification failed with status code: {response.status_code}")
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
# Catch any exception and continue
|
|
||||||
print(f"Alert notification failed: {e}")
|
print(f"Alert notification failed: {e}")
|
||||||
|
|
||||||
#end loop
|
#end loop
|
||||||
|
|||||||
Reference in New Issue
Block a user