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

Crash by click on "Configure Wifi" #36

Closed
jdpiguet opened this issue Feb 7, 2017 · 9 comments
Closed

Crash by click on "Configure Wifi" #36

jdpiguet opened this issue Feb 7, 2017 · 9 comments
Labels
bug Type - Confirmated Bug

Comments

@jdpiguet
Copy link

jdpiguet commented Feb 7, 2017

Hi Theo,

I got a crash in a Sonoff Basic.
The Wifi definition in the user_config.h:

// -- Wifi ----------------------------------------
#define STA_SSID1              "XiaoMI"          // [Ssid1] Wifi SSID
#define STA_PASS1              "Xiaomi110"       // [Password1] Wifi password
#define STA_SSID2              "sonoff"          // [Ssid2] Optional alternate AP Wifi SSID
#define STA_PASS2              "YjvUodcPU0NHu2"  // [Password2] Optional alternate AP Wifi password
#define WIFI_HOSTNAME          "%s%04d"          // [Hostname] Expands to <MQTT_TOPIC>-<last 4 decimal chars of MAC address>
#define WIFI_CONFIG_TOOL       WIFI_WPSCONFIG    // [WifiConfig] Default tool if wifi fails to connect
                                                 //   (WIFI_RESTART, WIFI_SMARTCONFIG, WIFI_MANAGER, WIFI_WPSCONFIG, WIFI_RETRY)

If you need the Wifi password, I can send it in PM.

Thanks for your work, you owe more than one beer!
Regards, Jacques-D.

load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v09826c6d
~ld
▒
00:00:00 APP: Project sonoff Sonoff (Topic sonoff, Fallback DVES_95FD98, GroupTopic sonoffs) Version 3.9.11
00:00:00 Wifi: Connecting to AP1 XiaoMI in mode 11N as sonoff-7576...
00:00:09 Wifi: Connected
00:00:09 HTTP: Webserver active on sonoff-7576 with IP address 10.211.122.191
11:16:54 MQTT: Attempting connection...
11:16:54 MQTT: Connected
11:16:54 MQTT: tele/sonoff/LWT = Online (retained)
11:16:54 MQTT: cmnd/sonoff/POWER =
11:16:54 MQTT: tele/sonoff/INFO1 = {"Module":"Sonoff Basic", "Version":"3.9.11", "FallbackTopic":"DVES_95FD98", "GroupTopic":"sonoffs"}
11:16:54 MQTT: tele/sonoff/INFO2 = {"WebserverMode":"Admin", "Hostname":"sonoff-7576", "IPaddress":"10.211.122.191"}
11:16:55 MQTT: stat/sonoff/RESULT = {"POWER":"OFF"}
11:16:55 MQTT: stat/sonoff/POWER = OFF
11:17:02 MQTT: tele/sonoff/STATE = {"Time":"2017-02-07T11:17:02", "Uptime":0, "POWER":"OFF", "Wifi":{"AP":1, "SSID":"XiaoMI", "RSSI":76}}

Exception (28):
epc1=0x4000bf80 epc2=0x00000000 epc3=0x00000000 excvaddr=0x000002e8 depc=0x00000000

ctx: cont
sp: 3fff1fe0 end: 3fff2490 offset: 01a0

>>>stack>>>
3fff2180:  00000003 06a14ca5 00000000 4000050c
3fff2190:  402324de 4010346c 3fffc200 00000022
3fff21a0:  00000010 000002e8 00000000 3fff2230
3fff21b0:  3fff2240 40107b8c 3fff50dc 3fff22e0
3fff21c0:  4025b6a5 00000021 3fff22e0 401004d8
3fff21d0:  3fff137c 000004bd 000004bd 4021b968
3fff21e0:  00000a00 3fff5e7c 3fff540c 4021bcd5
3fff21f0:  3fff2240 3fff2230 0000000c 7fffffff
3fff2200:  000006e0 3fff2328 3fff2260 3fff2260
3fff2210:  00000002 00000001 00000000 4021bd0c
3fff2220:  3fff2240 3fff2230 0000000c 4021af0f
3fff2230:  00000002 00000001 3fff2328 000002e8
3fff2240:  00000000 4025ee6e 00000000 3fff2260
3fff2250:  00000002 00000001 00000000 402102b8
3fff2260:  00000000 00000000 00000000 401023f2
3fff2270:  3ffea745 401056cf 3ffee1d0 401023f2
3fff2280:  40103105 3ffee1d0 00000002 401023f2
3fff2290:  00007fff 06d80d23 3ffeebbc 40103294
3fff22a0:  3fff137c 000001ea 000001ea 3fff137c
3fff22b0:  00000010 3fff2380 00000000 4010053d
3fff22c0:  00000010 3fff2380 00000000 4010053d
3fff22d0:  3fff137c 00000203 00000203 4010020c
3fff22e0:  00000000 00000000 00000000 3fff137c
3fff22f0:  00000010 3fff2380 00000000 4010053d
3fff2300:  40248316 00000000 3fff2380 4024832d
3fff2310:  3fff3e3c 3fff2380 3fff2380 3ffe93f2
3fff2320:  00000010 3fff2380 3fff5e7c 000009ff
3fff2330:  000009f5 3fff23c0 00000000 4010053d
3fff2340:  3fff137c 000001d6 000001d6 3fff137c
3fff2350:  00000010 3fff23e0 00000000 40217ec8
3fff2360:  00000010 3fff23c0 3fff23c0 4021aec0
3fff2370:  3fff3544 00000003 3fff23c0 40217ec8
3fff2380:  00000002 00000001 3fff31dc 40210478
3fff2390:  00000002 00000001 3fff23c0 4021bdda
3fff23a0:  00000000 00000000 3fff31dc 40217ebe
3fff23b0:  3fff31dc 3fff42e4 3fff31dc 40217efa
3fff23c0:  00000000 00000000 00000000 4021b070
3fff23d0:  3fff31dc 3fff42e4 3fff42a4 40217f8d
3fff23e0:  3fff3544 0000000f 00000003 40214b8c
3fff23f0:  00000000 00000000 00000000 00000001
3fff2400:  00000002 4021742c 0000000e 3fff1470
3fff2410:  00000000 00000000 3fff0350 3fff1460
3fff2420:  00000001 3fff42c8 3fff42a4 40218117
3fff2430:  3ffe9508 00000000 3fff1470 00000000
3fff2440:  3fffdad0 3fff1460 4021bb0c 3fff1470
3fff2450:  3fffdad0 00000000 3fff1458 40203e96
3fff2460:  00000000 00000000 00000001 40213a64
3fff2470:  3fffdad0 00000000 3fff1458 4021bb58
3fff2480:  feefeffe feefeffe 3fff1470 40100718
<<<stack<<<

 ets Jan  8 2013,rst cause:1, boot mode:(3,6)

load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v09826c6d

@arendst arendst added the help needed Action - Asking for help from the community label Feb 7, 2017
@hoekbrwr
Copy link

hoekbrwr commented Feb 7, 2017

I just took out the last 4 digit from the hostname in the config.h and with the same firmware I cannot change the Wifi config anymore! I could not configure through the webserver too and then I thought I change that in the user_confi.h and recompile and upgrade. The upgrade went well, but now I am unable to go into the webserver's config Wifi anymore! I did not change to the latest version on Github in the mean time!

@arendst
Copy link
Owner

arendst commented Feb 7, 2017

I can reproduce exception (28) when opening the Wifi Config page and having changed the default WIFI_HOSTNAME to "%s%04d" (without the dash) . Will investigate...

In the meantime keep the user_config.h hostname as defined (WIFI_HOSTNAME "%s-%04d") and just change it to your likings in the Wifi config page or use the command hostname in console or MQTT topic. Preferably without a percentage sign so just call it "MyHostname".

@arendst arendst added bug Type - Confirmated Bug and removed help needed Action - Asking for help from the community labels Feb 7, 2017
@arendst
Copy link
Owner

arendst commented Feb 7, 2017

I'll remove the WIFI_HOSTNAME setting from user_config.h as the goal of this version is to make changes online if possible anyway. The user can still change the hostname using the Wifi Config page and/or the hostname command.

Background: I need to write a lot of code to handle (bad) user input regarding % signs in names. As you noticed removing the dash is disastrous as the standard procedure for replacing the %s%04d by the Topic name filled with four characters from the unique MAC address fails.

@hoekbrwr
Copy link

hoekbrwr commented Feb 8, 2017

I could not get into the wifi configuration menu on the webserver(used the hostname cmnd on all my sonoff units without special characters). This was solved by doing a firmware upgrade with just the same firmware as was already loaded. Something that might help finding out when investigating the cause of this problem. Btw the menu still shows the numbers in the label for changing hostname.

arendst added a commit that referenced this issue Feb 8, 2017
3.9.12 20170208
* Fix compile error when webserver is disabled (#30)
* Fix possible ESP8285 flash problem by updating Flash Chip Mode to DOUT
during OTA upload
* Fix hostname issues by not allowing user entry of string formatting
and removing from user_config.h (#36)
@arendst
Copy link
Owner

arendst commented Feb 8, 2017

By removing WIFI_HOSTNAME from the user_config.h and not allowing any string formatting by users the problem should have been solved.

You're still able to configure your hostname by command and webpage.

@starfish1107
Copy link

I am customizing my config using user_config_override.h - I think this is the idea behind isn´t it? will you remove hostname config possitility from this file too?

@arendst
Copy link
Owner

arendst commented Feb 8, 2017

Yes. The ability to configure hostname via user_config or user_config_override is removed.

The default hostname will be unique and derived from MQTT topic and the last four decimal digits of the MAC address like sonoff-1234.

The user can then change this hostname via the hostname command or the webpage.

@hoekbrwr
Copy link

There is still a #define WIFI_HOSTNAME "%s-%04d" in sonoff.ino on line 61. This still gives the opportunity to misconfigure the name! Shouldn"t you hardcode this as a default?
I found this out when I did a try to set all values to user_config.h and got the 4 decimals again. Though that is fully OK for a clean start, the ability to tinker with it you said you did not like.

@arendst
Copy link
Owner

arendst commented Feb 11, 2017

I know. But if someone wants to change it outside user_config.h I won't fix any problem that results from a change.

@arendst arendst closed this as completed Feb 13, 2017
the-real-orca pushed a commit to the-real-orca/Sonoff-Tasmota that referenced this issue Jun 17, 2018
arendst#36 fixed ba adding additional calculation as requested. Tested OK
curzon01 pushed a commit to curzon01/Tasmota that referenced this issue Sep 6, 2018
3.9.12 20170208
* Fix compile error when webserver is disabled (arendst#30)
* Fix possible ESP8285 flash problem by updating Flash Chip Mode to DOUT
during OTA upload
* Fix hostname issues by not allowing user entry of string formatting
and removing from user_config.h (arendst#36)
arendst added a commit that referenced this issue May 2, 2020
* Prep for core 2.7

* Test release core 2.6.3...

if it appears in build

* Release zip as source for core?

* Release Core 2.7.0

removed comment behind definition since it generates on some platforms errors

* Update platformio_override_sample.ini

* Update (#34)

* Fix pin handling part 1

* Change pin handling part 2

* Change pin handling part 3

* Change pin handling part 4/4

* Fix pin handling part 4/4

* Change pin handling part 5

* Change pin handling part 6

* Update xsns_02_analog.ino

* Only advance to next palette color when fade is down

* Rework DGR channel update

* Update Changelog and Release notes

* Switch from GPIO array to Pin array

* Change ESP32 pin allocation part 1

* Change pin array names

Change pin array names to block unwanted use of direct access

* Fix ESP32 settings size

Fix ESP32 settings size as regression from yesterday

* Change ESP32 pin allocation part 2

* Fix http message time

* Create CI_github.yml

* CI on Push and Pull

* Change ESP32 pin allocation part 3

* Fix ESP32 pin allocation part 3 regression

* Rename .travis.yml to .travis.yml.off

* Update CI_github.yml

* Update README.md

* Update PULL_REQUEST_TEMPLATE.md

* Fix CI badge

Co-authored-by: Theo Arends <11044339+arendst@users.noreply.github.com>
Co-authored-by: kugelkopf123 <45996965+kugelkopf123@users.noreply.github.com>
Co-authored-by: Paul C Diem <PCDiem@FoxValley.net>
Co-authored-by: device111 <48546979+device111@users.noreply.github.com>

Co-authored-by: Theo Arends <11044339+arendst@users.noreply.github.com>
Co-authored-by: kugelkopf123 <45996965+kugelkopf123@users.noreply.github.com>
Co-authored-by: Paul C Diem <PCDiem@FoxValley.net>
Co-authored-by: device111 <48546979+device111@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Type - Confirmated Bug
Projects
None yet
Development

No branches or pull requests

4 participants