arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
22.02k stars 4.78k forks source link

Tasmota 6.2.1: When using cycling STA_SSID1/STA_SSID2 the MQTT STATE message reports first one only, not active one #3969

Closed ChristoSimeonoff closed 5 years ago

ChristoSimeonoff commented 5 years ago

Setting the user_config.h entries thus:

define STA_SSID1 "ssid1"

define STA_PASS1 "pass1"

define STA_SSID1 "ssid2"

define STA_PASS1 "pass2"

define WIFI_CONFIG_TOOL WIFI_RETRY

will try both SSIDs. Id SSID1 fails to connet, and SSID2 succeeds, the Sonoff comes on-line and reports status. The MQTT STATUS message erroneously contains "SSId": SSID1 rather than "SSId": SSID2

BUG: The active SSID should be used in reporting.

sonoff/tele/IoTa_9D72CF/STATE {"Time":"2018-10-04T14:49:06","Uptime":"0T00:19:10","Vcc":3.147,"POWER1":"OFF","POWER2":"OFF","Wifi":{"AP":1,"SSId":"redacted","RSSI":100,"APMac":"redacted"}}

Note: The Sonoff was connected to STA_SSID2 correctly, but is reporting STA_SSID1 (which was powered off)

To Reproduce Set the user_config.h entries thus:

define STA_SSID1 "ssid1"

define STA_PASS1 "pass1"

define STA_SSID1 "ssid2"

define STA_PASS1 "pass2"

define WIFI_CONFIG_TOOL WIFI_RETRY

ensure AP for ssid1 is powered off, and AP for ssid2 is available

Expected behavior The STATE message should report the current, active ssid

Screenshots N/A

Additional context N/A

ChristoSimeonoff commented 5 years ago

After a number of power cycles, the STATE message changes to: "Wifi":{"AP":2,"SSid":"correct ssid" It appears the bug is a delay in updating the STATE message pointer to the active SSID

The problem is reproducible by swapping access points and the SSID1 and SSID2 entries The bug exists only on the first power up. a second reboot fixes the problem.

ascillato2 commented 5 years ago

Hi,

Sorry, I could not reproduce your issue. It works as expected in my devices.

Where are you seeing the report of the selected AP? because may be that your are seeing in your HomeAutomation software and if you have a retain flag, you are seeing the previous status.

ascillato2 commented 5 years ago

Hi,

Where are you seeing the report of the selected AP?

ascillato2 commented 5 years ago

Hi,

When you have time, please tell us the requested information. Also, Remember that you can find us in the Tasmota Discord Chat.

Support Information

See Wiki for more information. See Community for forum. See Chat for more user experience.