[PR #1470] [MERGED] Use esp_wifi_set_country_code for ESP32 #1761

Closed
opened 2026-02-28 02:12:54 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/tzapu/WiFiManager/pull/1470
Author: @thorrak
Created: 8/9/2022
Status: Merged
Merged: 8/9/2022
Merged by: @tablatronix

Base: masterHead: setcountry-patch


📝 Commits (1)

  • 18de66b Use esp_wifi_set_country_code for ESP32

📊 Changes

1 file changed (+10 additions, -7 deletions)

View changed files

📝 WiFiManager.cpp (+10 -7)

📄 Description

This pull request replaces the use of esp_wifi_set_country() with esp_wifi_set_country_code() for ESP32 in order to both solve a crash under Arduino 2.x and remove the requirement to independently maintain country-specific channel settings. In testing on my end, this solves the crash seen in #1309 .

One thing of note - I think that esp_wifi_set_country_code() was only added with the later versions of esp-idf added when Arduino 2.x was released -- I'm not sure if you intend to continue to support the earlier framework, but if you do then some conditional compilation logic may be needed here.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/tzapu/WiFiManager/pull/1470 **Author:** [@thorrak](https://github.com/thorrak) **Created:** 8/9/2022 **Status:** ✅ Merged **Merged:** 8/9/2022 **Merged by:** [@tablatronix](https://github.com/tablatronix) **Base:** `master` ← **Head:** `setcountry-patch` --- ### 📝 Commits (1) - [`18de66b`](https://github.com/tzapu/WiFiManager/commit/18de66b8becdeec53b122174d19fb6c2e4874901) Use esp_wifi_set_country_code for ESP32 ### 📊 Changes **1 file changed** (+10 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `WiFiManager.cpp` (+10 -7) </details> ### 📄 Description This pull request replaces the use of `esp_wifi_set_country()` with `esp_wifi_set_country_code()` for ESP32 in order to both solve a crash under Arduino 2.x and remove the requirement to independently maintain country-specific channel settings. In testing on my end, this solves the crash seen in #1309 . One thing of note - I think that `esp_wifi_set_country_code()` was only added with the later versions of esp-idf added when Arduino 2.x was released -- I'm not sure if you intend to continue to support the earlier framework, but if you do then some conditional compilation logic may be needed here. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 02:12:54 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#1761
No description provided.