From 8d4c6fc0dd5c0a68feac3b7f0f8ba5d041adacee Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Wed, 18 Jul 2018 19:55:09 +0200 Subject: [PATCH 1/6] platformio.ini: set back to Espressif 1.0.2 --- platformio.ini | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/platformio.ini b/platformio.ini index de53f14d..798ce487 100644 --- a/platformio.ini +++ b/platformio.ini @@ -11,11 +11,10 @@ ; ---> SELECT TARGET PLATFORM HERE! <--- [platformio] -;env_default = lolin32lite, heltec, generic -env_default = generic +;env_default = generic ;env_default = heltec ;env_default = ttgov1 -;env_default = ttgov2 +env_default = ttgov2 ;env_default = ttgov21 ;env_default = ttgobeam ;env_default = lopy @@ -28,9 +27,9 @@ env_default = generic description = Paxcounter is a proof-of-concept ESP32 device for metering passenger flows in realtime. It counts how many mobile devices are around. [common_env_data] -;platform_espressif32 = espressif32@1.0.2 +platform_espressif32 = espressif32@1.0.2 ;platform_espressif32 = espressif32@1.1.2 -platform_espressif32 = https://github.com/platformio/platform-espressif32.git#feature/stage +;platform_espressif32 = https://github.com/platformio/platform-espressif32.git#feature/stage board_build.partitions = no_ota.csv lib_deps_all = lib_deps_display = From 075604842e26bb7d33f76e5bf8aeec53549e3d55 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Wed, 18 Jul 2018 19:56:25 +0200 Subject: [PATCH 2/6] set back i2c speed to 400khz --- lib/U8g2_ID942-tweaked/src/clib/u8x8_d_ssd1306_128x64_noname.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/U8g2_ID942-tweaked/src/clib/u8x8_d_ssd1306_128x64_noname.c b/lib/U8g2_ID942-tweaked/src/clib/u8x8_d_ssd1306_128x64_noname.c index 9b102c86..09b16ab5 100644 --- a/lib/U8g2_ID942-tweaked/src/clib/u8x8_d_ssd1306_128x64_noname.c +++ b/lib/U8g2_ID942-tweaked/src/clib/u8x8_d_ssd1306_128x64_noname.c @@ -298,7 +298,7 @@ static const u8x8_display_info_t u8x8_ssd1306_128x64_noname_display_info = /* sck_pulse_width_ns = */ 50, /* SSD1306: 20ns, but cycle time is 100ns, so use 100/2, AVR: below 70: 8 MHz, >= 70 --> 4MHz clock */ /* sck_clock_hz = */ 8000000UL, /* since Arduino 1.6.0, the SPI bus speed in Hz. Should be 1000000000/sck_pulse_width_ns */ /* spi_mode = */ 0, /* active high, rising edge */ - /* ==> i2c_bus_clock_100kHz = */ 1, + /* ==> i2c_bus_clock_100kHz = */ 4, /* data_setup_time_ns = */ 40, /* write_pulse_width_ns = */ 150, /* SSD1306: cycle time is 300ns, so use 300/2 = 150 */ /* tile_width = */ 16, From d37e7cb46113c8a370be84862555b66602f6132d Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Wed, 18 Jul 2018 20:51:17 +0200 Subject: [PATCH 3/6] code sanitizations --- platformio.ini | 4 ++-- src/antenna.cpp | 2 -- src/globals.h | 3 --- src/payload.h | 2 -- 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/platformio.ini b/platformio.ini index 798ce487..d9b77444 100644 --- a/platformio.ini +++ b/platformio.ini @@ -11,10 +11,10 @@ ; ---> SELECT TARGET PLATFORM HERE! <--- [platformio] -;env_default = generic +env_default = generic ;env_default = heltec ;env_default = ttgov1 -env_default = ttgov2 +;env_default = ttgov2 ;env_default = ttgov21 ;env_default = ttgobeam ;env_default = lopy diff --git a/src/antenna.cpp b/src/antenna.cpp index 196080b4..46c6c77e 100644 --- a/src/antenna.cpp +++ b/src/antenna.cpp @@ -2,8 +2,6 @@ #ifdef HAS_ANTENNA_SWITCH -#include - // Local logging tag static const char TAG[] = "wifi"; diff --git a/src/globals.h b/src/globals.h index a904bdb8..7738b8a7 100644 --- a/src/globals.h +++ b/src/globals.h @@ -71,8 +71,6 @@ extern portMUX_TYPE timerMux; // class for preparing payload data #include "payload.h" - -// payload encoder #if PAYLOAD_ENCODER == 1 extern TTNplain payload; #elif PAYLOAD_ENCODER == 2 @@ -83,7 +81,6 @@ extern CayenneLPP payload; #error "No valid payload converter defined" #endif - void reset_counters(void); void blink_LED(uint16_t set_color, uint16_t set_blinkduration); void led_loop(void); diff --git a/src/payload.h b/src/payload.h index 3a06a948..7dec9d04 100644 --- a/src/payload.h +++ b/src/payload.h @@ -1,8 +1,6 @@ #ifndef _PAYLOAD_H_ #define _PAYLOAD_H_ -#include - // MyDevices CayenneLPP channels #define LPP_GPS_CHANNEL 20 #define LPP_COUNT_WIFI_CHANNEL 21 From bbb42cda1888f5ae3af80e26caf39abf2d43dd57 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Fri, 20 Jul 2018 17:22:08 +0200 Subject: [PATCH 4/6] ttgobeam.h updated --- platformio.ini | 4 ++-- src/hal/ttgobeam.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/platformio.ini b/platformio.ini index d9b77444..8a7ed235 100644 --- a/platformio.ini +++ b/platformio.ini @@ -11,11 +11,11 @@ ; ---> SELECT TARGET PLATFORM HERE! <--- [platformio] -env_default = generic +;env_default = generic ;env_default = heltec ;env_default = ttgov1 ;env_default = ttgov2 -;env_default = ttgov21 +env_default = ttgov21 ;env_default = ttgobeam ;env_default = lopy ;env_default = lopy4 diff --git a/src/hal/ttgobeam.h b/src/hal/ttgobeam.h index 8984d203..913f3a16 100644 --- a/src/hal/ttgobeam.h +++ b/src/hal/ttgobeam.h @@ -22,4 +22,5 @@ #define RST LMIC_UNUSED_PIN // connected to ESP32 RST/EN #define DIO0 GPIO_NUM_26 // ESP32 GPIO26 <-> HPD13A IO0 #define DIO1 GPIO_NUM_32 // Lora1 <-> HPD13A IO1 // !! NEEDS EXTERNAL WIRING !! +//#define DIO1 GPIO_NUM_33 // Lora1 <-> HPD13A IO1 // for T-Beam T22_V05 only #define DIO2 LMIC_UNUSED_PIN // Lora2 <-> HPD13A IO2 // not needed for LoRa From d6619d6cfff266e3b2139d4aff6068a8e0f25510 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Sat, 21 Jul 2018 13:37:36 +0200 Subject: [PATCH 5/6] default payload encoder set back to 1 --- src/paxcounter.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/paxcounter.conf b/src/paxcounter.conf index e6b0abd8..69146a1c 100644 --- a/src/paxcounter.conf +++ b/src/paxcounter.conf @@ -36,7 +36,7 @@ #define WIFI_CHANNEL_SWITCH_INTERVAL 50 // [seconds/100] -> 0,5 sec. // LoRa payload default parameters -#define PAYLOAD_ENCODER 2 // select payload encoder: 1=Plain [default], 2=Packed, 3=CayenneLPP +#define PAYLOAD_ENCODER 1 // select payload encoder: 1=Plain [default], 2=Packed, 3=CayenneLPP #define SEND_SECS 120 // payload send cycle [seconds/2] -> 240 sec. #define MEM_LOW 2048 // [Bytes] low memory threshold triggering a send cycle #define RETRANSMIT_RCMD 5 // [seconds] wait time before retransmitting rcommand results From c477376801b5fb13ac759da8316cacd4f0b60d31 Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Sat, 21 Jul 2018 13:47:14 +0200 Subject: [PATCH 6/6] bugfix cayenne payload --- src/payload.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/payload.cpp b/src/payload.cpp index 81927bee..9cb46a77 100644 --- a/src/payload.cpp +++ b/src/payload.cpp @@ -207,7 +207,7 @@ void CayenneLPP::addCount(uint16_t value1, uint16_t value2) { buffer[cursor++] = value1; buffer[cursor++] = LPP_COUNT_BLE_CHANNEL; buffer[cursor++] = LPP_ANALOG_INPUT; // workaround, type meter not found? - buffer[cursor++] = value1 >> 8; + buffer[cursor++] = value2 >> 8; buffer[cursor++] = value2; } @@ -245,4 +245,4 @@ void CayenneLPP::addStatus(uint16_t voltage, uint64_t uptime, float cputemp) { buffer[cursor++] = LPP_TEMPERATURE; buffer[cursor++] = (uint16_t)cputemp >> 8; buffer[cursor++] = (uint16_t)cputemp; -} \ No newline at end of file +}