diff --git a/.travis.yml b/.travis.yml index d7ce010..b9fe29b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,8 +47,7 @@ script: - arduino --board esp32:esp32:t-beam --verify $PWD/RX_FSK/RX_FSK.ino - find build - find /home/travis/.arduino15/packages/esp32/hardware/esp32/ - - $MKSPIFFS -c $PWD/RX_FSK/data -b 4096 -p 256 -s 1503232 $PWD/spiffs.bin - - $PWD/scripts/makeimage.py $ESP32TOOLS $PWD/build/RX_FSK.ino.bin $PWD/spiffs.bin $PWD/out.bin + - $PWD/scripts/makeimage.py $ESP32TOOLS $PWD/build/RX_FSK.ino.bin $PWD/RX_FSK/data $PWD/out.bin after_success: - .travis/push.sh notifications: diff --git a/.travis/push.sh b/.travis/push.sh index 754ab2c..8beba8f 100755 --- a/.travis/push.sh +++ b/.travis/push.sh @@ -24,13 +24,24 @@ generate_website_index() { if [ -z "$TS" ]; then TS=`date`; fi echo "
  • $i ($TS)
  • \n" >> download.html; done - echo "" >> download.html + echo " +
    +

    Last latter/number of version number indicate SPIFFS file system version. If the first (upper-case) + letter has changed, then this version is incompabible with prevision versions and you have to flash + the full image. If the second part (number) has changed, then this version has some changes + (e.g. internal web page layout, LCD/TFT display layout) in the file system which you will not get with + a code-only (OTA or flashing update.bin) update, but it should not break anything.

    + " >> download.html git add download.html git commit --amend --message "Travis build: $TRAVIS_BUILD_NUMBER" } commit_website_files() { BRANCH=$TRAVIS_BRANCH - VERSION=`cat RX_FSK/version.h | tail -1 | egrep -o '".*"' | sed 's/"//g' | sed 's/ /_/g'` + VERSION=`cat RX_FSK/version.h | grep version_id | egrep -o '".*"' | sed 's/"//g' | sed 's/ /_/g'` + FSMAJOR=`cat RX_FSK/version.h | grep SPIFFS_MAJOR | perl -e '$_=<>;print /=(.*);/?chr($1+64):""'` + FSMINOR=`cat RX_FSK/version.h | grep SPIFFS_MINOR | perl -e '$_=<>;print /=(.*);/?$1:""'` + VERSION=$VERSION-$FSMAJOR$FSMINOR + MYPATH=$PWD echo "On branch $BRANCH" echo "Version $VERSION" diff --git a/Licenses/Exceptions b/Licenses/Exceptions index 6f8843e..f35cddb 100644 --- a/Licenses/Exceptions +++ b/Licenses/Exceptions @@ -4,3 +4,8 @@ GPL License Exceptions: https://github.com/pdelmo/lora_shield_arduino.git and licensed under GNU Lesser General Public License, version 2.1 (SPDX short identifier: LGPL-2.1) + +- Leaflet sidebar v2 plugin is (c) 2013 Tobias Bieniek based on + https://github.com/Turbo87/sidebar-v2/ + and licensed under + MIT License diff --git a/RX_FSK/RX_FSK.ino b/RX_FSK/RX_FSK.ino index 7570b4a..492ec50 100644 --- a/RX_FSK/RX_FSK.ino +++ b/RX_FSK/RX_FSK.ino @@ -3,6 +3,7 @@ #include #include #include + #include //#include //#include @@ -21,16 +22,18 @@ #include "geteph.h" #include "rs92gps.h" -int LORA_LED = 9; // default POUT for LORA LED used as serial monitor int e; -enum MainState { ST_DECODER, ST_SPECTRUM, ST_WIFISCAN, ST_UPDATE }; +enum MainState { ST_DECODER, ST_SPECTRUM, ST_WIFISCAN, ST_UPDATE, ST_TOUCHCALIB }; static MainState mainState = ST_WIFISCAN; // ST_WIFISCAN; AsyncWebServer server(80); +AsyncWebSocket ws("/ws"); + AXP20X_Class axp; #define PMU_IRQ 35 - +SemaphoreHandle_t axpSemaphore; +bool pmu_irq = false; String updateHost = "rdzsonde.mooo.com"; int updatePort = 80; @@ -48,6 +51,8 @@ WiFiClient client; WiFiServer tncserver(14580); WiFiClient tncclient; +boolean forceReloadScreenConfig = false; + enum KeyPress { KP_NONE = 0, KP_SHORT, KP_DOUBLE, KP_MID, KP_LONG }; // "doublepress" is now also used to eliminate key glitch on TTGO T-Beam startup (SENSOR_VN/GPIO39) @@ -66,39 +71,56 @@ Button button2 = {0, 0, KP_NONE, 0, -1, false}; static int lastDisplay = 1; static int currentDisplay = 1; -// Set LED GPIO -int ledPin = 1; -// Stores LED state -String ledState; - // timestamp when spectrum display was activated static unsigned long specTimer; +// Read line from file, independent of line termination (LF or CR LF) +String readLine(Stream &stream) { + String s = stream.readStringUntil('\n'); + int len = s.length(); + if (len == 0) return s; + if (s.charAt(len - 1) == '\r') s.remove(len - 1); + return s; +} + +// Read line from file, without using dynamic memory allocation (String class) +// returns length line. +int readLine(Stream &stream, char *buffer, int maxlen) { + int n = stream.readBytesUntil('\n', buffer, maxlen); + buffer[n] = 0; + if(n <= 0) return 0; + if(buffer[n-1]=='\r') { buffer[n-1]=0; n--; } + return n; +} + // Replaces placeholder with LED state value String processor(const String& var) { Serial.println(var); - if (var == "STATE") { - if (digitalRead(ledPin)) { - ledState = "ON"; - } - else { - ledState = "OFF"; - } - Serial.print(ledState); - return ledState; - } if (var == "VERSION_NAME") { return String(version_name); } if (var == "VERSION_ID") { return String(version_id); } + if (var == "AUTODETECT_INFO") { + char tmpstr[128]; + const char *fpstr; + int i = 0; + while (fingerprintValue[i] != sonde.fingerprint && fingerprintValue[i] != -1) i++; + if (fingerprintValue[i] == -1) { + fpstr = "Unknown board"; + } else { + fpstr = fingerprintText[i]; + } + snprintf(tmpstr, 128, "Fingerprint %d (%s)", sonde.fingerprint, fpstr); + return String(tmpstr); + } return String(); } const String sondeTypeSelect(int activeType) { String sts = ""; - for (int i = 0; i < 4; i++) { + for (int i = 0; i < NSondeTypes; i++) { sts += "