Skip to content

Commit

Permalink
Merge pull request #62 from qmsk/esp-idf-4.4.6
Browse files Browse the repository at this point in the history
esp32: upgrade esp-idf 4.4.6
  • Loading branch information
SpComb authored Nov 19, 2023
2 parents 7bcc4e7 + c4de848 commit 5f730bd
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

env:
NODE_VERSION: 15.x
ESP_IDF_VERSION: v4.4
ESP_IDF_VERSION: v4.4.6
ESP8266_RTOS_SDK_VERSION: v3.4

jobs:
Expand Down
4 changes: 4 additions & 0 deletions components/system/include/system_wifi.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ const char *wifi_mode_str(wifi_mode_t mode);
const char *wifi_auth_mode_str(wifi_auth_mode_t auth_mode);
const char *wifi_cipher_type_str(wifi_cipher_type_t cipher_type);
const char *wifi_err_reason_str(wifi_err_reason_t reason);

#if !CONFIG_IDF_TARGET_ESP8266
const char *wifi_phy_mode_str(wifi_phy_mode_t phymode);
#endif
17 changes: 16 additions & 1 deletion components/system/wifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const char *wifi_auth_mode_str(wifi_auth_mode_t auth_mode) {
case WIFI_AUTH_WPA2_WPA3_PSK: return "WPA2/3-PSK";
#if CONFIG_IDF_TARGET_ESP32
case WIFI_AUTH_WAPI_PSK: return "WPAI-PSK";
#endif
#endif
default: return "?";
}
}
Expand Down Expand Up @@ -101,3 +101,18 @@ const char *wifi_err_reason_str(wifi_err_reason_t reason) {
default: return "?";
}
}

#if !CONFIG_IDF_TARGET_ESP8266
const char *wifi_phy_mode_str(wifi_phy_mode_t phymode)
{
switch (phymode) {
case WIFI_PHY_MODE_LR: return "LR";
case WIFI_PHY_MODE_11B: return "11B";
case WIFI_PHY_MODE_11G: return "11G";
case WIFI_PHY_MODE_HT20: return "HT20";
case WIFI_PHY_MODE_HT40: return "HT40";
case WIFI_PHY_MODE_HE20: return "HE20";
default: return "?";
}
}
#endif
10 changes: 10 additions & 0 deletions main/wifi_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ static int print_wifi_info_sta()
);
}

#if !CONFIG_IDF_TARGET_ESP8266
wifi_phy_mode_t phymode = -1;

if ((err = esp_wifi_sta_get_negotiated_phymode(&phymode))) {
LOG_WARN("esp_wifi_sta_get_negotiated_phymode: %s", esp_err_to_name(err));
} else {
printf("\t\t%-20s: %s\n", "PHY Mode", wifi_phy_mode_str(phymode));
}
#endif

return 0;
}

Expand Down
23 changes: 22 additions & 1 deletion main/wifi_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,31 @@ static void on_sta_stop()

static void on_sta_connected(wifi_event_sta_connected_t *event)
{
LOG_INFO("ssid=%.32s bssid=%02x:%02x:%02x:%02x:%02x:%02x channel=%u authmode=%s",
#if !CONFIG_IDF_TARGET_ESP8266
int rssi = 0;
wifi_phy_mode_t phymode = -1;
esp_err_t err;

if ((err = esp_wifi_sta_get_rssi(&rssi))) {

}

if ((err = esp_wifi_sta_get_negotiated_phymode(&phymode))) {

}
#endif

LOG_INFO("ssid=%.32s bssid=%02x:%02x:%02x:%02x:%02x:%02x channel=%u rssi=%d phymode=%s authmode=%s",
event->ssid,
event->bssid[0], event->bssid[1], event->bssid[2], event->bssid[3], event->bssid[4], event->bssid[5],
event->channel,
#if CONFIG_IDF_TARGET_ESP8266
0,
"?",
#else
rssi,
wifi_phy_mode_str(phymode),
#endif
wifi_auth_mode_str(event->authmode)
);

Expand Down
3 changes: 2 additions & 1 deletion projects/esp32/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ services:
build:
context: ../../sdk/esp-idf
args:
ESP_IDF_VERSION: v4.4.4
# also update .github/workflows/build.yml `ESP_IDF_VERSION`
ESP_IDF_VERSION: v4.4.6
BUILD_UID: ${BUILD_UID}
BUILD_GID: ${BUILD_GID}
command: idf.py --version
Expand Down

0 comments on commit 5f730bd

Please sign in to comment.