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

firmware flash webUI v4.0x fails #235

Closed
ghost opened this issue Mar 19, 2017 · 19 comments
Closed

firmware flash webUI v4.0x fails #235

ghost opened this issue Mar 19, 2017 · 19 comments
Labels
bug Type - Confirmated Bug

Comments

@ghost
Copy link

ghost commented Mar 19, 2017

Hi,

Updating firmware from the WebUI v4.0x fails. Serial log shows:

16:27:43 MQTT: stat/sonoff/RESULT = {"OtaUrl":"http://o"}
16:27:43 MQTT: stat/sonoff/RESULT = {"Upgrade":"Version 4.0.7 from http://o"}
16:27:45 HTTP: Webserver stopped
16:27:59 HTTP: Webserver active on sonoff-0946.local with IP address 192.168.1.211
16:28:01 HTTP: Webserver stopped
16:28:14 HTTP: Webserver active on sonoff-0946.local with IP address 192.168.1.211
16:28:16 HTTP: Webserver stopped
16:28:29 HTTP: Webserver active on sonoff-0946.local with IP address 192.168.1.211

16:28:31 HTTP: Webserver stopped
16:28:44 HTTP: Webserver active on sonoff-0946.local with IP address 192.168.1.211
16:28:46 HTTP: Webserver stopped
16:28:59 HTTP: Webserver active on sonoff-0946.local with IP address 192.168.1.211
16:29:01 HTTP: Webserver stopped
16:29:14 HTTP: Webserver active on sonoff-0946.local with IP address 192.168.1.211
16:29:16 HTTP: Webserver stopped
16:29:29 HTTP: Webserver active on sonoff-0946.local with IP address 192.168.1.211
16:29:31 HTTP: Webserver stopped
16:29:45 HTTP: Webserver active on sonoff-0946.local with IP address 192.168.1.211
16:29:46 HTTP: Webserver stopped
16:30:00 HTTP: Webserver active on sonoff-0946.local with IP address 192.168.1.211
16:30:01 HTTP: Webserver stopped
16:30:02 HTTP: Webserver active on sonoff-0946.local with IP address 192.168.1.211
16:30:03 MQTT: stat/sonoff/UPGRADE = Failed HTTP error: connection refused

16:30:04 APP: Restarting

The OtaUrl shown in the log has been truncated somehow. The URL should be: 'http://odroid-server.local/firmware/sonoff/firmware.bin'. Issue can be replicated consequently. Changing the URL through the web interface does not solve the issue, as does not resetting the whole configuration either through menu or 4-sec pushing the button.

Can I try other scenario's to get this working? Any suggestion is welcome! thanks already

@davidelang
Copy link
Collaborator

davidelang commented Mar 19, 2017 via email

@arendst
Copy link
Owner

arendst commented Mar 19, 2017

Already found the error. My fault, too much cleaned up. Solved in next release. Workaround: change line 966 in webserver.ino from svalue[16] to svalue[100];

@ghost
Copy link
Author

ghost commented Mar 19, 2017

It was indeed hardcoded in the userconfig.h and through MQTT refreshing the Otaurl and upgrading went just fine. Just as soon as I proceed upgrade through the web-interface the Otaurl gets messed up I.

@ghost
Copy link
Author

ghost commented Mar 19, 2017

See you found the problem. Thanks!

@ghost
Copy link
Author

ghost commented Mar 19, 2017

Will it be possible to upgrade OtA to the new release given the regression?

@arendst
Copy link
Owner

arendst commented Mar 19, 2017

Yes. You can also upgrade using the second option on the web page by uploading the file yourself.

@davidelang
Copy link
Collaborator

davidelang commented Mar 19, 2017 via email

@ghost
Copy link
Author

ghost commented Mar 19, 2017

Will make the adjustment and try the upload options.

@ghost
Copy link
Author

ghost commented Mar 19, 2017

Made the code-adjustment and flashed new firmware through FTDI.

Then, re-flash through MQTT still faills (tested, OtaUrl is correct and accessible):

17:11:07 MQTT: stat/sonoff-0946/RESULT = {"OtaUrl":"http://odroid-server.local:80/firmware/sonoff/firmware.bin"}
17:11:07 MQTT: stat/sonoff-0946/RESULT = {"Upgrade":"Version 4.0.6p from http://odroid-server.local:80/firmware/sonoff/firmware.bin"}
17:11:10 HTTP: Webserver stopped
17:11:24 HTTP: Webserver active on sonoff-0946-0946.local with IP address 192.168.1.211
17:11:26 HTTP: Webserver stopped
17:11:39 HTTP: Webserver active on sonoff-0946-0946.local with IP address 192.168.1.211
17:11:41 HTTP: Webserver stopped
17:11:54 HTTP: Webserver active on sonoff-0946-0946.local with IP address 192.168.1.211
17:11:56 HTTP: Webserver stopped
17:12:09 HTTP: Webserver active on sonoff-0946-0946.local with IP address 192.168.1.211
17:12:11 HTTP: Webserver stopped
17:12:24 HTTP: Webserver active on sonoff-0946-0946.local with IP address 192.168.1.211
17:12:26 HTTP: Webserver stopped

17:12:39 HTTP: Webserver active on sonoff-0946-0946.local with IP address 192.168.1.211
17:12:41 HTTP: Webserver stopped
17:12:54 HTTP: Webserver active on sonoff-0946-0946.local with IP address 192.168.1.211
17:12:56 HTTP: Webserver stopped
17:13:10 HTTP: Webserver active on sonoff-0946-0946.local with IP address 192.168.1.211
17:13:11 HTTP: Webserver stopped
17:13:25 HTTP: Webserver active on sonoff-0946-0946.local with IP address 192.168.1.211
17:13:26 HTTP: Webserver stopped
17:13:27 HTTP: Webserver active on sonoff-0946-0946.local with IP address 192.168.1.211
17:13:28 MQTT: stat/sonoff-0946/UPGRADE = Failed HTTP error: connection refused
17:13:29 APP: Restarting

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


 ets Jan  8 2013,rst cause:4, boot mode:(1,7)

wdt reset

@arendst
Copy link
Owner

arendst commented Mar 19, 2017

Right. Another problem as the url is now fine.

Does the ota upgrade work if you initiate it form MQTT with command upgrade 1?

@ghost
Copy link
Author

ghost commented Mar 19, 2017

It doesn't react anymore on upgrade 1 through MQTT...

@arendst
Copy link
Owner

arendst commented Mar 19, 2017

What happens if you reset the device (power cycle). Does it connect to your broker?

@ghost
Copy link
Author

ghost commented Mar 19, 2017

Yes it does perfectly:

00:00:09 Wifi: Connected
00:00:09 mDNS: Initialized
00:00:09 HTTP: Webserver active on sonoff-0946.local with IP address 192.168.1.211
17:33:35 MQTT: Attempting connection...
17:33:36 mDNS: Query done with 0 mqtt services found
17:33:36 MQTT: Connected
17:33:36 MQTT: tele/sonoff/LWT = Online (retained)
17:33:36 MQTT: cmnd/sonoff/POWER =
17:33:36 MQTT: tele/sonoff/INFO1 = {"Module":"Sonoff Basic", "Version":"4.0.6p", "FallbackTopic":"DVES_1BE3B2", "GroupTopic":"sonoffs"}
17:33:36 MQTT: tele/sonoff/INFO2 = {"WebserverMode":"Admin", "Hostname":"sonoff-0946", "IPaddress":"192.168.1.211"}
17:33:36 MQTT: tele/sonoff/INFO3 = {"Started":"Power on"}
17:33:37 MQTT: stat/sonoff/RESULT = {"POWER":"ON"}
17:33:37 MQTT: stat/sonoff/POWER = ON

@arendst
Copy link
Owner

arendst commented Mar 19, 2017

And now try command otaurl first and chack it's output.

Then command upgrade 1

@ghost
Copy link
Author

ghost commented Mar 19, 2017

MQTT or Console?

@arendst
Copy link
Owner

arendst commented Mar 19, 2017

Doesn't matter as long as you do not use the web upgrade page

@ghost
Copy link
Author

ghost commented Mar 19, 2017

This is the output. No luck, I'm afraid:

17:41:18 CMND: otaurl
17:41:18 MQTT: stat/sonoff/RESULT = {"OtaUrl":"http://odroid-server.local/firmware/sonoff/firmware.bin"}
17:42:06 CMND: upgrade 1
17:42:06 MQTT: stat/sonoff/RESULT = {"Upgrade":"Version 4.0.6p from http://odroid-server.local/firmware/sonoff/firmware.bin"}
17:42:09 HTTP: Webserver stopped
17:42:22 HTTP: Webserver active on sonoff-0946.local with IP address 192.168.1.211
17:42:24 HTTP: Webserver stopped
17:42:37 HTTP: Webserver active on sonoff-0946.local with IP address 192.168.1.211
17:42:39 HTTP: Webserver stopped
17:42:52 HTTP: Webserver active on sonoff-0946.local with IP address 192.168.1.211
17:42:54 HTTP: Webserver stopped
17:43:07 HTTP: Webserver active on sonoff-0946.local with IP address 192.168.1.211
17:43:09 HTTP: Webserver stopped
17:43:23 HTTP: Webserver active on sonoff-0946.local with IP address 192.168.1.211
17:43:24 HTTP: Webserver stopped
17:43:38 HTTP: Webserver active on sonoff-0946.local with IP address 192.168.1.211
17:43:39 HTTP: Webserver stopped
17:43:53 HTTP: Webserver active on sonoff-0946.local with IP address 192.168.1.211
17:43:54 HTTP: Webserver stopped

17:44:08 HTTP: Webserver active on sonoff-0946.local with IP address 192.168.1.211
17:44:09 HTTP: Webserver stopped
17:44:23 HTTP: Webserver active on sonoff-0946.local with IP address 192.168.1.211
17:44:24 HTTP: Webserver stopped
17:44:25 HTTP: Webserver active on sonoff-0946.local with IP address 192.168.1.211
17:44:26 MQTT: stat/sonoff/UPGRADE = Failed HTTP error: connection refused
17:44:28 APP: Restarting

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

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_1BE3B2, GroupTopic sonoffs) Version 4.0.6p

00:00:00 Wifi: Connecting to AP1 MTB06WMESH in mode 11N as sonoff-0946...
00:00:03 Wifi: Connected
00:00:03 mDNS: Initialized
00:00:03 HTTP: Webserver active on sonoff-0946.local with IP address 192.168.1.211
17:44:34 MQTT: Attempting connection...
17:44:35 mDNS: Query done with 0 mqtt services found
17:44:35 MQTT: Connected
17:44:35 MQTT: tele/sonoff/LWT = Online (retained)
17:44:35 MQTT: cmnd/sonoff/POWER =
17:44:35 MQTT: tele/sonoff/INFO1 = {"Module":"Sonoff Basic", "Version":"4.0.6p", "FallbackTopic":"DVES_1BE3B2", "GroupTopic":"sonoffs"}
17:44:35 MQTT: tele/sonoff/INFO2 = {"WebserverMode":"Admin", "Hostname":"sonoff-0946", "IPaddress":"192.168.1.211"}
17:44:35 MQTT: tele/sonoff/INFO3 = {"Started":"Software/System restart"}
17:44:37 MQTT: stat/sonoff/RESULT = {"POWER":"ON"}
17:44:37 MQTT: stat/sonoff/POWER = ON

@arendst
Copy link
Owner

arendst commented Mar 19, 2017

Great!. So you have a problem with your URL. Try again replacing the odroid-server.local name with it's ip address.

@ghost
Copy link
Author

ghost commented Mar 19, 2017

You're right! That did solve it. Don't know why, I did verify the url through my browser, but it did.

Thanks!

arendst added a commit that referenced this issue Mar 19, 2017
4.0.7 20170319
* Increased Sonoff Led PWM frequency from 432 to 1000
* Fix possible watch dog reboot after changing module type on web page
* Fix reporting of GPIO usage from web page
* Fix Sonoff Led blank during firmware upgrade
* Fix Sonoff Led flicker and possible flash corruption by using latest
Arduino-esp8266 versions
*   of pwm core files included in sonoff library (#211)
* Add PWM output control with commands PWM1 to PWM5 using user
selectable GPIOs (#211)
* Fix exceptions due to low values of commands HlwPCal (10000), HlwUCal
(1000) and HlwICal (2500) (#223)
* Add Switch state to sensor status (#227, #233)
* Add user configuarble GPIO to module Sonoff Touch (#228)
* Add define WEB_PORT to user_config.h to change default web server port
from 80 (#232)
* Fix failed Ota Firmware upgrade started from Web page (#235)
@arendst arendst added the bug Type - Confirmated Bug label Mar 19, 2017
@arendst arendst closed this as completed Mar 19, 2017
curzon01 pushed a commit to curzon01/Tasmota that referenced this issue Sep 6, 2018
4.0.7 20170319
* Increased Sonoff Led PWM frequency from 432 to 1000
* Fix possible watch dog reboot after changing module type on web page
* Fix reporting of GPIO usage from web page
* Fix Sonoff Led blank during firmware upgrade
* Fix Sonoff Led flicker and possible flash corruption by using latest
Arduino-esp8266 versions
*   of pwm core files included in sonoff library (arendst#211)
* Add PWM output control with commands PWM1 to PWM5 using user
selectable GPIOs (arendst#211)
* Fix exceptions due to low values of commands HlwPCal (10000), HlwUCal
(1000) and HlwICal (2500) (arendst#223)
* Add Switch state to sensor status (arendst#227, arendst#233)
* Add user configuarble GPIO to module Sonoff Touch (arendst#228)
* Add define WEB_PORT to user_config.h to change default web server port
from 80 (arendst#232)
* Fix failed Ota Firmware upgrade started from Web page (arendst#235)
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

2 participants