Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Wi-Fi Modes Control Command #12292

Merged
merged 6 commits into from
Jun 4, 2021
Merged

Conversation

ascillato
Copy link
Contributor

@ascillato ascillato commented Jun 4, 2021

Description:

Tasmota in a BLANK device, supports by default all the Wi-Fi modes available in the ESP8266 that are IEEE 802.11b/g/n.
But, if the device is not blank or comes from another firmware, sometimes the supported modes are restricted like having only 11b or 11b/g. Tasmota don't force the full support. That is why, this PR adds new options for the command WIFI to FORCE which modes are going to be used.

The WIFI command now have the following options with this PR:

0 - Turn Off Wi-Fi
1 - Turn On Wi-Fi
2 - Force the device to ONLY connects as a 11b device
3 - Force the device to ONLY connects as a 11b/g device
4 - Force the device to connects as a 11b/g/n device

When changing modes, the device disconnects and reconnects to the router without restarting. Because of that, sometimes you need to refresh your browser.

image

(REMEMBER that if your router don't support 11b, or is configured to not support 11b and you force 11b, your device won't connect. In the serial console you see AP TIMEOUT no matter if the SSId and Password are Ok)

Besides that, with this PR, it has been added to show the actual mode in STATUS 11, in the response of the WIFI command and in the INFORMATION menu of the WebUI, for user troubleshooting. Also this PR have some code cleaning.

image

Forcing modes is useful to troubleshoot and solve issues like:

  • A device that had another firmware before,
  • A device that is far from a router (sometimes forcing 11b gives more range <- this depends on the router due to new routers have wide and better range on 11n),
  • If in the users' network, there is a very old device that only supports 11b, sometimes old or cheap routers can't manage correctly different devices in different modes and put the entire network on 11b. With this, you can force to use 11n in Tasmota and find which device is lowering the performance in the network,
  • If a new device can't connect and from the serial interface it is being showed AP TIMEOUT, it can be checked now which modes are supported in the Tasmotized device to match the Router's.

In the AP mode, the ESP8266 supports only b/g modes.

These code changes were tested too on ESP32 and works fine. The ESP32 have all mode enabled by default, so this PR don't provide the new options of the WIFI command for ESP32. It just provide showing the actual mode.

The ESP32 supports b/g/n/LR on both AP and STA modes. The LR mode (Long Range-Low Rate of 1km) is not supported in Tasmota ATM and can not be used.

Related issue (if applicable): NA

Proposed changes to the docs: tasmota/docs#751

Checklist:

  • The pull request is done against the latest development branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • The code change is tested and works on Tasmota core ESP8266 V.2.7.4.9
  • The code change is tested and works with core ESP32 V.1.0.6
  • I accept the CLA.

NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass

Actual Options:
0 - Turn Off Wi-Fi
1 - Turn On Wi-Fi
New Options Added:
2 - Force the device to ONLY connects as a 11b device
3 - Force the device to ONLY connects as a 11b/g device
4 - Force the device to connects as a 11b/g/n device
@Jason2866
Copy link
Collaborator

@ascillato i think this discussion is from interest for you, and i think you can give feedback esp8266/Arduino#7965

@arendst arendst merged commit 0ab7337 into arendst:development Jun 4, 2021
@ascillato ascillato deleted the Wi-Fi_Modes branch June 4, 2021 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants