parent
							
								
									978df41691
								
							
						
					
					
						commit
						7ba8b8f985
					
				| @ -108,9 +108,9 @@ extern std::array<uint64_t, 0xff> beacons; | ||||
| 
 | ||||
| extern configData_t cfg;                      // current device configuration
 | ||||
| extern char display_line6[], display_line7[]; // screen buffers
 | ||||
| extern uint8_t volatile channel;              // wifi channel rotation counter
 | ||||
| extern uint16_t volatile macs_total, macs_wifi, macs_ble, | ||||
|     batt_voltage;                   // display values
 | ||||
| extern uint32_t volatile PacketCounter; // sniffed packet counter
 | ||||
| extern bool volatile TimePulseTick; // 1sec pps flag set by GPS or RTC
 | ||||
| extern timesource_t timeSource; | ||||
| extern hw_timer_t *displayIRQ, *matrixDisplayIRQ, *ppsIRQ, *gpsIRQ; | ||||
|  | ||||
| @ -11,13 +11,12 @@ Display-Mask (128 x 64 pixel): | ||||
| 1|PAX:aabbccddee | ||||
| 2|B:a.bcV  Sats:ab | ||||
| 3|BLTH:abcde SF:ab | ||||
| 4|WIFI:abcde  **** | ||||
| 4|WIFI:abcde ch:ab | ||||
| 5|RLIM:abcd abcdKB | ||||
| 6|xxxxxxxxxxxxxxxx | ||||
| 6|20:27:00* 27.Feb | ||||
| 7|yyyyyyyyyyyyyyab | ||||
|    | ||||
| line 4: **** = Packet traffic indicator | ||||
| line 6: x = Text for LORA status OR time/date | ||||
| line 7: y = Text for LMIC status; ab = payload queue | ||||
| 
 | ||||
| @ -225,22 +224,11 @@ void draw_page(time_t t, uint8_t page) { | ||||
|       u8x8.setInverseFont(0); | ||||
| #endif // HAS_LORA
 | ||||
| 
 | ||||
|     // line 4: update wifi counter + packet density display
 | ||||
|     // line 4: update wifi counter + channel display
 | ||||
|     u8x8.setCursor(0, 4); | ||||
|     u8x8.printf("WIFI:%-5d", macs_wifi); | ||||
|     // display and reset packetcounter
 | ||||
|     u8x8.setCursor(12, 4); | ||||
|     if (PacketCounter > (100000 / DISPLAYREFRESH_MS)) | ||||
|       u8x8.printf("****"); | ||||
|     else if (PacketCounter > (10000 / DISPLAYREFRESH_MS)) | ||||
|       u8x8.printf(" ***"); | ||||
|     else if (PacketCounter > (1000 / DISPLAYREFRESH_MS)) | ||||
|       u8x8.printf("  **"); | ||||
|     else if (PacketCounter > 0) | ||||
|       u8x8.printf("   *"); | ||||
|     else | ||||
|       u8x8.printf("    "); | ||||
|     PacketCounter = 0; | ||||
|     u8x8.setCursor(11, 4); | ||||
|     u8x8.printf("ch:%02d", channel); | ||||
| 
 | ||||
|     // line 5: update RSSI limiter status & free memory display
 | ||||
|     u8x8.setCursor(0, 5); | ||||
|  | ||||
| @ -81,9 +81,9 @@ triggers pps 1 sec impulse | ||||
| 
 | ||||
| configData_t cfg; // struct holds current device configuration
 | ||||
| char display_line6[16], display_line7[16]; // display buffers
 | ||||
| uint8_t volatile channel = 0;              // channel rotation counter
 | ||||
| uint16_t volatile macs_total = 0, macs_wifi = 0, macs_ble = 0, | ||||
|                   batt_voltage = 0; // globals for display
 | ||||
| uint32_t volatile PacketCounter = 0; // sniffed packet counter
 | ||||
| 
 | ||||
| hw_timer_t *ppsIRQ = NULL, *displayIRQ = NULL, *matrixDisplayIRQ = NULL, | ||||
|            *gpsIRQ = NULL; | ||||
|  | ||||
| @ -37,8 +37,6 @@ IRAM_ATTR void wifi_sniffer_packet_handler(void *buff, | ||||
|       (wifi_ieee80211_packet_t *)ppkt->payload; | ||||
|   const wifi_ieee80211_mac_hdr_t *hdr = &ipkt->hdr; | ||||
| 
 | ||||
|   PacketCounter++; // increase packets per second counter
 | ||||
| 
 | ||||
|   if ((cfg.rssilimit) && | ||||
|       (ppkt->rx_ctrl.rssi < cfg.rssilimit)) // rssi is negative value
 | ||||
|     ESP_LOGD(TAG, "WiFi RSSI %d -> ignoring (limit: %d)", ppkt->rx_ctrl.rssi, | ||||
| @ -47,9 +45,8 @@ IRAM_ATTR void wifi_sniffer_packet_handler(void *buff, | ||||
|     mac_add((uint8_t *)hdr->addr2, ppkt->rx_ctrl.rssi, MAC_SNIFF_WIFI); | ||||
| } | ||||
| 
 | ||||
| // Software-timer driven Wifi channel rotation function
 | ||||
| // Software-timer driven Wifi channel rotation callback function
 | ||||
| void switchWifiChannel(TimerHandle_t xTimer) { | ||||
|   static uint8_t channel = 0; // channel rotation counter
 | ||||
|   channel = | ||||
|       (channel % WIFI_CHANNEL_MAX) + 1; // rotate channel 1..WIFI_CHANNEL_MAX
 | ||||
|   esp_wifi_set_channel(channel, WIFI_SECOND_CHAN_NONE); | ||||
| @ -60,13 +57,13 @@ void wifi_sniffer_init(void) { | ||||
|   wificfg.nvs_enable = 0;        // we don't need any wifi settings from NVRAM
 | ||||
|   wificfg.wifi_task_core_id = 0; // we want wifi task running on core 0
 | ||||
| 
 | ||||
|   wifi_promiscuous_filter_t filter = { | ||||
|       .filter_mask = WIFI_PROMIS_FILTER_MASK_MGMT}; // only MGMT frames
 | ||||
|   // wifi_promiscuous_filter_t filter = {
 | ||||
|   // .filter_mask = WIFI_PROMIS_FILTER_MASK_MGMT}; // only MGMT frames
 | ||||
|   // .filter_mask = WIFI_PROMIS_FILTER_MASK_ALL}; // we use all frames
 | ||||
| 
 | ||||
|   // wifi_promiscuous_filter_t filter = {.filter_mask =
 | ||||
|   //                                        WIFI_PROMIS_FILTER_MASK_MGMT |
 | ||||
|   //                                        WIFI_PROMIS_FILTER_MASK_DATA};
 | ||||
|   wifi_promiscuous_filter_t filter = {.filter_mask = | ||||
|                                           WIFI_PROMIS_FILTER_MASK_MGMT | | ||||
|                                           WIFI_PROMIS_FILTER_MASK_DATA}; | ||||
| 
 | ||||
|   ESP_ERROR_CHECK(esp_wifi_init(&wificfg)); // configure Wifi with cfg
 | ||||
|   ESP_ERROR_CHECK( | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user