v1.3.97 @ Espressif 1.2.0

This commit is contained in:
Klaus K Wilting 2018-08-01 08:53:05 +02:00
parent 4a6449f363
commit ec81293a38
5 changed files with 18 additions and 21 deletions

View File

@ -12,8 +12,8 @@
; ---> SELECT TARGET PLATFORM HERE! <--- ; ---> SELECT TARGET PLATFORM HERE! <---
[platformio] [platformio]
;env_default = test ;env_default = test
env_default = generic ;env_default = generic
;env_default = heltec env_default = heltec
;env_default = ttgov1 ;env_default = ttgov1
;env_default = ttgov2 ;env_default = ttgov2
;env_default = ttgov21 ;env_default = ttgov21

View File

@ -8,7 +8,7 @@
#include <esp32-hal-log.h> #include <esp32-hal-log.h>
// attn: increment version after modifications to configData_t truct! // attn: increment version after modifications to configData_t truct!
#define PROGVERSION "1.3.96" // use max 10 chars here! #define PROGVERSION "1.3.97" // use max 10 chars here!
#define PROGNAME "PAXCNT" #define PROGNAME "PAXCNT"
// std::set for unified array functions // std::set for unified array functions

View File

@ -15,6 +15,9 @@
#define HAS_LED GPIO_NUM_21 // on board LED #define HAS_LED GPIO_NUM_21 // on board LED
#define HAS_BUTTON GPIO_NUM_39 // on board button #define HAS_BUTTON GPIO_NUM_39 // on board button
#define HAS_RGB_LED GPIO_NUM_0 // WS2812B RGB LED on GPIO0
#define BOARD_HAS_PSRAM // use extra 4MB extern RAM
#define HAS_GPS 1 // use if board has GPS #define HAS_GPS 1 // use if board has GPS
#define GPS_SERIAL 9600, SERIAL_8N1, GPIO_NUM_12, GPIO_NUM_15 // UBlox NEO 6M or 7M with default configuration #define GPS_SERIAL 9600, SERIAL_8N1, GPIO_NUM_12, GPIO_NUM_15 // UBlox NEO 6M or 7M with default configuration

View File

@ -18,13 +18,11 @@ IRAM_ATTR void wifi_sniffer_packet_handler(void *buff,
const wifi_ieee80211_mac_hdr_t *hdr = &ipkt->hdr; const wifi_ieee80211_mac_hdr_t *hdr = &ipkt->hdr;
if ((cfg.rssilimit) && if ((cfg.rssilimit) &&
(ppkt->rx_ctrl.rssi < cfg.rssilimit)) { // rssi is negative value (ppkt->rx_ctrl.rssi < cfg.rssilimit)) // rssi is negative value
ESP_LOGI(TAG, "WiFi RSSI %d -> ignoring (limit: %d)", ppkt->rx_ctrl.rssi, ESP_LOGD(TAG, "WiFi RSSI %d -> ignoring (limit: %d)", ppkt->rx_ctrl.rssi,
cfg.rssilimit); cfg.rssilimit);
} else { else // count seen MAC
uint8_t *p = (uint8_t *)hdr->addr2; mac_add((uint8_t *)hdr->addr2, ppkt->rx_ctrl.rssi, MAC_SNIFF_WIFI);
mac_add(p, ppkt->rx_ctrl.rssi, MAC_SNIFF_WIFI);
}
} }
void wifi_sniffer_init(void) { void wifi_sniffer_init(void) {
@ -44,16 +42,6 @@ void wifi_sniffer_init(void) {
ESP_ERROR_CHECK(esp_wifi_set_promiscuous(true)); // now switch on monitor mode ESP_ERROR_CHECK(esp_wifi_set_promiscuous(true)); // now switch on monitor mode
} }
void wifi_sniffer_set_channel(uint8_t channel) {
esp_wifi_set_channel(channel, WIFI_SECOND_CHAN_NONE);
}
void IRAM_ATTR ChannelSwitchIRQ() {
portENTER_CRITICAL(&timerMux);
ChannelTimerIRQ++;
portEXIT_CRITICAL(&timerMux);
}
// Wifi channel rotation task // Wifi channel rotation task
void wifi_channel_loop(void *pvParameters) { void wifi_channel_loop(void *pvParameters) {
@ -67,11 +55,18 @@ void wifi_channel_loop(void *pvParameters) {
portEXIT_CRITICAL(&timerMux); portEXIT_CRITICAL(&timerMux);
// rotates variable channel 1..WIFI_CHANNEL_MAX // rotates variable channel 1..WIFI_CHANNEL_MAX
channel = (channel % WIFI_CHANNEL_MAX) + 1; channel = (channel % WIFI_CHANNEL_MAX) + 1;
wifi_sniffer_set_channel(channel); esp_wifi_set_channel(channel, WIFI_SECOND_CHAN_NONE);
ESP_LOGD(TAG, "Wifi set channel %d", channel); ESP_LOGD(TAG, "Wifi set channel %d", channel);
vTaskDelay(1 / portTICK_PERIOD_MS); // reset watchdog vTaskDelay(1 / portTICK_PERIOD_MS); // reset watchdog
} }
} // end of infinite wifi channel rotation loop } // end of infinite wifi channel rotation loop
}
// IRQ handler
void IRAM_ATTR ChannelSwitchIRQ() {
portENTER_CRITICAL(&timerMux);
ChannelTimerIRQ++;
portEXIT_CRITICAL(&timerMux);
} }

View File

@ -26,7 +26,6 @@ typedef struct {
} wifi_ieee80211_packet_t; } wifi_ieee80211_packet_t;
void wifi_sniffer_init(void); void wifi_sniffer_init(void);
void wifi_sniffer_set_channel(uint8_t channel);
void wifi_sniffer_packet_handler(void *buff, wifi_promiscuous_pkt_type_t type); void wifi_sniffer_packet_handler(void *buff, wifi_promiscuous_pkt_type_t type);
void ChannelSwitchIRQ(void); void ChannelSwitchIRQ(void);
void wifi_channel_loop(void *pvParameters); void wifi_channel_loop(void *pvParameters);