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

Sonoff Pow crash with high-wattage appliances #3

Closed
xoseperez opened this issue Nov 17, 2016 · 8 comments
Closed

Sonoff Pow crash with high-wattage appliances #3

xoseperez opened this issue Nov 17, 2016 · 8 comments

Comments

@xoseperez
Copy link
Owner

Originally reported by: Dave Arter (Bitbucket: davearter, GitHub: Unknown)


Thanks for the espurna firmware project, it's awesome. After reading your blog post about the Sonoff Pow I thought I'd give it a try on some Pows I've got here.

I understand the Pow support is very experimental but thought I'd let you know of a crash I'm seeing in case it's helpful. When running a device such as a toaster or kettle via the Pow the firmware crashes soon after switching the appliance on. The Pow restarts and subsequent power output readings are all 0, despite the appliance being powered on.

I managed to capture the serial output when the crash occurs, which I've attached. I've removed the device id and tidied up the whitespace/linebreaks but other than that it's as it appears.

I'll keep experimenting to see if I can find the threshold at which this bug is triggered.

@xoseperez
Copy link
Owner Author

Original comment by Dave Arter (Bitbucket: davearter, GitHub: Unknown):


For more context, I ran the stacktrace through xtensa-lx106-elf-addr2line and this was the result:

epc1:
0x4021ab8c: hlw8012_cf_interrupt() at ??:?

stack:
0x40107218: interrupt_handler at ??:?
0x401009c2: ppEnqueueRxq at ??:?
0x4010078f: ppProcessTxQ at ??:?
0x401071e0: interrupt_handler at ??:?
0x4000050c: ?? ??:0
0x400043a8: ?? ??:0
0x4021ab98: hlw8012_cf_interrupt() at ??:?
0x4010727c: interrupt_handler at ??:?
0x40107266: interrupt_handler at ??:?
0x4000050c: ?? ??:0
0x401048f9: ets_timer_disarm at ??:?
0x4000050c: ?? ??:0
0x401071e0: interrupt_handler at ??:?
0x4000050c: ?? ??:0
0x40000f68: ?? ??:0
0x40000f58: ?? ??:0
0x400042db: ?? ??:0
0x40004b31: ?? ??:0
0x40104e5e: spi_flash_read at ??:?
0x401076b8: pvPortZalloc at ??:?
0x40222105: pm_set_sleep_time at ??:?
0x402225a6: pm_get_sleep_type at ??:?
0x40222653: pm_get_sleep_type at ??:?
0x40203648: delay_end at ??:?
0x40225325: ets_timer_handler_isr at ??:?
0x4022536a: ets_timer_handler_isr at ??:?
0x40202e83: loop_task(ETSEventTag*) at core_esp8266_main.cpp:?
0x40000f49: ?? ??:0
0x40000f49: ?? ??:0
0x40000f49: ?? ??:0
0x4010f000: ?? ??:0

@xoseperez
Copy link
Owner Author

Hi

Thanks for reporting this!
Can you copy the code you are using to test the library? Also: what's the nominal power of the toaster?

@xoseperez
Copy link
Owner Author

Original comment by Dave Arter (Bitbucket: davearter, GitHub: Unknown):


The toaster is marked as 1000W on the bottom, and the kettle is 2750W. I'm using the standard espurna master branch, deploying to a Sonoff Pow with platformio run --target upload -e sonoff-pow-debug

@xoseperez
Copy link
Owner Author

I have managed to reproduce it with a ~1kW load but I'm still debugging.
In the meantime I have changed the code to use non-interrupt driven mode in the HLW8012 library and it works pretty well.

@xoseperez
Copy link
Owner Author

Version 1.4.4 uses latest HLW8018 library that fixes some volatile variable assignations. Back to interrupt driven approach runs now fine with 1kW loads, tested over the last 24h.

@xoseperez
Copy link
Owner Author

Original comment by Alexander Christian (Bitbucket: alexander_christian, GitHub: Unknown):


I'm using just the HLW8012 lib with my own sketch, which includes a webserver presenting the measurements...

When using interrupts and having "nothing" attached to the POW (=no load at all), I face the same stacktrace when opening/loading the webpage.
So I guess it's not really load-related, but rather a kind of interrupt issue. Maybe in combination with the webserver.

If I switch to non-interrupt-mode, there is no crash. But Having precise measurement without interrupt will block the webserver :-(

So I'm a bit lost... :-(
As this is not related to espurna, I will open an issue on the HLW lib itself.

@xoseperez
Copy link
Owner Author

Original comment by Alexander Christian (Bitbucket: alexander_christian, GitHub: Unknown):


Link to the issue on HLW lib: https://bitbucket.org/xoseperez/hlw8012/issues/1/esp-crash-when-using-interrupts-webserver

@xoseperez
Copy link
Owner Author

Fixed with HLW8012 library update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant