Merge pull request #488 from cyberman54/development

GPS combined payload compile option added
This commit is contained in:
Verkehrsrot 2019-11-17 14:24:30 +01:00 committed by GitHub
commit ace448970d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 16 deletions

View File

@ -169,17 +169,18 @@ Output of user sensor data can be switched by user remote control command 0x14 s
Output of sensor and peripheral data is internally switched by a bitmask register. Default mask can be tailored by editing *cfg.payloadmask* initialization value in [*configmanager.cpp*](src/configmanager.cpp) following this scheme:
| Bit | Sensordata |
| --- | ------------- |
| 0 | GPS |
| 1 | Beacon alarm |
| 2 | BME280/680 |
| 3 | Paxcounter |
| 4 | User sensor 1 |
| 5 | User sensor 2 |
| 6 | User sensor 3 |
| 7 | Batterylevel |
| Bit | Sensordata | Default
| --- | ------------- | -------
| 0 | GPS | off*
| 1 | Beacon alarm | on
| 2 | BME280/680 | on
| 3 | Paxcounter | on
| 4 | User sensor 1 | on
| 5 | User sensor 2 | on
| 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
# Time sync

View File

@ -18,7 +18,7 @@ halfile = generic.h
;halfile = ttgov21old.h
;halfile = ttgov21new.h
;halfile = ttgofox.h
;halfile = ttgobeam.h
halfile = ttgobeam.h
;halfile = ttgobeam10.h
;halfile = fipy.h
;halfile = lopy.h
@ -46,7 +46,7 @@ description = Paxcounter is a device for metering passenger flows in realtime. I
release_version = 1.9.81
; DEBUG LEVEL: For production run set to 0, otherwise device will leak RAM while running!
; 0=None, 1=Error, 2=Warn, 3=Info, 4=Debug, 5=Verbose
debug_level = 3
debug_level = 4
extra_scripts = pre:build.py
otakeyfile = ota.conf
lorakeyfile = loraconf.h

View File

@ -9,9 +9,9 @@ nvs_handle my_handle;
esp_err_t err;
#define PAYLOADMASK \
((GPS_DATA | ALARM_DATA | MEMS_DATA | COUNT_DATA | SENSOR1_DATA | \
SENSOR2_DATA | SENSOR3_DATA) & \
~BATT_DATA)
((ALARM_DATA | MEMS_DATA | COUNT_DATA | SENSOR1_DATA | SENSOR2_DATA | \
SENSOR3_DATA) & \
(~BATT_DATA) & (~GPS_DATA))
// populate cfg vars with factory settings
void defaultConfig() {

View File

@ -13,6 +13,7 @@
#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

View File

@ -65,9 +65,21 @@ void sendData() {
#if ((WIFICOUNTER) || (BLECOUNTER))
case COUNT_DATA:
payload.reset();
if (cfg.wifiscan)
payload.addCount(macs_wifi, MAC_SNIFF_WIFI);
if (cfg.blescan)
payload.addCount(macs_ble, MAC_SNIFF_BLE);
#if (PAYLOAD_GPS)
// send GPS position only if we have a fix
if (gps.location.isValid()) {
gpsStatus_t gps_status;
gps_storelocation(&gps_status);
payload.addGPS(gps_status);
} else
ESP_LOGD(TAG, "No valid GPS position");
#endif
SendPayload(COUNTERPORT, prio_normal);
// clear counter if not in cumulative counter mode
if (cfg.countermode != 1) {