Merge remote-tracking branch 'refs/remotes/origin/master'

This commit is contained in:
Chrisotph Schultz 2020-09-27 19:29:46 +02:00
commit c802ad2c46
9 changed files with 30 additions and 29 deletions

View File

@ -282,8 +282,8 @@ Hereafter described is the default *plain* format, which uses MSB bit numbering.
**Port #1:** Paxcount data **Port #1:** Paxcount data
byte 1-2: Number of unique devices, seen on Wifi byte 1-2: Number of unique devices, seen on Wifi [00 00 if Wifi scan disabled]
byte 3-4: Number of unique devices, seen on Bluetooth [ommited if BT disabled] byte 3-4: Number of unique devices, seen on Bluetooth [ommited if BT scan disabled]
**Port #2:** Device status query result **Port #2:** Device status query result
@ -542,9 +542,9 @@ Send for example `8386` as Downlink on Port 2 to get battery status and time/dat
# License # License
Copyright 2018 Oliver Brandmueller <ob@sysadm.in> Copyright 2018-2020 Oliver Brandmueller <ob@sysadm.in>
Copyright 2018 Klaus Wilting <verkehrsrot@arcor.de> Copyright 2018-2020 Klaus Wilting <verkehrsrot@arcor.de>
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@ -33,7 +33,7 @@
//#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 1 //#define HAS_DISPLAY 1
#define MY_DISPLAY_SDA SDA #define MY_DISPLAY_SDA SDA
#define MY_DISPLAY_SCL SCL #define MY_DISPLAY_SCL SCL
#define MY_DISPLAY_RST NOT_A_PIN #define MY_DISPLAY_RST NOT_A_PIN

View File

@ -39,8 +39,8 @@ void setABPParameters() {
// devices' ping slots. LMIC does not have an easy way to define set this // devices' ping slots. LMIC does not have an easy way to define set this
// frequency and support for class B is spotty and untested, so this // frequency and support for class B is spotty and untested, so this
// frequency is not configured here. // frequency is not configured here.
#elif defined(CFG_us915) #elif defined(CFG_us915) || defined(CFG_au915)
// NA-US channels 0-71 are configured automatically // NA-US and AU channels 0-71 are configured automatically
// but only one group of 8 should (a subband) should be active // but only one group of 8 should (a subband) should be active
// TTN recommends the second sub band, 1 in a zero based count. // TTN recommends the second sub band, 1 in a zero based count.
// https://github.com/TheThingsNetwork/gateway-conf/blob/master/US-global_conf.json // https://github.com/TheThingsNetwork/gateway-conf/blob/master/US-global_conf.json

View File

@ -495,10 +495,9 @@ uint8_t myBattLevelCb(void *pUserData) {
#elif defined HAS_IP5306 #elif defined HAS_IP5306
if (IP5306_GetPowerSource()) if (IP5306_GetPowerSource())
return MCMD_DEVS_EXT_POWER; return MCMD_DEVS_EXT_POWER;
#else
return (batt_percent / 100.0 *
(MCMD_DEVS_BATT_MAX - MCMD_DEVS_BATT_MIN + 1));
#endif // HAS_PMU #endif // HAS_PMU
return (batt_percent / 100.0 * (MCMD_DEVS_BATT_MAX - MCMD_DEVS_BATT_MIN + 1));
} }
// event EV_RXCOMPLETE message handler // event EV_RXCOMPLETE message handler
@ -582,7 +581,8 @@ const char *getCrName(rps_t rps) {
#if (VERBOSE) #if (VERBOSE)
// decode LORAWAN MAC message // decode LORAWAN MAC message
// see https://github.com/mcci-catena/arduino-lmic/blob/master/doc/LoRaWAN-at-a-glance.pdf // see
// https://github.com/mcci-catena/arduino-lmic/blob/master/doc/LoRaWAN-at-a-glance.pdf
void mac_decode(const uint8_t cmd[], const uint8_t cmdlen, bool is_down) { void mac_decode(const uint8_t cmd[], const uint8_t cmdlen, bool is_down) {
if (!cmdlen) if (!cmdlen)

View File

@ -116,7 +116,7 @@ uint16_t mac_add(uint8_t *paddr, int8_t rssi, bool sniff_type) {
} // added } // added
// Log scan result // Log scan result
ESP_LOGD(TAG, ESP_LOGV(TAG,
"%s %s RSSI %ddBi -> salted MAC %s -> Hash %04X -> WiFi:%d " "%s %s RSSI %ddBi -> salted MAC %s -> Hash %04X -> WiFi:%d "
"BLTH:%d " "BLTH:%d "
#if (COUNT_ENS) #if (COUNT_ENS)

View File

@ -2,8 +2,8 @@
//////////////////////// ESP32-Paxcounter \\\\\\\\\\\\\\\\\\\\\\\\\\ //////////////////////// ESP32-Paxcounter \\\\\\\\\\\\\\\\\\\\\\\\\\
Copyright 2018 Oliver Brandmueller <ob@sysadm.in> Copyright 2018-2020 Oliver Brandmueller <ob@sysadm.in>
Copyright 2018 Klaus Wilting <verkehrsrot@arcor.de> Copyright 2018-2020 Klaus Wilting <verkehrsrot@arcor.de>
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@ -56,10 +56,11 @@ void SendPayload(uint8_t port, sendprio_t prio) {
// write data to sdcard, if present // write data to sdcard, if present
#if (HAS_SDCARD) #if (HAS_SDCARD)
if ( port == COUNTERPORT ) { if (port == COUNTERPORT) {
sdcardWriteData(macs_wifi, macs_ble sdcardWriteData(macs_wifi, macs_ble
#if (COUNT_ENS) #if (COUNT_ENS)
, cwa_report() ,
cwa_report()
#endif #endif
); );
} }
@ -86,7 +87,6 @@ void sendData() {
case COUNT_DATA: case COUNT_DATA:
payload.reset(); payload.reset();
#if !(PAYLOAD_OPENSENSEBOX) #if !(PAYLOAD_OPENSENSEBOX)
if (cfg.wifiscan)
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);
@ -102,7 +102,6 @@ void sendData() {
} }
#endif #endif
#if (PAYLOAD_OPENSENSEBOX) #if (PAYLOAD_OPENSENSEBOX)
if (cfg.wifiscan)
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);

View File

@ -54,9 +54,10 @@ uint8_t *sensor_read(uint8_t sensor) {
case 1: case 1:
// insert user specific sensor data frames here */ // insert user specific sensor data frames here
// note: Sensor1 fields are used for ENS count, if ENS detection enabled
#if (COUNT_ENS) #if (COUNT_ENS)
payload.addCount( cwa_report(), MAC_SNIFF_BLE_CWA); payload.addCount(cwa_report(), MAC_SNIFF_BLE_CWA);
#else #else
buf[0] = length; buf[0] = length;
buf[1] = 0x01; buf[1] = 0x01;

View File

@ -35,8 +35,10 @@ void calibrateTime(void) {
timesync_request(); timesync_request();
#endif #endif
// (only!) if we lost time, we try to fallback to local time source RTS or GPS // if no LORA timesource is available, or if we lost time, then fallback to
if (timeSource == _unsynced) { // local time source RTS or GPS
if (((!TIME_SYNC_LORASERVER) && (!TIME_SYNC_LORAWAN)) ||
(timeSource == _unsynced)) {
// has RTC -> fallback to RTC time // has RTC -> fallback to RTC time
#ifdef HAS_RTC #ifdef HAS_RTC
@ -50,7 +52,6 @@ void calibrateTime(void) {
timeSource = _gps; timeSource = _gps;
#endif #endif
if (t)
setMyTime((uint32_t)t, t_msec, timeSource); // set time setMyTime((uint32_t)t, t_msec, timeSource); // set time
} // fallback } // fallback