From 2c6ac9f4c034386611221729ebe43aa83107b438 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Thu, 16 Aug 2018 14:37:42 +0200 Subject: [PATCH 1/6] testing --- platformio.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platformio.ini b/platformio.ini index ce164811..7e4ca091 100644 --- a/platformio.ini +++ b/platformio.ini @@ -11,12 +11,12 @@ ; ---> SELECT TARGET PLATFORM HERE! <--- [platformio] -env_default = generic +;env_default = generic ;env_default = ebox ;env_default = heltec ;env_default = ttgov1 ;env_default = ttgov2 -;env_default = ttgov21 +env_default = ttgov21 ;env_default = ttgobeam ;env_default = lopy ;env_default = lopy4 @@ -50,7 +50,7 @@ build_flags = ; Warn ; -DCORE_DEBUG_LEVEL=2 ; Info - -DCORE_DEBUG_LEVEL=3 +; -DCORE_DEBUG_LEVEL=3 ; Debug ; -DCORE_DEBUG_LEVEL=4 ; Verbose From e68126a7f6dd9b60da41ebdb3ff5f4ae2e0780cd Mon Sep 17 00:00:00 2001 From: cyberman54 Date: Sat, 18 Aug 2018 16:28:33 +0200 Subject: [PATCH 2/6] testing --- .gitignore | 4 +++- platformio.ini | 6 +++--- src/paxcounter.conf | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index a535321a..03205dfd 100644 --- a/.gitignore +++ b/.gitignore @@ -5,8 +5,10 @@ .vscode/c_cpp_properties.json .vscode/settings.json .vscode/launch.json -src/loraconf.h .vscode/*.db .vscode/.browse.c_cpp.db* .clang_complete .gcc-flags.json +platformio.ini +src/paxcounter.conf +src/loraconf.h diff --git a/platformio.ini b/platformio.ini index ce164811..c5bbf652 100644 --- a/platformio.ini +++ b/platformio.ini @@ -11,8 +11,8 @@ ; ---> SELECT TARGET PLATFORM HERE! <--- [platformio] -env_default = generic -;env_default = ebox +;env_default = generic +env_default = ebox ;env_default = heltec ;env_default = ttgov1 ;env_default = ttgov2 @@ -50,7 +50,7 @@ build_flags = ; Warn ; -DCORE_DEBUG_LEVEL=2 ; Info - -DCORE_DEBUG_LEVEL=3 +; -DCORE_DEBUG_LEVEL=3 ; Debug ; -DCORE_DEBUG_LEVEL=4 ; Verbose diff --git a/src/paxcounter.conf b/src/paxcounter.conf index 7cf76677..bcecc56d 100644 --- a/src/paxcounter.conf +++ b/src/paxcounter.conf @@ -9,7 +9,7 @@ // Payload send cycle and encoding #define SEND_SECS 30 // payload send cycle [seconds/2] -> 60 sec. -#define PAYLOAD_ENCODER 1 // payload encoder: 1=Plain, 2=Packed, 3=CayenneLPP dynamic, 4=CayenneLPP packed +#define PAYLOAD_ENCODER 2 // payload encoder: 1=Plain, 2=Packed, 3=CayenneLPP dynamic, 4=CayenneLPP packed // Set this to include BLE counting and vendor filter functions #define VENDORFILTER 1 // comment out if you want to count things, not people From 468d054fd297b6cd22a3fdc94cb5fcaadd2da654 Mon Sep 17 00:00:00 2001 From: cyberman54 Date: Sat, 8 Sep 2018 12:33:32 +0200 Subject: [PATCH 3/6] support TTGO21 v1.6 added --- README.md | 3 +++ platformio.ini | 8 ++++---- src/hal/ttgov21.h | 47 ++++++++++++++++++++++++++++++++++++++++------- 3 files changed, 47 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 8c6400aa..73490820 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,9 @@ Depending on board hardware following features are supported: Target platform must be selected in [platformio.ini](https://github.com/cyberman54/ESP32-Paxcounter/blob/master/platformio.ini).
Hardware dependent settings (pinout etc.) are stored in board files in /hal directory.
+A suitable board with paxcounter software preloaded can be purchased via AliExpress +here.
+ 3D printable cases can be found (and, if wanted so, ordered) on Thingiverse, see Heltec, TTGOv2, TTGOv2.1, T-BEAM for example.
diff --git a/platformio.ini b/platformio.ini index c5bbf652..325f8df7 100644 --- a/platformio.ini +++ b/platformio.ini @@ -11,8 +11,8 @@ ; ---> SELECT TARGET PLATFORM HERE! <--- [platformio] -;env_default = generic -env_default = ebox +env_default = generic +;env_default = ebox ;env_default = heltec ;env_default = ttgov1 ;env_default = ttgov2 @@ -44,13 +44,13 @@ build_flags = ; otherwise device may leak RAM ; ; None - -DCORE_DEBUG_LEVEL=0 +; -DCORE_DEBUG_LEVEL=0 ; Error ; -DCORE_DEBUG_LEVEL=1 ; Warn ; -DCORE_DEBUG_LEVEL=2 ; Info -; -DCORE_DEBUG_LEVEL=3 + -DCORE_DEBUG_LEVEL=3 ; Debug ; -DCORE_DEBUG_LEVEL=4 ; Verbose diff --git a/src/hal/ttgov21.h b/src/hal/ttgov21.h index 06cda59f..4341b0ed 100644 --- a/src/hal/ttgov21.h +++ b/src/hal/ttgov21.h @@ -1,18 +1,51 @@ /* Hardware related definitions for TTGO V2.1 Board / ATTENTION: check your board version! / Different versions are on the market which need different settings in this file: -/ - without label -> "old" -/ - labelled v1.5 on pcb -> "old" -/ - labelled v1.6 on pcb -> "new" +/ - without label -> settings (2) +/ - labeled v1.5 on pcb -> settings (2) +/ - labeled v1.6 on pcb -> settings (1) +/ Choose the right configuration below */ +// (1) settings for board labeled "t3 v1.6" on pcb + +#define HAS_LORA 1 // comment out if device shall not send data via LoRa +#define HAS_SPI 1 // comment out if device shall not send data via SPI +#define CFG_sx1276_radio 1 // HPD13A LoRa SoC + +#define HAS_DISPLAY U8X8_SSD1306_128X64_NONAME_HW_I2C +#define HAS_LED GPIO_NUM_23 // green on board LED +#define HAS_BATTERY_PROBE ADC1_GPIO35_CHANNEL // uses GPIO7 +#define BATT_FACTOR 2 // voltage divider 100k/100k on board + +// re-define pin definitions of pins_arduino.h +#define PIN_SPI_SS GPIO_NUM_18 // ESP32 GPIO18 (Pin18) -- HPD13A NSS/SEL (Pin4) SPI Chip Select Input +#define PIN_SPI_MOSI GPIO_NUM_27 // ESP32 GPIO27 (Pin27) -- HPD13A MOSI/DSI (Pin6) SPI Data Input +#define PIN_SPI_MISO GPIO_NUM_19 // ESP32 GPIO19 (Pin19) -- HPD13A MISO/DSO (Pin7) SPI Data Output +#define PIN_SPI_SCK GPIO_NUM_5 // ESP32 GPIO5 (Pin5) -- HPD13A SCK (Pin5) SPI Clock Input + +// non arduino pin definitions +//#define RST GPIO_NUM_23 // ESP32 GPIO23 <-> HPD13A RESET +#define RST LMIC_UNUSED_PIN // connected to ESP32 RST/EN (old board) +//#define RST GPIO_NUM_12 // (boards labeled v1.5) +#define DIO0 GPIO_NUM_26 // ESP32 GPIO26 <-> HPD13A IO0 +#define DIO1 GPIO_NUM_33 // ESP32 GPIO33 <-> HPDIO1 <-> HPD13A IO1 +#define DIO2 GPIO_NUM_32 // ESP32 GPIO32 <-> HPDIO2 <-> HPD13A IO2 + +// Hardware pin definitions for TTGO V2 Board with OLED SSD1306 0,96" I2C Display +#define OLED_RST U8X8_PIN_NONE // connected to CPU RST/EN +#define OLED_SDA GPIO_NUM_21 // ESP32 GPIO21 -- SD1306 D1+D2 +#define OLED_SCL GPIO_NUM_22 // ESP32 GPIO22 -- SD1306 D0 + +/* +// (2) settings for boards without label on pcb, or labeled v1.5 on pcb + #define HAS_LORA 1 // comment out if device shall not send data via LoRa #define HAS_SPI 1 // comment out if device shall not send data via SPI #define CFG_sx1276_radio 1 // HPD13A LoRa SoC #define HAS_DISPLAY U8X8_SSD1306_128X64_NONAME_HW_I2C #define DISPLAY_FLIP 1 // rotated display -#define HAS_LED GPIO_NUM_23 // green on board LED (new board ONLY) #define HAS_BATTERY_PROBE ADC1_GPIO35_CHANNEL // uses GPIO7 #define BATT_FACTOR 2 // voltage divider 100k/100k on board @@ -24,8 +57,7 @@ // non arduino pin definitions #define RST LMIC_UNUSED_PIN // connected to ESP32 RST/EN (old board) -//#define RST GPIO_NUM_12 // (old board v1.5) -//#define RST GPIO_NUM_19 //(new board) +//#define RST GPIO_NUM_12 // (boards labeled v1.5) #define DIO0 GPIO_NUM_26 // ESP32 GPIO26 <-> HPD13A IO0 #define DIO1 GPIO_NUM_33 // ESP32 GPIO33 <-> HPDIO1 <-> HPD13A IO1 #define DIO2 GPIO_NUM_32 // ESP32 GPIO32 <-> HPDIO2 <-> HPD13A IO2 @@ -33,4 +65,5 @@ // Hardware pin definitions for TTGO V2 Board with OLED SSD1306 0,96" I2C Display #define OLED_RST U8X8_PIN_NONE // connected to CPU RST/EN #define OLED_SDA GPIO_NUM_21 // ESP32 GPIO21 -- SD1306 D1+D2 -#define OLED_SCL GPIO_NUM_22 // ESP32 GPIO22 -- SD1306 D0 \ No newline at end of file +#define OLED_SCL GPIO_NUM_22 // ESP32 GPIO22 -- SD1306 D0 +*/ \ No newline at end of file From 25d42d42531a80d376a5061e64138f6c81dc22bc Mon Sep 17 00:00:00 2001 From: cyberman54 Date: Sat, 8 Sep 2018 13:12:37 +0200 Subject: [PATCH 4/6] edits ttgov21.h --- src/hal/ttgov21.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/hal/ttgov21.h b/src/hal/ttgov21.h index 4341b0ed..db1f65b1 100644 --- a/src/hal/ttgov21.h +++ b/src/hal/ttgov21.h @@ -14,7 +14,7 @@ #define CFG_sx1276_radio 1 // HPD13A LoRa SoC #define HAS_DISPLAY U8X8_SSD1306_128X64_NONAME_HW_I2C -#define HAS_LED GPIO_NUM_23 // green on board LED +#define HAS_LED GPIO_NUM_25 // green on board LED #define HAS_BATTERY_PROBE ADC1_GPIO35_CHANNEL // uses GPIO7 #define BATT_FACTOR 2 // voltage divider 100k/100k on board @@ -25,9 +25,7 @@ #define PIN_SPI_SCK GPIO_NUM_5 // ESP32 GPIO5 (Pin5) -- HPD13A SCK (Pin5) SPI Clock Input // non arduino pin definitions -//#define RST GPIO_NUM_23 // ESP32 GPIO23 <-> HPD13A RESET -#define RST LMIC_UNUSED_PIN // connected to ESP32 RST/EN (old board) -//#define RST GPIO_NUM_12 // (boards labeled v1.5) +#define RST GPIO_NUM_23 // ESP32 GPIO23 <-> HPD13A RESET #define DIO0 GPIO_NUM_26 // ESP32 GPIO26 <-> HPD13A IO0 #define DIO1 GPIO_NUM_33 // ESP32 GPIO33 <-> HPDIO1 <-> HPD13A IO1 #define DIO2 GPIO_NUM_32 // ESP32 GPIO32 <-> HPDIO2 <-> HPD13A IO2 From e4e5cc98e1918a261c213c76eb39196f302b4d8e Mon Sep 17 00:00:00 2001 From: cyberman54 Date: Sat, 8 Sep 2018 13:56:08 +0200 Subject: [PATCH 5/6] sanitizations --- .gitignore | 2 -- platformio.ini | 4 ++-- src/hal/heltec.h | 1 - src/hal/ttgov21.h | 8 ++++---- src/paxcounter.conf | 2 +- 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 03205dfd..030b6f3d 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,4 @@ .vscode/.browse.c_cpp.db* .clang_complete .gcc-flags.json -platformio.ini -src/paxcounter.conf src/loraconf.h diff --git a/platformio.ini b/platformio.ini index 325f8df7..bb895931 100644 --- a/platformio.ini +++ b/platformio.ini @@ -44,13 +44,13 @@ build_flags = ; otherwise device may leak RAM ; ; None -; -DCORE_DEBUG_LEVEL=0 + -DCORE_DEBUG_LEVEL=0 ; Error ; -DCORE_DEBUG_LEVEL=1 ; Warn ; -DCORE_DEBUG_LEVEL=2 ; Info - -DCORE_DEBUG_LEVEL=3 +; -DCORE_DEBUG_LEVEL=3 ; Debug ; -DCORE_DEBUG_LEVEL=4 ; Verbose diff --git a/src/hal/heltec.h b/src/hal/heltec.h index a860df50..2671fac8 100644 --- a/src/hal/heltec.h +++ b/src/hal/heltec.h @@ -5,7 +5,6 @@ #define CFG_sx1276_radio 1 #define HAS_DISPLAY U8X8_SSD1306_128X64_NONAME_HW_I2C // OLED-Display on board -//#define DISPLAY_FLIP 1 // uncomment this for rotated display #define HAS_LED GPIO_NUM_25 // white LED on board #define HAS_BUTTON GPIO_NUM_0 // button "PROG" on board diff --git a/src/hal/ttgov21.h b/src/hal/ttgov21.h index db1f65b1..f5c4b760 100644 --- a/src/hal/ttgov21.h +++ b/src/hal/ttgov21.h @@ -1,13 +1,13 @@ /* Hardware related definitions for TTGO V2.1 Board / ATTENTION: check your board version! / Different versions are on the market which need different settings in this file: -/ - without label -> settings (2) -/ - labeled v1.5 on pcb -> settings (2) -/ - labeled v1.6 on pcb -> settings (1) +/ - without label -> use settings (2) +/ - labeled V1.5 on pcb -> use settings (2) +/ - labeled V1.6 on pcb -> use settings (1) / Choose the right configuration below */ -// (1) settings for board labeled "t3 v1.6" on pcb +// (1) settings for board labeled "T3_V1.6" on pcb #define HAS_LORA 1 // comment out if device shall not send data via LoRa #define HAS_SPI 1 // comment out if device shall not send data via SPI diff --git a/src/paxcounter.conf b/src/paxcounter.conf index bcecc56d..7cf76677 100644 --- a/src/paxcounter.conf +++ b/src/paxcounter.conf @@ -9,7 +9,7 @@ // Payload send cycle and encoding #define SEND_SECS 30 // payload send cycle [seconds/2] -> 60 sec. -#define PAYLOAD_ENCODER 2 // payload encoder: 1=Plain, 2=Packed, 3=CayenneLPP dynamic, 4=CayenneLPP packed +#define PAYLOAD_ENCODER 1 // payload encoder: 1=Plain, 2=Packed, 3=CayenneLPP dynamic, 4=CayenneLPP packed // Set this to include BLE counting and vendor filter functions #define VENDORFILTER 1 // comment out if you want to count things, not people From c44949a003e5e3d19b6a95b0cba0cd9848d329e6 Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Sat, 8 Sep 2018 16:31:37 +0200 Subject: [PATCH 6/6] Update README.md --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 73490820..8c6400aa 100644 --- a/README.md +++ b/README.md @@ -49,9 +49,6 @@ Depending on board hardware following features are supported: Target platform must be selected in [platformio.ini](https://github.com/cyberman54/ESP32-Paxcounter/blob/master/platformio.ini).
Hardware dependent settings (pinout etc.) are stored in board files in /hal directory.
-A suitable board with paxcounter software preloaded can be purchased via AliExpress -here.
- 3D printable cases can be found (and, if wanted so, ordered) on Thingiverse, see Heltec, TTGOv2, TTGOv2.1, T-BEAM for example.