Option to switch off wifi sniffing

This commit is contained in:
Verkehrsrot 2019-04-13 17:39:08 +02:00
parent ae0ffe2273
commit 77e795dbf8
2 changed files with 17 additions and 6 deletions

View File

@ -346,9 +346,8 @@ void setup() {
strcat_P(features, " IF482"); strcat_P(features, " IF482");
#endif #endif
// show compiled features #if (WIFICOUNTER)
ESP_LOGI(TAG, "Features:%s", features); strcat_P(features, " WIFI");
// start wifi in monitor mode and start channel rotation timer // start wifi in monitor mode and start channel rotation timer
ESP_LOGI(TAG, "Starting Wifi..."); ESP_LOGI(TAG, "Starting Wifi...");
wifi_sniffer_init(); wifi_sniffer_init();
@ -356,6 +355,15 @@ void setup() {
// arduino-esp32 core. Note: do this *after* wifi has started, since // arduino-esp32 core. Note: do this *after* wifi has started, since
// function gets it's seed from RF noise // function gets it's seed from RF noise
get_salt(); // get new 16bit for salting hashes get_salt(); // get new 16bit for salting hashes
#else
// switch off wifi
WiFi.mode(WIFI_OFF);
esp_wifi_stop();
esp_wifi_deinit();
#endif
// show compiled features
ESP_LOGI(TAG, "Features:%s", features);
// start state machine // start state machine
ESP_LOGI(TAG, "Starting Interrupt Handler..."); ESP_LOGI(TAG, "Starting Interrupt Handler...");
@ -400,8 +408,10 @@ void setup() {
timerAlarmEnable(displayIRQ); timerAlarmEnable(displayIRQ);
#endif #endif
// cyclic function interrupts // cyclic function interrupts
#if (WIFICOUNTER) || (BLECOUNTER)
sendcycler.attach(SENDCYCLE * 2, sendcycle); sendcycler.attach(SENDCYCLE * 2, sendcycle);
#endif
housekeeper.attach(HOMECYCLE, housekeeping); housekeeper.attach(HOMECYCLE, housekeeping);
// button interrupt // button interrupt

View File

@ -13,9 +13,10 @@
#define SENDCYCLE 30 // payload send cycle [seconds/2], 0 .. 255 #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 PAYLOAD_ENCODER 2 // payload encoder: 1=Plain, 2=Packed, 3=Cayenne LPP dynamic, 4=Cayenne LPP packed
// Set this to include BLE counting and vendor filter functions // 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 #define VENDORFILTER 1 // set to 0 if you want to count things, not people
#define BLECOUNTER 0 // set it to 1 if you want to use BLE count, at expense of memory #define BLECOUNTER 0 // set it to 1 if you want to use BLE count, at expense of power & memory
#define WIFICOUNTER 0 // set it to 0 if you want to switch off WIFI count
// BLE scan parameters // BLE scan parameters
#define BLESCANTIME 0 // [seconds] scan duration, 0 means infinite [default], see note below #define BLESCANTIME 0 // [seconds] scan duration, 0 means infinite [default], see note below