Merge pull request #315 from cyberman54/master

sync dev to master
This commit is contained in:
Verkehrsrot 2019-03-15 20:25:40 +01:00 committed by GitHub
commit b673569d77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 39 deletions

View File

@ -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 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] 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 **Port #2:** Device status query result

View File

@ -1,3 +1,4 @@
// clang-format off // clang-format off
#ifndef _HELTEC_H #ifndef _HELTEC_H

View File

@ -25,15 +25,11 @@
#define GPS_SERIAL 9600, SERIAL_8N1, GPIO_NUM_12, GPIO_NUM_15 // UBlox NEO 6M #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
//#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 // enable only if device has these sensors, otherwise comment these lines
// BME680 sensor on I2C bus // BME680 sensor on I2C bus
#define HAS_BME 1 // Enable BME sensors in general //#define HAS_BME 1 // Enable BME sensors in general
#define HAS_BME680 SDA, SCL //#define HAS_BME680 SDA, SCL
#define BME680_ADDR BME680_I2C_ADDR_PRIMARY // !! connect SDIO of BME680 to GND !! //#define BME680_ADDR BME680_I2C_ADDR_PRIMARY // !! connect SDIO of BME680 to GND !!
// display (if connected) // display (if connected)
#define HAS_DISPLAY U8X8_SSD1306_128X64_NONAME_HW_I2C #define HAS_DISPLAY U8X8_SSD1306_128X64_NONAME_HW_I2C
@ -42,12 +38,6 @@
#define MY_OLED_RST U8X8_PIN_NONE #define MY_OLED_RST U8X8_PIN_NONE
//#define DISPLAY_FLIP 1 // use if display is rotated //#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) // user defined sensors (if connected)
//#define HAS_SENSORS 1 // comment out if device has user defined sensors //#define HAS_SENSORS 1 // comment out if device has user defined sensors

View File

@ -25,17 +25,12 @@
#define RTC_INT GPIO_NUM_34 // timepulse with accuracy +/- 2*e-6 [microseconds] = 0,1728sec / day #define RTC_INT GPIO_NUM_34 // timepulse with accuracy +/- 2*e-6 [microseconds] = 0,1728sec / day
// Settings for IF482 interface // 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 // Settings for DCF77 interface
//#define HAS_DCF77 GPIO_NUM_14 //#define HAS_DCF77 GPIO_NUM_14
//#define DCF77_ACTIVE_LOW 1 //#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 // Pins for LORA chip SPI interface, reset line and interrupt lines
#define LORA_SCK (5) #define LORA_SCK (5)
#define LORA_CS (18) #define LORA_CS (18)

View File

@ -186,7 +186,7 @@ void setup() {
// set low power mode to off // set low power mode to off
#ifdef HAS_LOWPOWER_SWITCH #ifdef HAS_LOWPOWER_SWITCH
pinMode(HAS_LED, OUTPUT); pinMode(HAS_LOWPOWER_SWITCH, OUTPUT);
digitalWrite(HAS_LOWPOWER_SWITCH, HIGH); digitalWrite(HAS_LOWPOWER_SWITCH, HIGH);
strcat_P(features, " LPWR"); strcat_P(features, " LPWR");
#endif #endif

View File

@ -39,7 +39,7 @@ void SendPayload(uint8_t port, sendprio_t prio) {
memcpy(SendBuffer.Message, payload.getBuffer(), payload.getSize()); memcpy(SendBuffer.Message, payload.getBuffer(), payload.getSize());
// enqueue message in device's send queues // enqueue message in device's send queues
#if(HAS_LORA) #if (HAS_LORA)
lora_enqueuedata(&SendBuffer, prio); lora_enqueuedata(&SendBuffer, prio);
#endif #endif
#ifdef HAS_SPI #ifdef HAS_SPI
@ -62,18 +62,6 @@ void sendCounter() {
payload.addCount(macs_wifi, MAC_SNIFF_WIFI); payload.addCount(macs_wifi, MAC_SNIFF_WIFI);
if (cfg.blescan) if (cfg.blescan)
payload.addCount(macs_ble, MAC_SNIFF_BLE); 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); SendPayload(COUNTERPORT, prio_normal);
// clear counter if not in cumulative counter mode // clear counter if not in cumulative counter mode
if (cfg.countermode != 1) { if (cfg.countermode != 1) {
@ -83,7 +71,7 @@ void sendCounter() {
} }
break; break;
#if(HAS_BME) #if (HAS_BME)
case MEMS_DATA: case MEMS_DATA:
payload.reset(); payload.reset();
payload.addBME(bme_status); payload.addBME(bme_status);
@ -91,7 +79,7 @@ void sendCounter() {
break; break;
#endif #endif
#if(HAS_GPS) #if (HAS_GPS)
case GPS_DATA: case GPS_DATA:
// send GPS position only if we have a fix // send GPS position only if we have a fix
if (gps.location.isValid()) { if (gps.location.isValid()) {
@ -104,7 +92,7 @@ void sendCounter() {
break; break;
#endif #endif
#if(HAS_SENSORS) #if (HAS_SENSORS)
case SENSOR1_DATA: case SENSOR1_DATA:
payload.reset(); payload.reset();
payload.addSensor(sensor_read(1)); payload.addSensor(sensor_read(1));
@ -138,7 +126,7 @@ void sendCounter() {
} // sendCounter() } // sendCounter()
void flushQueues() { void flushQueues() {
#if(HAS_LORA) #if (HAS_LORA)
lora_queuereset(); lora_queuereset();
#endif #endif
#ifdef HAS_SPI #ifdef HAS_SPI