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

Cannot load 20190225 on SonoffPow R1 after fix for #2251 #2355

Closed
3 tasks
2bontb opened this issue Feb 25, 2019 · 13 comments
Closed
3 tasks

Cannot load 20190225 on SonoffPow R1 after fix for #2251 #2355

2bontb opened this issue Feb 25, 2019 · 13 comments
Labels
Category: Plugin Related to supported sensors Status: Fixed Commit has been made, ready for testing Type: Bug Considered a bug

Comments

@2bontb
Copy link

2bontb commented Feb 25, 2019

Checklist

  • [ x] The title of this issue is "to the point" and descriptive.
  • [ x] This issue describes what is happening.
  • [ x] This issue describes what components are affected (e.g. name of plugin/controller)
  • [x ] This issue describes how to reproduce it.
  • [ x] This issue describes when it was introduced (when known) and what version is now showing the problem.

I have...

  • [ x] searched the issue tracker or the forum for a similar issue. (include links when applicable)
  • [x ] entered a system description using "Copy info to clipboard" on the sysinfo page. (when possible)
  • [x ] entered the full filename of the used version (e.g. ESP_Easy_mega-20181001_test_ESP8266_4096_VCC.bin )
  • [x ] given a list of active plugins or controllers when applicable.
  • [ x] filled out all applicable fields below.

Steps already tried...

  • [ x] Tried a clean install (empty .bin files are included in the ZIP)
    Loaded clean4M first
    Than added Wifi credentials via arduineo IDE
    Could not add device HLW8012: Page crashes

  • Tested previous/other build (mention which one already tested)
    Is same problem as reported in Upgrade Sonoff Pow R1 from Mega-20181220 to Mega 20190116 fails #2251

  • Tested on other node to make sure hardware isn't defective.
    No did not do this.

  • Verified if the problem is limited to a single plugin/controller
    Yes; Load is running on other devices.

Summarize of the problem/feature request

  1. I loaded 4M blank; Because upgrade from my 20181220 version did not work.
  2. Loaded 20190225
  3. See what I did on arduino IDE:

reset
22844 : Command: reset
22845 : reset
RESET: Resetting factory defaults... using Sonoff POW settings
RESET: Warm boot, reset count: 1
RESET: formatting...
RESET: formatting done...
RESET: Succesful, rebooting. (you might need to press the reset button if you've justed flashed the firmware)

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

load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
vbb28d4a3
~ld
⸮⸮⸮U85 :

INIT : Booting version: mega-20190225 (ESP82xx Core 2_4_2, NONOS SDK 2.2.1(cfd48f3), LWIP: 2.0.3 PUYA support)
86 : INIT : Warm boot #7 - Restart Reason: Software/System restart
88 : FS : Mounting...
113 : FS : Mount successful, used 76053 bytes of 957314
398 : CRC : program checksum ...OK
435 : CRC : SecuritySettings CRC ...FAIL
517 : INIT : Free RAM:30144
519 : INIT : SPI not enabled
533 : INFO : Plugins: 7 [Normal] [Sonoff POW R1/R2] (ESP82xx Core 2_4_2, NONOS SDK 2.2.1(cfd48f3), LWIP: 2.0.3 PUYA support)
534 : EVENT: System#Wake
556 : WIFI : No valid wifi settings
556 : WIFI : Could not connect to AP!
557 : WIFI : Set WiFi to AP
596 : EVENT: WiFi#APmodeEnabled
616 : WIFI : AP Mode ssid will be Sonoff POW R1/R2_0 with address 192.168.4.1
618 : EVENT: System#Boot
1969 : WD : Uptime 0 ConnectFailures 0 FreeMem 27480 WiFiStatus 0

wifiKey xxxx

Wifi Key:xxxx

Ok

wifiSSID yyyyy

Wifi SSID:yyyy

Ok

ClearAccessBlock
Allowed IP range : All Allowed

Ok

save

Ok

reboot

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

load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
vbb28d4a3
~ld
⸮⸮⸮U85 :

INIT : Booting version: mega-20190225 (ESP82xx Core 2_4_2, NONOS SDK 2.2.1(cfd48f3), LWIP: 2.0.3 PUYA support)
86 : INIT : Warm boot #8 - Restart Reason: Software/System restart
89 : FS : Mounting...
113 : FS : Mount successful, used 76053 bytes of 957314
399 : CRC : program checksum ...OK
437 : CRC : SecuritySettings CRC ...OK
544 : INIT : Free RAM:30144
546 : INIT : SPI not enabled
559 : INFO : Plugins: 7 [Normal] [Sonoff POW R1/R2] (ESP82xx Core 2_4_2, NONOS SDK 2.2.1(cfd48f3), LWIP: 2.0.3 PUYA support)
561 : EVENT: System#Wake
583 : WIFI : Set WiFi to STA
616 : WIFI : Connecting DeHeijIOT attempt #0
618 : WIFI : Not configured in Station Mode!!: DeHeijIOT
620 : EVENT: System#Boot
1976 : WD : Uptime 0 ConnectFailures 0 FreeMem 28128 WiFiStatus 0
4503 : WIFI : Connected! AP: DeHeijIOT (7A:8A:20:9F:5F:B3) Ch: 6 Duration: 3783 ms
4505 : EVENT: WiFi#ChangedAccesspoint
4526 : WIFI : DHCP IP: 10.2.1.123 (Sonoff-POW-R1/R2-0) GW: 10.2.1.138 SN: 255.255.255.0 duration: 34 ms
4528 : EVENT: WiFi#Connected

>> Now I loaded the device page, and added HLW8012 device;

Exception (3):
epc1=0x40252e18 epc2=0x00000000 epc3=0x00000000 excvaddr=0x402937b7 depc=0x00000000

ctx: cont
sp: 3ffff950 end: 3fffffd0 offset: 01a0

stack>>>
3ffffaf0: 3fff15e0 3ffffb80 3ffffb30 401006dc
3ffffb00: 00000002 3ffffb80 3ffffb30 3ffffbf8
3ffffb10: 00000010 3ffffbec 3ffffbec 4024cf67
3ffffb20: 3ffe9459 00000000 3ffffbec 4024cfb3
3ffffb30: 3fff15e0 3ffffde4 3ffffbec 4024cfe5
3ffffb40: 3ffe9459 3ffffbf8 3ffffbec 4024d032
3ffffb50: 402937b7 3ffffde4 3ffffd50 4024cf3c
3ffffb60: 3ffe91d7 3ffffc28 3ffffd50 4022f2b1
3ffffb70: 3fff38c4 0000015c 3ffffc28 00000004
3ffffb80: 3fff5314 0000000f 00000000 3fff532c
3ffffb90: 0000000f 00000000 3fff5344 0000000f
3ffffba0: 00000000 3fff535c 0000000f 00000000
3ffffbb0: 3fff5374 0000000f 00000000 3fff538c
3ffffbc0: 0000000f 00000000 3fff53a4 0000000f
3ffffbd0: 00000000 3fff6604 0000000f 00000000
3ffffbe0: 3fff661c 0000000f 00000000 3fff6634
3ffffbf0: 0000000f 00000000 0000051b 4010020c
3ffffc00: 3ffffde4 00000009 3ffffc40 401006dc
3ffffc10: 3fff2584 00000518 00000518 4010020c
3ffffc20: 3ffffde4 00000009 3ffffc60 401006dc
3ffffc30: 3fff2584 00000515 00000515 4010020c
3ffffc40: 3ffffde4 00000009 3ffffc80 401006dc
3ffffc50: 3fff2584 000007ff 3ffffc80 4024cf20
3ffffc60: 00000000 00000000 402936ac 3ffffbf8
3ffffc70: 3ffe9459 3fff6608 40287df4 40216062
3ffffc80: 00000000 00000000 00000000 00000004
3ffffc90: 3ffffde4 00000009 3ffffd50 40220d4c
3ffffca0: 3fff52b4 0000000f 0000000f 3fff72ac
3ffffcb0: 0000000f 0000000f 3fff6a84 0000000f
3ffffcc0: 0000000e 3fff52e4 0000000f 00000000
3ffffcd0: 3fff52fc 0000000f 00000000 00000000
3ffffce0: 00000000 00000000 00000000 00000000
3ffffcf0: 00000000 00000000 00000200 00000800
3ffffd00: 3fff12c4 3fff0a6c 3ffffde4 4024cfe5
3ffffd10: 02e8c84e 3fff0a6c 3ffffde4 4024d032
3ffffd20: 3ffe9459 3fff0a6c 0000001c 3fff15e0
3ffffd30: 3fff12c4 3fff0a6c 0000001c 402419be
3ffffd40: 0000ff00 4024cf67 ff000000 3fff2584
3ffffd50: 3fff67a4 0000000f 0000000f 3fff66bc
3ffffd60: 0000000f 0000000f 3fff6704 0000000f
3ffffd70: 0000000e 3fff6744 0000000f 00000000
3ffffd80: 3fff5414 0000000f 00000000 00000000
3ffffd90: 00000000 00000000 00000000 00000000
3ffffda0: 00000000 00000000 00000200 00000800
3ffffdb0: 00000000 00000000 00000000 000053f8
3ffffdc0: 00004fd0 00000000 00000000 00001a90
3ffffdd0: 00000105 0000f2a6 00000000 00000000
3ffffde0: 00000000 3fff542c 0000000f 00000000
3ffffdf0: 00000000 00000000 00000000 4027b2bf
3ffffe00: 3fff2584 000007a3 000007a3 4010020c
3ffffe10: 00000002 0000004c 3ffffe50 00000001
3ffffe20: 00000002 4028e352 402506f0 00000003
3ffffe30: 3ffffde4 00000000 4028e352 4024cf3c
3ffffe40: 3ffffdf0 3fff15e2 00000000 4022904d
3ffffe50: 00000000 00000000 00000000 4020e464
3ffffe60: 00000002 00000001 3fff2c84 40241ff8
3ffffe70: 00000002 4020cc60 3fff2c84 4024f8fe
3ffffe80: 00000000 00000000 3fff2c84 4020e45a
3ffffe90: 3fff2c84 3fff229c 3ffffec0 4020e496
3ffffea0: 00000000 00000000 00000000 4024d110
3ffffeb0: 3fff2c84 3fff229c 3fff2258 4020e51d
3ffffec0: 3fff65c4 0000000f 00000008 00000000
3ffffed0: 00000000 4bc6a7f0 0000bcfb 3fff1110
3ffffee0: 00000016 00000001 00000001 00000001
3ffffef0: 00000002 3fff6604 00000016 3fff2c84
3fffff00: 00000000 4bc6a7f0 0000bcfa 00000000
3fffff10: 00000001 3fff2280 3fff2258 4020e770
3fffff20: 40203b25 00000000 4024e04c 3fffefb0
3fffff30: 4027b6fa 00000000 00000000 4024c089
3fffff40: 02e236e8 00000000 3fff0d98 4023265a
3fffff50: 3fffdad0 02e236d2 0000bcfa 3fff2428
3fffff60: 3fff0eb4 02e236d2 3fff10f0 4024a87b
3fffff70: 3fffdad0 3fff40d8 02e2369b 3fff2428
3fffff80: 3fffdad0 00000000 3fff0f88 3fff2428
3fffff90: 3fffdad0 00000000 3fff0f88 4024a9c5
3fffffa0: 00000000 00000000 00000001 4024e06d
3fffffb0: 3fffdad0 00000000 3fff2422 4024e0dc
3fffffc0: feefeffe feefeffe 3ffe8794 40100721
<<<stack<<<

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

load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
vbb28d4a3
~ld
⸮⸮⸮U83 :

INIT : Booting version: mega-20190225 (ESP82xx Core 2_4_2, NONOS SDK 2.2.1(cfd48f3), LWIP: 2.0.3 PUYA support)
83 : INIT : Warm boot #9 - Restart Reason: Exception
86 : FS : Mounting...
111 : FS : Mount successful, used 76053 bytes of 957314
397 : CRC : program checksum ...OK
434 : CRC : SecuritySettings CRC ...OK
541 : INIT : Free RAM:30160
543 : INIT : SPI not enabled
557 : INFO : Plugins: 7 [Normal] [Sonoff POW R1/R2] (ESP82xx Core 2_4_2, NONOS SDK 2.2.1(cfd48f3), LWIP: 2.0.3 PUYA support)
558 : EVENT: System#Wake
580 : WIFI : Set WiFi to STA
613 : WIFI : Connecting DeHeijIOT attempt #0
615 : WIFI : Not configured in Station Mode!!: DeHeijIOT
617 : EVENT: System#Boot
1974 : WD : Uptime 0 ConnectFailures 0 FreeMem 28144 WiFiStatus 0
4495 : WIFI : Connected! AP: DeHeijIOT (7A:8A:20:9F:5F:B3) Ch: 6 Duration: 3779 ms
4497 : EVENT: WiFi#ChangedAccesspoint
4518 : WIFI : DHCP IP: 10.2.1.123 (Sonoff-POW-R1/R2-0) GW: 10.2.1.138 SN: 255.255.255.0 duration: 26 ms
4520 : EVENT: WiFi#Connected

Expected behavior

Page displays, so I can update settings

Actual behavior

System crashes.

Steps to reproduce

  1. See above.

System configuration

Hardware: Sonoff POW 4M rev 2.0

ESP Easy version: 20190225 hard sonoff 4M

ESP Easy settings/screenshots:
image

Rules or log data


@TD-er
Copy link
Member

TD-er commented Feb 25, 2019

OK, I will close 'the other one' and we'll continue in this one.
I will also try to run the nightly build, just to make sure it is also failing here.

@TD-er
Copy link
Member

TD-er commented Feb 25, 2019

It is confirmed, the one with the nightly build is not working on the POW r1.
And before updating I had confirmed it was possible to add/delete and edit the plugin on the node I have here.

@TD-er TD-er added Type: Bug Considered a bug Category: Plugin Related to supported sensors labels Feb 25, 2019
@TD-er
Copy link
Member

TD-er commented Feb 25, 2019

Without any changes, I just made this test build Can you please try if it works?
If it does, I will (again) throw away all caches on Travis, since one of the build environments is then apparently broken (again).

@2bontb
Copy link
Author

2bontb commented Feb 25, 2019

TD-er,
I wanted to help on where it goes wrong. So I compiled the source in IDE so I could do a stack trace.
But to my wonder: The bin file I created did not create the problem. It worked as you described.
So I do only have the problem if I load the bin file that was in the distribution. This is the boot info.
So we can compare the difference:

INIT : Booting version: (custom) (ESP82xx Core 2_4_2, NONOS SDK 2.2.1(cfd48f3), LWIP: 2.0.3)
5956 : INIT : Cold Boot - Restart Reason: Software/System restart
5958 : FS : Mounting...
5983 : FS : Mount successful, used 76304 bytes of 957314
5993 : CRC : No program memory checksum found. Check output of crc2.py
6030 : CRC : SecuritySettings CRC ...OK
6032 : CRC : binary has changed since last save of Settings
6142 : INIT : Free RAM:30256
6144 : INIT : SPI not enabled
6151 : P076: Init object done
6154 : P076: Init Basic Resistor Values done
6161 : P076: Saved Calibration after INIT
6164 : P076: Applied Calibration after INIT
6176 : INFO : Plugins: 7 [Normal] [Sonoff POW R1/R2] (ESP82xx Core 2_4_2, NONOS SDK 2.2.1(cfd48f3), LWIP: 2.0.3)
6178 : EVENT: System#Wake
6232 : WIFI : Set WiFi to STA
6265 : WIFI : Connecting DeHeijIOT attempt #0
6268 : WIFI : Not configured in Station Mode!!: xx
6270 : EVENT: System#Boot
6287 : ACT : timerSet,3,300
6297 : Command: timerset
6388 : SYS : 0.00,31.00,100.00,0.00
6395 : EVENT: Uptime#Uptime=0.00
6426 : EVENT: Uptime#RSSI=31.00
6449 : EVENT: Uptime#Load=100.00
6471 : EVENT: Uptime#=0.00
7600 : P076: Read values - V=0 - A=0.00 - W=0 - Pf%=0
7604 : EVENT: EnergieWerkkamer#Voltage=0.00
7628 : EVENT: EnergieWerkkamer#Current=0.00
7650 : EVENT: EnergieWerkkamer#Power=0.00
7674 : EVENT: EnergieWerkkamer#Factor=0.00
7729 : WD : Uptime 0 ConnectFailures 0 FreeMem 27200 WiFiStatus 0
10273 : WIFI : Connected! AP: DeHeijIOT (7A:8A:20:9F:5F:B3) Ch: 6 Duration: 3781 ms
10276 : EVENT: WiFi#ChangedAccesspoint
10302 : WIFI : DHCP IP: 10.2.1.123 (SonoffWerkkamer-123) GW: 10.2.1.138 SN: 255.255.255.0 duration: 34 ms
10305 : EVENT: WiFi#Connected
10323 : ACT : timerSet,3,0
10331 : Command: timerset

I see that you already commented expecting a wrong build. I think my try does confirm this.
I will try your build also right now.

@2bontb
Copy link
Author

2bontb commented Feb 25, 2019

TD-er; I can confirm that your build works,.

@TD-er
Copy link
Member

TD-er commented Feb 25, 2019

I already cleared the caches on Travis and made sure there was only one build active.
So there should be a completely clean build cache right now.

Maybe I will change the settings for Travis to keep as little cached as possible, to prevent issues like these.
Tonight there will be a new build, so if you could try that one tomorrow, that would be great.

@TD-er TD-er added the Status: Fixed Commit has been made, ready for testing label Feb 25, 2019
@TD-er
Copy link
Member

TD-er commented Feb 26, 2019

I have absolutely no idea what's wrong here.
The build I made myself is working just fine, but also the build made last night is failing as described here.

@TD-er TD-er removed the Status: Fixed Commit has been made, ready for testing label Feb 26, 2019
@2bontb
Copy link
Author

2bontb commented Feb 27, 2019

TD-er,
I have the feeling that my original problem was also due to "the" build error. The symptoms are completely the same with the last build as with my original problem. I had this already with release 20190116 loading the distributed binary. You may want to try those distributed builds also on your system to see on what build it started.
Let me know if I can help with anything.

Other qustion: To allow builds with Arduino IDE I have to do some code changes; Should I raise also tickets for those two changes I make every time; Alsoforloading the ITHO plugin, I need to make some changes. I never reported that build error.

@TD-er
Copy link
Member

TD-er commented Feb 27, 2019

Please make a pull request for those changes.

And I have some idea of what's wrong with the build here and I also tried to build it locally in Linux and it fails the same way as the nightly build.
Only thing is, that if it appears to be the issue I'm thinking about, then we may have some bigger issue at hand and a lot of code to check. (or find a way to detect the issue at run time and report an error)

@Barracuda09
Copy link

Barracuda09 commented Feb 28, 2019

@TD-er What can we do to help and were should we look at in the code?

Nice that you have some idea to what can couse this problem

@TD-er
Copy link
Member

TD-er commented Feb 28, 2019

I have to change to code in this plugin to no longer use a struct like is now used to keep track of the different settings for different modules.
It seems like the Windows compiler does something different here than the Linux compiler regarding alignment of data stored on the flash.

@Barracuda09
Copy link

@TD-er Yes maybe it is not a good idea to depent on alignment of data in combination with compilers

TD-er added a commit to TD-er/ESPEasy that referenced this issue Feb 28, 2019
)

No longer use a flash stored struct, since it may lead to crashes when built on Linux.
@TD-er TD-er added the Status: Fixed Commit has been made, ready for testing label Feb 28, 2019
@TD-er
Copy link
Member

TD-er commented Feb 28, 2019

It should be fixed.
Before I merge it, I will build it in Linux and test on my node here, but I see no reason why it shouldn't work like this.

TD-er added a commit that referenced this issue Feb 28, 2019
[HLW8012] Fix build difference between Linux/Windows (#2355)
@TD-er TD-er closed this as completed Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Plugin Related to supported sensors Status: Fixed Commit has been made, ready for testing Type: Bug Considered a bug
Projects
None yet
Development

No branches or pull requests

3 participants