GxAirCom: some tweaks

pull/827/merge^2
Adrian Batzill 2023-07-08 13:28:04 +01:00 zatwierdzone przez Adrian Batzill
rodzic 223ce80f43
commit b288176d61
4 zmienionych plików z 34 dodań i 3085 usunięć

Plik diff jest za duży Load Diff

Wyświetl plik

@ -13,13 +13,16 @@ trap cleanup EXIT
cd "$(dirname "$0")" cd "$(dirname "$0")"
if [ -e /dev/serialin ]; then
usbDevice=/dev/serialin
else
echo "" echo ""
echo "To which USB would you like to install the firmware at?" echo "To which USB would you like to install the firmware at?"
echo "" echo ""
echo -e "${RED}If you are unsure about which USB device is which (sorry we cannot detect..) then unplug${NC}" echo -e "${RED}If you are unsure about which USB device is which (sorry we cannot detect..) then unplug${NC}"
echo -e "${RED}the device you do not want to flash and re-run this script.${NC}" echo -e "${RED}the device you do not want to flash and re-run this script.${NC}"
echo "" echo ""
list=$(find /dev/ -type c -regextype egrep -regex '\/dev\/(ttyACM|ttyAMA|ttyUSB)[0-9]') list=$(find /dev/ -regextype egrep -regex '\/dev\/(ttyACM|ttyAMA|ttyUSB)[0-9]')
if [ -z "$list" ]; then if [ -z "$list" ]; then
echo "No connected USB, ACM or AMA device found" echo "No connected USB, ACM or AMA device found"
@ -31,6 +34,7 @@ select usbDevice in $list
echo "No USB device selected" echo "No USB device selected"
exit exit
done done
fi
echo "Installing $fwName to $usbDevice" echo "Installing $fwName to $usbDevice"
echo "" echo ""

Wyświetl plik

@ -82,10 +82,14 @@ optinstall: www ogn/ddb.json
cp -f ogn/ddb.json ogn/esp32-ogn-tracker-bin-*.zip ogn/install-ogntracker-firmware-pi.sh ogn/fetch_ddb.sh $(STRATUX_HOME)/ogn cp -f ogn/ddb.json ogn/esp32-ogn-tracker-bin-*.zip ogn/install-ogntracker-firmware-pi.sh ogn/fetch_ddb.sh $(STRATUX_HOME)/ogn
# GxAirCom stuff # GxAirCom stuff
# Wget -N doesn't work with -O.. need to change directory temporarily
# Could also use latest CI build: https://github.com/rvt/GxAirCom/releases/latest/download/$$artifact
cd $(STRATUX_HOME)/GxAirCom/; \
wget -N https://raw.githubusercontent.com/pjalocha/esp32-ogn-tracker/master/esptool.py; \
for artifact in "firmware_psRam.bin" "spiffs.bin" "partitions.bin" "version.txt" "README.md" "bootloader_dio_40m.bin" "boot_app0.bin" ; do \ for artifact in "firmware_psRam.bin" "spiffs.bin" "partitions.bin" "version.txt" "README.md" "bootloader_dio_40m.bin" "boot_app0.bin" ; do \
curl -L https://github.com/rvt/GxAirCom/releases/latest/download/$$artifact --output $(STRATUX_HOME)/GxAirCom/$$artifact ; \ wget -N https://github.com/rvt/GXAirCom/releases/download/gxaircom-stratux-rc2/$$artifact; \
done done
cp -f GxAirCom/esptool.py GxAirCom/install-GxAirCom-Stratux-firmware.sh $(STRATUX_HOME)/GxAirCom cp -f GxAirCom/install-GxAirCom-Stratux-firmware.sh $(STRATUX_HOME)/GxAirCom
# Scripts # Scripts
cp __opt__stratux__bin__stratux-pre-start.sh $(STRATUX_HOME)/bin/stratux-pre-start.sh cp __opt__stratux__bin__stratux-pre-start.sh $(STRATUX_HOME)/bin/stratux-pre-start.sh

Wyświetl plik

@ -47,7 +47,7 @@ var dataLogFilef string // Set according to OS config.
const ( const (
STRATUX_HOME_PROD = "/opt/stratux/" STRATUX_HOME_PROD = "/opt/stratux/"
STRATUX_HOME_DEV = "/home/pi/stratux/" STRATUX_HOME_DEV = "/home/pi/stratux/" // Only fallback, usually we try to determine the binary's dir
configLocation = "/boot/stratux.conf" configLocation = "/boot/stratux.conf"
managementAddr = ":80" managementAddr = ":80"
logDir = "/var/log/" logDir = "/var/log/"
@ -1596,9 +1596,15 @@ func main() {
if common.IsRunningAsRoot() { if common.IsRunningAsRoot() {
STRATUX_HOME = STRATUX_HOME_PROD STRATUX_HOME = STRATUX_HOME_PROD
} else {
ex, err := os.Executable()
if err == nil {
ex = filepath.Dir(ex)
STRATUX_HOME = ex
} else { } else {
STRATUX_HOME = STRATUX_HOME_DEV STRATUX_HOME = STRATUX_HOME_DEV
} }
}
// Set up mySituation, do it here so logging JSON doesn't panic // Set up mySituation, do it here so logging JSON doesn't panic
mySituation.muGPS = &sync.Mutex{} mySituation.muGPS = &sync.Mutex{}