diff --git a/README.md b/README.md index 255fe26c..b66a98aa 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # ESP32-Paxcounter **Wifi & Bluetooth driven, LoRaWAN enabled, battery powered mini Paxcounter built on cheap ESP32 LoRa IoT boards** ---> see development branch of this repository for latest alpha version <-- +Tutorial (in german language): https://www.heise.de/select/make/2019/1/1551099236518668 @@ -396,3 +396,4 @@ Thanks to - [Charles Hallard](https://github.com/hallard) for major code contributions to this project - [robbi5](https://github.com/robbi5) for the payload converter - [terrillmoore](https://github.com/mcci-catena) for maintaining the LMIC for arduino LoRaWAN stack +- [sbamueller](https://github.com/sbamueller) for writing the tutorial in Make Magazine diff --git a/src/TTN/plain_decoder.js b/src/TTN/plain_decoder.js index ec55dc2c..ca43a5e4 100644 --- a/src/TTN/plain_decoder.js +++ b/src/TTN/plain_decoder.js @@ -10,7 +10,7 @@ function Decoder(bytes, port) { if (bytes.length >= 2) { decoded.wifi = (bytes[i++] << 8) | bytes[i++];} - if (bytes.length >= 4) { + if (bytes.length === 4 || bytes.length > 15) { decoded.ble = (bytes[i++] << 8) | bytes[i++];} if (bytes.length > 4) { @@ -60,7 +60,13 @@ function Decoder(bytes, port) { decoded.humidity = ((bytes[i++] << 8) | bytes[i++]); decoded.air = ((bytes[i++] << 8) | bytes[i++]); } + + if (port === 8) { + var i = 0; + if (bytes.length >= 2) { + decoded.battery = (bytes[i++] << 8) | bytes[i++];} + } return decoded; -} \ No newline at end of file +} diff --git a/src/hal/ttgobeam.h b/src/hal/ttgobeam.h index d4d1730e..a572260d 100644 --- a/src/hal/ttgobeam.h +++ b/src/hal/ttgobeam.h @@ -23,7 +23,7 @@ // GPS settings #define HAS_GPS 1 // use on board GPS #define GPS_SERIAL 9600, SERIAL_8N1, GPIO_NUM_12, GPIO_NUM_15 // UBlox NEO 6M -#define GPS_INT GPIO_NUM_34 // 30ns accurary timepulse, to be external wired on pcb: NEO 6M Pin#3 -> GPIO34 +//#define GPS_INT GPIO_NUM_34 // 30ns accurary timepulse, to be external wired on pcb: NEO 6M Pin#3 -> GPIO34 // Settings for on board DS3231 RTC chip //#define HAS_RTC MY_OLED_SDA, MY_OLED_SCL // SDA, SCL @@ -52,4 +52,4 @@ //#define DISABLE_BROWNOUT 1 // comment out if you want to keep brownout feature -#endif \ No newline at end of file +#endif