From 32628431415fbf8e427bcadd86cbb4ff4743a0a1 Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Mon, 16 Sep 2019 18:16:53 +0200 Subject: [PATCH 1/3] main.cpp add comment for PMU IRQ --- src/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.cpp b/src/main.cpp index 2937f793..8c5a9b93 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -58,6 +58,7 @@ fired by hardware DisplayIRQ -> esp32 timer 0 -> irqHandlerTask (Core 1) CLOCKIRQ -> esp32 timer 1 -> ClockTask (Core 1) ButtonIRQ -> external gpio -> irqHandlerTask (Core 1) +PMUIRQ -> PMU chip gpio -> irqHandlerTask (Core 1) fired by software (Ticker.h) TIMESYNC_IRQ -> timeSync() -> irqHandlerTask (Core 1) From 3250a27e83bd97a65e5693d5237faf7b52e64c42 Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Tue, 17 Sep 2019 14:32:22 +0200 Subject: [PATCH 2/3] LMIC task priority raised 2 -> 5 --- src/lorawan.cpp | 2 +- src/main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lorawan.cpp b/src/lorawan.cpp index 1e8c641f..5d8359d5 100644 --- a/src/lorawan.cpp +++ b/src/lorawan.cpp @@ -437,7 +437,7 @@ esp_err_t lora_stack_init() { "lmictask", // name of task 4096, // stack size of task (void *)1, // parameter of the task - 2, // priority of the task + 5, // priority of the task &lmicTask, // task handle 1); // CPU core diff --git a/src/main.cpp b/src/main.cpp index 8c5a9b93..c6eb2867 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -31,9 +31,9 @@ ledloop 0 3 blinks LEDs spiloop 0 2 reads/writes data on spi interface IDLE 0 0 ESP32 arduino scheduler -> runs wifi sniffer +lmictask 1 5 MCCI LMiC LORAWAN stack clockloop 1 4 generates realtime telegrams for external clock timesync_req 1 3 processes realtime time sync requests -lmictask 1 2 MCCI LMiC LORAWAN stack irqhandler 1 1 display, timesync, gps, etc. triggered by timers gpsloop 1 1 reads data from GPS via serial or i2c lorasendtask 1 1 feed data from lora sendqueue to lmcic From b3d5a0bbf171e552c825519ec927e3fddf2358c7 Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Tue, 17 Sep 2019 14:34:48 +0200 Subject: [PATCH 3/3] esp_wifi_start() added (need for ESP v3.2.3) --- src/wifiscan.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wifiscan.cpp b/src/wifiscan.cpp index 3695508f..b22fe5f2 100644 --- a/src/wifiscan.cpp +++ b/src/wifiscan.cpp @@ -72,6 +72,7 @@ void wifi_sniffer_init(void) { esp_wifi_set_storage(WIFI_STORAGE_RAM)); // we don't need NVRAM ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_NULL)); ESP_ERROR_CHECK(esp_wifi_set_ps(WIFI_PS_NONE)); // no modem power saving + ESP_ERROR_CHECK(esp_wifi_start()); // must be started to be able to switch ch ESP_ERROR_CHECK(esp_wifi_set_promiscuous_filter(&filter)); // set frame filter ESP_ERROR_CHECK(esp_wifi_set_promiscuous_rx_cb(&wifi_sniffer_packet_handler)); ESP_ERROR_CHECK(esp_wifi_set_promiscuous(true)); // now switch on monitor mode