From 2c102f69a954a205109af037e4ecc7d0604051a6 Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Mon, 18 Nov 2019 13:25:52 +0100 Subject: [PATCH] combined GPS data revised logic --- README.md | 2 +- src/paxcounter.conf | 5 ++--- src/senddata.cpp | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 214e9d40..68fe86bd 100644 --- a/README.md +++ b/README.md @@ -180,7 +180,7 @@ Output of sensor and peripheral data is internally switched by a bitmask registe | 6 | User sensor 3 | on | 7 | Batterylevel | off -*) GPS data can also be combined with payload on port 1, #define PAYLOAD_GPS in paxcounter.conf to enable +*) GPS data can also be combined with payload on port 1, *#define GPSPORT 1* in paxcounter.conf to enable # Time sync diff --git a/src/paxcounter.conf b/src/paxcounter.conf index d9b2990d..bc3da7b6 100644 --- a/src/paxcounter.conf +++ b/src/paxcounter.conf @@ -13,7 +13,6 @@ #define SENDCYCLE 30 // payload send cycle [seconds/2], 0 .. 255 #define PAYLOAD_ENCODER 2 // payload encoder: 1=Plain, 2=Packed, 3=Cayenne LPP dynamic, 4=Cayenne LPP packed #define COUNTERMODE 0 // 0=cyclic, 1=cumulative, 2=cyclic confirmed -#define PAYLOAD_GPS 1 // add gps location to pax count payload: 0=no, 1=yes // Set this to include BLE counting and vendor filter functions, or to switch off WIFI counting #define VENDORFILTER 1 // set to 0 if you want to count things, not people @@ -76,7 +75,7 @@ #define TIME_SYNC_INTERVAL_RETRY 10 // retry time sync after lost sync each .. minutes [default = 10], 0 means off #define TIME_SYNC_COMPILEDATE 0 // set to 1 to use compile date to initialize RTC after power outage [default = 0] #define TIME_SYNC_LORAWAN 0 // set to 1 to use LORA network as time source, 0 means off [default = 0] -#define TIME_SYNC_LORASERVER 0 // set to 1 to use LORA timeserver as time source, 0 means off [default = 0] +#define TIME_SYNC_LORASERVER 1 // set to 1 to use LORA timeserver as time source, 0 means off [default = 0] // settings for syncing time with timeserver applications #define TIME_SYNC_SAMPLES 1 // number of time requests for averaging @@ -93,7 +92,7 @@ #define RCMDPORT 2 // remote commands #define STATUSPORT 2 // remote command results #define CONFIGPORT 3 // config query results -#define GPSPORT 4 // gps +#define GPSPORT 4 // gps - set to 1 to send combined GPS+COUNT payload #define BUTTONPORT 5 // button pressed signal #define BEACONPORT 6 // beacon alarms #define BMEPORT 7 // BME680 sensor diff --git a/src/senddata.cpp b/src/senddata.cpp index 4e230cb8..3df51b3c 100644 --- a/src/senddata.cpp +++ b/src/senddata.cpp @@ -70,7 +70,7 @@ void sendData() { if (cfg.blescan) payload.addCount(macs_ble, MAC_SNIFF_BLE); -#if (PAYLOAD_GPS) +#if (HAS_GPS) && (GPSPORT == 1) // send GPS position only if we have a fix if (gps.location.isValid()) { gpsStatus_t gps_status; @@ -102,7 +102,7 @@ void sendData() { break; #endif -#if (HAS_GPS) +#if (HAS_GPS) && (GPSPORT != 1) case GPS_DATA: // send GPS position only if we have a fix if (gps.location.isValid()) {