From efd9f1774fddee6621363cb26cdcdce121a1a9b1 Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Wed, 20 Feb 2019 23:37:31 +0100 Subject: [PATCH 1/3] Update ttgobeam.h --- src/hal/ttgobeam.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hal/ttgobeam.h b/src/hal/ttgobeam.h index 3052468e..bdbb5c0b 100644 --- a/src/hal/ttgobeam.h +++ b/src/hal/ttgobeam.h @@ -21,8 +21,8 @@ #define BATT_FACTOR 2 // voltage divider 100k/100k on board // 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 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 // enable only if device has these sensors, otherwise comment these lines @@ -48,4 +48,4 @@ //#define DISABLE_BROWNOUT 1 // comment out if you want to keep brownout feature -#endif \ No newline at end of file +#endif From 4b1223816f1542213deb616b0cfd6e7ffdb47891 Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Thu, 21 Feb 2019 13:21:51 +0100 Subject: [PATCH 2/3] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e44aafc1..ef5ead43 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 @@ -388,3 +388,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 From 16cebd418a63c6735a3f9102c5b2f7001d047c5b Mon Sep 17 00:00:00 2001 From: DavideNesi <38299260+DavideNesi@users.noreply.github.com> Date: Sat, 23 Feb 2019 18:20:10 +0100 Subject: [PATCH 3/3] Update plain_decoder.js the old version had problems while using wifi and gps but not bluetooth added battery monitor --- src/TTN/plain_decoder.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 +}