From 20a07863808abb966cffc888a00f4fc3f5996dc2 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 25 Feb 2025 15:15:29 +0100 Subject: [PATCH] update --- SARA/reboot/start.py | 4 ++-- SARA/sara_connectNetwork.py | 9 ++++++++- installation.sh | 12 ++++++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/SARA/reboot/start.py b/SARA/reboot/start.py index 57584d3..8d7b7a1 100644 --- a/SARA/reboot/start.py +++ b/SARA/reboot/start.py @@ -119,7 +119,7 @@ try: print('

Start reboot python script

') # 1. Set AIRCARTO URL - print('Set aircarto URL') + print('➡️Set aircarto URL') aircarto_profile_id = 0 aircarto_url="data.nebuleair.fr" command = f'AT+UHTTP={aircarto_profile_id},1,"{aircarto_url}"\r' @@ -129,7 +129,7 @@ try: time.sleep(1) #2. Set uSpot URL - print('Set uSpot URL') + print('➡️Set uSpot URL') uSpot_profile_id = 1 uSpot_url="api-prod.uspot.probesys.net" command = f'AT+UHTTP={uSpot_profile_id},1,"{uSpot_url}"\r' diff --git a/SARA/sara_connectNetwork.py b/SARA/sara_connectNetwork.py index 430f885..96b9a8f 100755 --- a/SARA/sara_connectNetwork.py +++ b/SARA/sara_connectNetwork.py @@ -1,11 +1,18 @@ ''' + ____ _ ____ _ + / ___| / \ | _ \ / \ + \___ \ / _ \ | |_) | / _ \ + ___) / ___ \| _ < / ___ \ + |____/_/ \_\_| \_\/_/ \_\ + Script to connect SARA-R410 to network SARA-R410 python3 /var/www/nebuleair_pro_4g/SARA/sara_connectNetwork.py ttyAMA2 20801 10 AT+COPS=1,2,20801 mode->1 pour manual format->2 pour numeric -operator->20801 pour orange +operator->20801 pour orange, 20810 pour SFR + ''' import serial diff --git a/installation.sh b/installation.sh index 14ee986..9231b6d 100755 --- a/installation.sh +++ b/installation.sh @@ -129,6 +129,18 @@ info "Enabling I2C ports..." sudo raspi-config nonint do_i2c 0 success "I2C ports enabled." +#creates databases +info "Creates sqlites databases..." +/usr/bin/python3 /var/www/nebuleair_pro_4g/sqlite/create_db.py + +#set up SARA R4 APN +info "Set up Monogoto APN" +/usr/bin/python3 /var/www/nebuleair_pro_4g/SARA/sara_setAPN.py ttyAMA2 data.mono 2 + +#Connect to network +info "Connect SARA R4 to network" +python3 /var/www/nebuleair_pro_4g/SARA/sara_connectNetwork.py ttyAMA2 20810 60 + #Add master_nebuleair.service SERVICE_FILE="/etc/systemd/system/master_nebuleair.service" info "Setting up systemd service for master_nebuleair..."