From 5ae8f47b9d60d4134d1e6a3288069d2b3a8efff8 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Tue, 24 Jul 2018 23:25:41 +0200 Subject: [PATCH] testing --- README.md | 2 +- platformio.ini | 12 ++++++------ src/homecycle.cpp | 5 +++++ src/macsniff.cpp | 6 ++++-- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index fe8baef7..20302bd5 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ Paxcounter generates identifiers for sniffed MAC adresses and collects them temp - Quick blink (20ms on each 1/5 second): joining LoRaWAN network in progress or pending - Small blink (10ms on each 1/2 second): LoRaWAN data transmit in progress or pending - Long blink (200ms on each 2 seconds): LoRaWAN stack error -- Single long flash (2ec): Known beacon detected +- Single long flash (2sec): Known beacon detected **RGB LED:** diff --git a/platformio.ini b/platformio.ini index 8fddb568..b1239b62 100644 --- a/platformio.ini +++ b/platformio.ini @@ -12,11 +12,11 @@ ; ---> SELECT TARGET PLATFORM HERE! <--- [platformio] ;env_default = generic -;env_default = heltec +env_default = heltec ;env_default = ttgov1 ;env_default = ttgov2 ;env_default = ttgov21 -env_default = ttgobeam +;env_default = ttgobeam ;env_default = lopy ;env_default = lopy4 ;env_default = fipy @@ -27,8 +27,8 @@ env_default = ttgobeam description = Paxcounter is a proof-of-concept ESP32 device for metering passenger flows in realtime. It counts how many mobile devices are around. [common_env_data] -;platform_espressif32 = espressif32@1.0.2 -platform_espressif32 = espressif32@1.1.2 +platform_espressif32 = espressif32@1.0.2 +;platform_espressif32 = espressif32@1.1.2 ;platform_espressif32 = https://github.com/platformio/platform-espressif32.git#feature/stage board_build.partitions = no_ota.csv lib_deps_all = @@ -45,8 +45,8 @@ build_flags = ; otherwise device may crash in dense environments due to serial buffer overflow ; ; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_NONE - -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_INFO -; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG +; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_INFO + -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG ; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE ; ; override lora settings from LMiC library in lmic/config.h and use main.h instead diff --git a/src/homecycle.cpp b/src/homecycle.cpp index 0ee1bd1e..370bf034 100644 --- a/src/homecycle.cpp +++ b/src/homecycle.cpp @@ -10,6 +10,8 @@ static const char TAG[] = "main"; // do all housekeeping void doHomework() { + static uint64_t uptimecounter; + // read battery voltage into global variable #ifdef HAS_BATTERY_PROBE batt_voltage = read_voltage(); @@ -37,6 +39,9 @@ void doHomework() { reset_counters(); // clear macs container and reset all counters reset_salt(); // get new salt for salting hashes } + + // update uptime counter + uptimecounter = uptime(); } void checkHousekeeping() { diff --git a/src/macsniff.cpp b/src/macsniff.cpp index 0a997285..c88d9f38 100644 --- a/src/macsniff.cpp +++ b/src/macsniff.cpp @@ -12,15 +12,16 @@ // Local logging tag static const char TAG[] = "wifi"; +/* static wifi_country_t wifi_country = {WIFI_MY_COUNTRY, WIFI_CHANNEL_MIN, WIFI_CHANNEL_MAX, 0, WIFI_COUNTRY_POLICY_MANUAL}; +*/ + -/* static wifi_country_t wifi_country = {WIFI_MY_COUNTRY, WIFI_CHANNEL_MIN, WIFI_CHANNEL_MAX, WIFI_COUNTRY_POLICY_MANUAL}; -*/ // globals uint16_t salt; @@ -95,6 +96,7 @@ bool mac_add(uint8_t *paddr, int8_t rssi, bool sniff_type) { if (cfg.monitormode) { beaconID = isBeacon(addr2int); if (beaconID) { + ESP_LOGI(TAG, "Beacon ID#%d detected", beaconID); #if (HAS_LED != NOT_A_PIN) || defined(HAS_RGB_LED) blink_LED(COLOR_WHITE, 2000); #endif