diff --git a/installation_part2.sh b/installation_part2.sh index fca7504..82b15f8 100644 --- a/installation_part2.sh +++ b/installation_part2.sh @@ -31,12 +31,20 @@ info "Set up the RTC" info "Wake Up SARA" pinctrl set 16 op pinctrl set 16 dh -sleep 5 + +info "Waiting for SARA to wake up..." +for i in {1..8}; do + echo -ne " $i/8 seconds\r" + sleep 1 +done +echo -e "\n" #Check SARA connection (ATI) info "Check SARA connection (ATI)" /usr/bin/python3 /var/www/nebuleair_pro_4g/SARA/sara.py ttyAMA2 ATI 2 +sleep 1 + #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 @@ -45,6 +53,12 @@ info "Check SARA connection (ATI)" info "Activate blue LED" /usr/bin/python3 /var/www/nebuleair_pro_4g/SARA/sara.py ttyAMA2 AT+UGPIOC=16,2 2 +sleep 1 + +#get SIM card number +info "Get SIM card number" +/usr/bin/python3 /var/www/nebuleair_pro_4g/SARA/sara.py ttyAMA2 AT+CCID? 2 + #Connect to network #info "Connect SARA R4 to network" #python3 /var/www/nebuleair_pro_4g/SARA/sara_connectNetwork.py ttyAMA2 20810 60 @@ -100,3 +114,22 @@ sudo systemctl enable rtc_save_to_db.service # Start the service immediately info "Starting the service..." sudo systemctl start rtc_save_to_db.service + +# Display device information +echo "" +echo "==========================================" +echo -e "${GREEN} Installation Complete!${NC}" +echo "==========================================" + +# Get Raspberry Pi serial number (last 8 characters) +serial_number=$(cat /proc/cpuinfo | grep Serial | awk '{print substr($3, length($3) - 7)}') +echo -e "${BLUE}Device ID (Serial):${NC} $serial_number" + +# Get IP addresses +ip_wlan0=$(ip -4 addr show wlan0 2>/dev/null | grep -oP '(?<=inet\s)\d+(\.\d+){3}' || echo "Not connected") +ip_eth0=$(ip -4 addr show eth0 2>/dev/null | grep -oP '(?<=inet\s)\d+(\.\d+){3}' || echo "Not connected") + +echo -e "${BLUE}IP Address (wlan0):${NC} $ip_wlan0" +echo -e "${BLUE}IP Address (eth0):${NC} $ip_eth0" + +echo "=========================================="