From e0d7614ad813c66dd4e144b5095c57f07f1ae8fc Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 25 Feb 2025 15:41:17 +0100 Subject: [PATCH] update --- README.md | 12 +++++++++--- installation_part1.sh | 2 +- installation_part2.sh | 5 +++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d9010e9..99b3f46 100755 --- a/README.md +++ b/README.md @@ -9,12 +9,18 @@ Based on the Rpi4 or CM4. You can download the `installation_part1.sh` and run it: ``` wget http://gitea.aircarto.fr/PaulVua/nebuleair_pro_4g/raw/branch/main/installation_part1.sh -chmod +x installation.sh -sudo ./installation.sh +chmod +x installation_part1.sh +sudo ./installation_part1.sh ``` After reboot you can do the same with part 2. +``` +wget http://gitea.aircarto.fr/PaulVua/nebuleair_pro_4g/raw/branch/main/installation_part2.sh +chmod +x installation_part2.sh +sudo ./installation_part2.sh +``` + ## General @@ -23,7 +29,7 @@ Line by line installation. ``` sudo apt update sudo apt install git gh apache2 php php-sqlite3 python3 python3-pip jq autossh i2c-tools python3-smbus -y -sudo pip3 install pyserial requests RPi.GPIO adafruit-circuitpython-bme280 crcmod psutil --break-system-packages +sudo pip3 install pyserial requests RPi.GPIO adafruit-circuitpython-bme280 crcmod psutil ntplib pytz --break-system-packages sudo mkdir -p /var/www/.ssh sudo ssh-keygen -t rsa -b 4096 -f /var/www/.ssh/id_rsa -N "" sudo ssh-copy-id -i /var/www/.ssh/id_rsa.pub -p 50221 airlab_server1@aircarto.fr diff --git a/installation_part1.sh b/installation_part1.sh index 82c85af..8935d60 100644 --- a/installation_part1.sh +++ b/installation_part1.sh @@ -27,7 +27,7 @@ sudo apt update && sudo apt install -y git gh apache2 php php-sqlite3 python3 py # Install Python libraries info "Installing Python libraries..." -sudo pip3 install pyserial requests RPi.GPIO adafruit-circuitpython-bme280 crcmod psutil --break-system-packages || error "Failed to install Python libraries." +sudo pip3 install pyserial requests RPi.GPIO adafruit-circuitpython-bme280 crcmod psutil ntplib pytz --break-system-packages || error "Failed to install Python libraries." # Ask user if they want to set up SSH keys read -p "Do you want to set up an SSH key for /var/www? (y/n): " answer diff --git a/installation_part2.sh b/installation_part2.sh index 660e698..46b926b 100644 --- a/installation_part2.sh +++ b/installation_part2.sh @@ -1,5 +1,7 @@ #!/bin/bash +# Script to set up the App after rebooting + # Exit on error, unset variable usage, and error in a pipeline set -euo pipefail @@ -21,6 +23,9 @@ if [[ "$EUID" -ne 0 ]]; then error "This script must be run as root. Use 'sudo ./installation.sh'" fi +#set up the RTC +info "Set up the RTC" +/usr/bin/python3 /var/www/nebuleair_pro_4g/RTC/set_with_NTP.py #set up SARA R4 APN info "Set up Monogoto APN"