From a2b46971881859e815e542efa238285a0ba3a955 Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Wed, 13 Mar 2019 12:38:21 +0100 Subject: [PATCH 1/7] Update heltec.h --- src/hal/heltec.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hal/heltec.h b/src/hal/heltec.h index f8ab5b8e..3aefdcc7 100644 --- a/src/hal/heltec.h +++ b/src/hal/heltec.h @@ -18,8 +18,8 @@ #define HAS_BUTTON KEY_BUILTIN // button "PROG" on board // Pins for I2C interface of OLED Display -#define MY_OLED_SDA (21) -#define MY_OLED_SCL (22) +#define MY_OLED_SDA (4) +#define MY_OLED_SCL (15) #define MY_OLED_RST (16) // Pins for LORA chip SPI interface come from board file, we need some From 12ad9aaea73571731fb01e5baf3f6791557c1d39 Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Wed, 13 Mar 2019 12:38:41 +0100 Subject: [PATCH 2/7] Update heltecv2.h --- src/hal/heltecv2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hal/heltecv2.h b/src/hal/heltecv2.h index 7cb9145c..c351ef68 100644 --- a/src/hal/heltecv2.h +++ b/src/hal/heltecv2.h @@ -18,8 +18,8 @@ #define HAS_BUTTON KEY_BUILTIN // button "PROG" on board // Pins for I2C interface of OLED Display -#define MY_OLED_SDA (4) -#define MY_OLED_SCL (15) +#define MY_OLED_SDA (21) +#define MY_OLED_SCL (22) #define MY_OLED_RST (16) // Pins for LORA chip SPI interface come from board file, we need some From e38e79fa6356677cef09ca47d7b4466d88592610 Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Wed, 13 Mar 2019 12:48:21 +0100 Subject: [PATCH 3/7] Update heltecv2.h --- src/hal/heltecv2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hal/heltecv2.h b/src/hal/heltecv2.h index c351ef68..7cb9145c 100644 --- a/src/hal/heltecv2.h +++ b/src/hal/heltecv2.h @@ -18,8 +18,8 @@ #define HAS_BUTTON KEY_BUILTIN // button "PROG" on board // Pins for I2C interface of OLED Display -#define MY_OLED_SDA (21) -#define MY_OLED_SCL (22) +#define MY_OLED_SDA (4) +#define MY_OLED_SCL (15) #define MY_OLED_RST (16) // Pins for LORA chip SPI interface come from board file, we need some From 847bd7431c55d285128aa372d4c20bb134128b0e Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Wed, 13 Mar 2019 22:30:17 +0100 Subject: [PATCH 4/7] Update heltec.h --- src/hal/heltec.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hal/heltec.h b/src/hal/heltec.h index 3aefdcc7..a4465500 100644 --- a/src/hal/heltec.h +++ b/src/hal/heltec.h @@ -5,7 +5,7 @@ #include -// Hardware related definitions for Heltec V2 LoRa-32 Board +// Hardware related definitions for Heltec V1 LoRa-32 Board //#define HAS_BME GPIO_NUM_21, GPIO_NUM_22 // SDA, SCL //#define BME_ADDR BME680_I2C_ADDR_PRIMARY // connect SDIO of BME680 to GND From 2640c0ba5902608a5c4bf40c4ecb5f1a901a924c Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Fri, 15 Mar 2019 19:54:20 +0100 Subject: [PATCH 5/7] main.cpp: bugfix lowpower gpio pin init --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 0b44c850..a9a54669 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -184,7 +184,7 @@ void setup() { // set low power mode to off #ifdef HAS_LOWPOWER_SWITCH - pinMode(HAS_LED, OUTPUT); + pinMode(HAS_LOWPOWER_SWITCH, OUTPUT); digitalWrite(HAS_LOWPOWER_SWITCH, HIGH); strcat_P(features, " LPWR"); #endif @@ -428,4 +428,4 @@ void loop() { } vTaskDelete(NULL); // shoud never be reached -} \ No newline at end of file +} From 7244596dedd665ac8eede879074c4a4fb8e6e56b Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Fri, 15 Mar 2019 20:20:21 +0100 Subject: [PATCH 6/7] removed gps data from counter payload --- README.md | 1 - src/senddata.cpp | 22 +++++----------------- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 9ba51050..6a26492e 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,6 @@ Hereafter described is the default *plain* format, which uses MSB bit numbering. byte 1-2: Number of unique pax, first seen on Wifi byte 3-4: Number of unique pax, first seen on Bluetooth [omited if BT disabled] - bytes 5-17: GPS data, if present, in same format as for Port #4 **Port #2:** Device status query result diff --git a/src/senddata.cpp b/src/senddata.cpp index 816ee7c7..9eb475b9 100644 --- a/src/senddata.cpp +++ b/src/senddata.cpp @@ -39,7 +39,7 @@ void SendPayload(uint8_t port, sendprio_t prio) { memcpy(SendBuffer.Message, payload.getBuffer(), payload.getSize()); // enqueue message in device's send queues -#if(HAS_LORA) +#if (HAS_LORA) lora_enqueuedata(&SendBuffer, prio); #endif #ifdef HAS_SPI @@ -62,18 +62,6 @@ void sendCounter() { payload.addCount(macs_wifi, MAC_SNIFF_WIFI); if (cfg.blescan) payload.addCount(macs_ble, MAC_SNIFF_BLE); - -#if(HAS_GPS) - if (gps.location.isValid()) { // send GPS position only if we have a fix - gps_read(); - payload.addGPS(gps_status); - } else { - ESP_LOGD( - TAG, - "No valid GPS position. GPS data not appended to counter data."); - } -#endif - SendPayload(COUNTERPORT, prio_normal); // clear counter if not in cumulative counter mode if (cfg.countermode != 1) { @@ -83,7 +71,7 @@ void sendCounter() { } break; -#if(HAS_BME) +#if (HAS_BME) case MEMS_DATA: payload.reset(); payload.addBME(bme_status); @@ -91,7 +79,7 @@ void sendCounter() { break; #endif -#if(HAS_GPS) +#if (HAS_GPS) case GPS_DATA: // send GPS position only if we have a fix if (gps.location.isValid()) { @@ -104,7 +92,7 @@ void sendCounter() { break; #endif -#if(HAS_SENSORS) +#if (HAS_SENSORS) case SENSOR1_DATA: payload.reset(); payload.addSensor(sensor_read(1)); @@ -138,7 +126,7 @@ void sendCounter() { } // sendCounter() void flushQueues() { -#if(HAS_LORA) +#if (HAS_LORA) lora_queuereset(); #endif #ifdef HAS_SPI From efd8f989a9ac5216480eeea3ca6c63c41a925193 Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Fri, 15 Mar 2019 20:24:55 +0100 Subject: [PATCH 7/7] board hal file sanitizations --- src/hal/ttgobeam.h | 16 +++------------- src/hal/ttgofox.h | 7 +------ 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/src/hal/ttgobeam.h b/src/hal/ttgobeam.h index dcce95ad..91b68ebe 100644 --- a/src/hal/ttgobeam.h +++ b/src/hal/ttgobeam.h @@ -25,15 +25,11 @@ #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 -// Settings for on board DS3231 RTC chip -//#define HAS_RTC MY_OLED_SDA, MY_OLED_SCL // SDA, SCL -//#define RTC_INT GPIO_NUM_13 // timepulse with accuracy +/- 2*e-6 [microseconds] = 0,1728sec / day - // enable only if device has these sensors, otherwise comment these lines // BME680 sensor on I2C bus -#define HAS_BME 1 // Enable BME sensors in general -#define HAS_BME680 SDA, SCL -#define BME680_ADDR BME680_I2C_ADDR_PRIMARY // !! connect SDIO of BME680 to GND !! +//#define HAS_BME 1 // Enable BME sensors in general +//#define HAS_BME680 SDA, SCL +//#define BME680_ADDR BME680_I2C_ADDR_PRIMARY // !! connect SDIO of BME680 to GND !! // display (if connected) #define HAS_DISPLAY U8X8_SSD1306_128X64_NONAME_HW_I2C @@ -42,12 +38,6 @@ #define MY_OLED_RST U8X8_PIN_NONE //#define DISPLAY_FLIP 1 // use if display is rotated -// Settings for DCF77 interface -#define HAS_DCF77 GPIO_NUM_13 - -// Settings for IF482 interface -//#define HAS_IF482 9600, SERIAL_7E1, GPIO_NUM_12, GPIO_NUM_14 // IF482 serial port parameters - // user defined sensors (if connected) //#define HAS_SENSORS 1 // comment out if device has user defined sensors diff --git a/src/hal/ttgofox.h b/src/hal/ttgofox.h index fe782248..e29d71fb 100644 --- a/src/hal/ttgofox.h +++ b/src/hal/ttgofox.h @@ -25,17 +25,12 @@ #define RTC_INT GPIO_NUM_34 // timepulse with accuracy +/- 2*e-6 [microseconds] = 0,1728sec / day // Settings for IF482 interface -#define HAS_IF482 9600, SERIAL_7E1, GPIO_NUM_12, GPIO_NUM_14 // IF482 serial port parameters +//#define HAS_IF482 9600, SERIAL_7E1, GPIO_NUM_12, GPIO_NUM_14 // IF482 serial port parameters // Settings for DCF77 interface //#define HAS_DCF77 GPIO_NUM_14 //#define DCF77_ACTIVE_LOW 1 -// Settings for external GPS chip -#define HAS_GPS 1 // use on board GPS -#define GPS_SERIAL 9600, SERIAL_8N1, GPIO_NUM_17, GPIO_NUM_16 // UBlox NEO 6M or 7M with default configuration -#define GPS_INT GPIO_NUM_13 - // Pins for LORA chip SPI interface, reset line and interrupt lines #define LORA_SCK (5) #define LORA_CS (18)