esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 36 forks source link

Multiple wi-fi networks change doesn't work #1616

Open Spirituss opened 4 years ago

Spirituss commented 4 years ago

Operating environment/Installation (Hass.io/Docker/pip/etc.):

Home Assistant Core/Docker

ESP (ESP32/ESP8266, Board/Sonoff):

Nodemcu, Blitzwolf plugs, Wemos D1 mini, ...

ESPHome version (latest production, beta, dev branch)

1.16.0-dev

Affected component:

https://esphome.io/components/wifi.html?highlight=priority#wifi-networks

Description of problem: Multiple wi-fi networks were defined in the firmware, all with different priority tags. In case the highest priority network in not available, ESP doesn't change the network to the next one with lower priority. ESP remains unavailable for HA, blinking by status led, which tells that there is no wi-fi connection.

Problem-relevant YAML-configuration entries:

wifi:  
  reboot_timeout: 0s      
  output_power: 17.5dB    
  networks:  
    - ssid: !secret wifi_ssid_1
      password: !secret wifi_pass_1
      hidden: true
      priority: 2.0   
    - ssid: !secret wifi_ssid_2
      password: !secret wifi_pass_2 
      hidden: true
      priority: 1.0      
    - ssid: !secret wifi_ssid_3
      password: !secret wifi_pass_3
      hidden: true
      priority: 0.0  

Logs (if applicable):

No log available since there is no connection to ESP at that moment.

Additional information and things you've tried:

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Spirituss commented 3 years ago

The problem still is actual. Such a configuration as above mentioned DOES'T work while should be according to esphome.io offsite.

randybb commented 3 years ago

enable SSID broadcasting and it will work

Spirituss commented 3 years ago

enable SSID broadcasting and it will work

The issue is that the configuration above mentioned doesn't works, while works fine with bssid filter. But offsite tells that bssid is the OPTIONAL additional filter. Either documentation should be updated or system behaviour be changed. Moreover, "hidden" option doesn't matter for this problem. Additionally, even if you use bssid filter, sometimes esp changes wi-fi networks, switching to one with lower priority, but then loses due to poor signal and doesn't switch back to higher priority network.

Spirituss commented 3 years ago

I have tested and found that in case bssid broadcasting is used the priority works incorrectly. In case the highest priority bssid network becomes unavailable, esphome switches to the lower priority network. But it doesn't switch back to the higher bssid network when is becomes available again.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

WizBangCrash commented 3 years ago

I'm having similar issues when using hidden networks. The priority setting seems to be ignored and the device always connects to the first network in the list. If I make the networks visible then the priority setting works as expected.

I'm running 2021.9.3 and have tried it on a variety of different devices; sonoff basic, sonoff, sv, gosund sp111, moes lightswitch & nodemcu dev boards. All with the same issue.