kopia lustrzana https://github.com/cyoung/stratux
GxAirCom: some tweaks
rodzic
223ce80f43
commit
b288176d61
3065
GxAirCom/esptool.py
3065
GxAirCom/esptool.py
Plik diff jest za duży
Load Diff
|
@ -13,25 +13,29 @@ trap cleanup EXIT
|
||||||
|
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
echo ""
|
if [ -e /dev/serialin ]; then
|
||||||
echo "To which USB would you like to install the firmware at?"
|
usbDevice=/dev/serialin
|
||||||
echo ""
|
else
|
||||||
echo -e "${RED}If you are unsure about which USB device is which (sorry we cannot detect..) then unplug${NC}"
|
echo ""
|
||||||
echo -e "${RED}the device you do not want to flash and re-run this script.${NC}"
|
echo "To which USB would you like to install the firmware at?"
|
||||||
echo ""
|
echo ""
|
||||||
list=$(find /dev/ -type c -regextype egrep -regex '\/dev\/(ttyACM|ttyAMA|ttyUSB)[0-9]')
|
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 ""
|
||||||
|
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"
|
||||||
exit
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
select usbDevice in $list
|
||||||
|
do test -n "$usbDevice" && break;
|
||||||
|
echo "No USB device selected"
|
||||||
|
exit
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
select usbDevice in $list
|
|
||||||
do test -n "$usbDevice" && break;
|
|
||||||
echo "No USB device selected"
|
|
||||||
exit
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "Installing $fwName to $usbDevice"
|
echo "Installing $fwName to $usbDevice"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
|
8
Makefile
8
Makefile
|
@ -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
|
||||||
|
|
|
@ -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/"
|
||||||
|
@ -1597,7 +1597,13 @@ func main() {
|
||||||
if common.IsRunningAsRoot() {
|
if common.IsRunningAsRoot() {
|
||||||
STRATUX_HOME = STRATUX_HOME_PROD
|
STRATUX_HOME = STRATUX_HOME_PROD
|
||||||
} else {
|
} else {
|
||||||
STRATUX_HOME = STRATUX_HOME_DEV
|
ex, err := os.Executable()
|
||||||
|
if err == nil {
|
||||||
|
ex = filepath.Dir(ex)
|
||||||
|
STRATUX_HOME = ex
|
||||||
|
} else {
|
||||||
|
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
|
||||||
|
|
Ładowanie…
Reference in New Issue