Page 3 of 3

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

Posted: 17 Sep 2017, 12:13
by homeautomator24
Dear Papperone,

Would you mind to provide a link to the .bin file with the firmware you merged your updates into?
This would it make it easier to test and to provide further feedback.

Thank you for your great contribution to this topic.

Best
Homeautomator24

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

Posted: 17 Sep 2017, 20:06
by phoenix_e
Dear Papperone,

I second that request from Homeautomator24.
Spend the last couple of hours trying to compile the bin file.
But on two different systems using both the latest Arduino software and the older version 1.6.12 it kept throwing errors.

If you could make the bin available for a 4mb esp I would greatly appreciate it.

With kind regards,
E

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

Posted: 20 Sep 2017, 09:55
by rol-rider
I compiled the new file.
available on the forum jeedom

https://www.jeedom.com/forum/viewtopic. ... 12#p517212

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

Posted: 20 Sep 2017, 18:43
by homeautomator24
Thank you, Rol-rider.
After flashing, I get errors with looping reset during boot: see below.
Any idea why this happens? Anybody can reconfirm? Using a 4M Sonoff Pow.

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

load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v09826c6d
~ld
⸮U


INIT : Booting version: (custom)
INIT : Warm boot #29
FS : Mounting...
FS : Mount successful, used 72288 bytes of 113201
INIT : Free RAM:26568
INIT : I2C
INIT : SPI not enabled

Exception (29):
epc1=0x4000e1c3 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000018 depc=0x00000000

ctx: cont
sp: 3fff3900 end: 3fff3da0 offset: 01a0

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

Posted: 20 Sep 2017, 23:00
by phoenix_e
Hi Rol-Rider,

I also tried it on a Sonoff POW 4M.
For me it works fine.

It took a couple of tries before the flashing completed succesfully.
But that was the same case with the standard ESPEasy bin files.
Might be the cheap USB serial adapter.

You really helped me out. :D

Merci Beaucoup

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

Posted: 21 Sep 2017, 00:32
by rol-rider
@ homeautomator24,

sonoff pow is 1M not 4M.

I had the same thing through OTA.

I have (with USB serial adapter)
--flash R120 V1(file ESPEasy_R120_1024.bin)
(wait erase sector)
--and flash the file in V2.0.0
after it's good.

sorry for my English (google translate)

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

Posted: 21 Sep 2017, 18:16
by homeautomator24
Merci Beaucoup, Will try again :-) A bientot

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

Posted: 22 Sep 2017, 17:47
by homeautomator24
Dear, rol-rider, All,

I took the recent .bin file provided by rol-rider, configured HLW8012 with GPIO-5/-13-14 as described many times above. Needed to free up I2C GPIOs now to GPIO-1/-3.
Power Factor and Power works fine after calibration.
However, Voltage and Current remain in 0.

Anybody any idea why this happens?
Would anybody like to post the assignment of GPIO pins in a working Sonoff Pow environment?

Thank you.
Homeautomator24

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

Posted: 22 Sep 2017, 20:36
by BerndJ
rol-rider wrote: 21 Sep 2017, 00:32....sonoff pow is 1M not 4M......
Hi,

meanwhile i had 15 pcs of the pows and all have 4M.

best wishes

BerndJ

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

Posted: 21 Nov 2017, 16:41
by sm0k0
Hi around there.
maybe somebody could help me with compiling P170_HLW8012.

I have installed Atom (1.22.1 / 64) and PlatformIO at version Home 0.3.2·Core 3.5.0b3. following the entire HowTo`s and use the latest Mega-branch on an Win10 x64.
I have installed all required deps and libraries.
Compiling for normal/test/dev at 4096 is working fine with the current GIT sources but as soon as i try to compile with _P170_HLW8012.ino i run into an error :
Linking .pioenvs\test_4096\firmware.elf
c:/users/sm0k0/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pioenvs\test_4096\firmware.el
f section `.text' will not fit in region `iram1_0_seg'
collect2.exe: error: ld returned 1 exit status
*** [.pioenvs\test_4096\firmware.elf] Error 1
I have already searched around Google and checked for the given hints on this issue (like heap.c and umm_malloc.c changes) deleted a lot of other plugins but no way........... :?

Any ideas to get that sorted would be much appreciated.

regards
sm0k0

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

Posted: 22 Nov 2017, 15:35
by sm0k0
Hi again,

looks like the issue is the poor memory on the ESP .....

i have used workaround in the meantime :
  • remove all unwanted plugins by excluding them from compiling, add at the very beginning of each plugin
#ifdef PLUGIN_BUILD_DISABLED

and as a last line in desired plugin to exclude
#endif
  • remove all unwanted libraries from the lib folder
in my case that gives me a image size of 426204 text and 7900 data (without _P170 @ 421440 text and 7860 data) with the minimum core plugins and which seems to run properly.

Btw: plugins like those for Oled, Wifigateway and RGBW and this Candle thing are eating a lot of the memory so you should get rid of them first.

best regards
sm0k0

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

Posted: 22 Dec 2017, 16:34
by NealXu
Hi...i am a new user here. As per my knowledge many ESPEasy users would like to see support for the SonoffPOW in their favorite software, until 2 weeks ago I was one of them, until I received my SonoffPOW from china by the mail.I was willing to give Espurna a chance, installed PlatformIO, learned to work with the basic commands and flashed my SonoffPOW.The webinterface looks indeed much different than the webinterface of ESPEasy but it works very intuitive. You have to use MQTT as protocol with a server. No other protocol is supported in Espurna. Domoticz can work with MQTT and communicates perfectly together with Espurna/SonoffPOW.

blind vias pcb

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

Posted: 05 Mar 2018, 21:14
by Irtimid_NL
Hello you all,

A newbie to Sonoff here and new to this forum too :)
First of all let me thank all of you who are looking into this Sonoff POW to get it to work with ESPEasy, it's much appreciated !

If been reading this thread a few times, looking on the Internet/YouTube and visited some other sites in order to get the POW to work with ESPEasy. However no luck so far :(
I've seen that a few of you people managed to get it to work, but unfortunately I don't understand how to get there.
So far I have tried different versions of ESPEasy but I don't get the "Voltage & Current" Selection in the Devices tab.
Reading this thread I noticed that some people build a .bin file to be used, but how do I transfer it to the POW and add it properly so the device will understand what to do with it ?

All I want to do with this POW I have is to switch on/off my small kitchensink boiler (which should work just fine as it is now, I just have to add it to Domoticz), but if I am able to read out the time it takes to heat up I can tweak the time to switch it on (&off). And hey, as I bought a POW I might aswell use the features it supports, right ?

Thanks in advance if you take time to help me out on this one. I really want to learn more about these devices and how they can help me to automate my house.

Irtimid

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

Posted: 24 Apr 2018, 21:40
by xury
Please help me.
How to set PLUGIN_SET_SONOFF_POW to compile in Arduino?

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

Posted: 24 Apr 2018, 22:00
by TD-er
xury wrote: 24 Apr 2018, 21:40 Please help me.
How to set PLUGIN_SET_SONOFF_POW to compile in Arduino?
By far the easiest is to write on the first line of ESPEasy.ino:

Code: Select all

#define PLUGIN_SET_SONOFF_POW
Please note that it is not yet tested, so please test with care and please report any issues.

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

Posted: 25 Apr 2018, 00:36
by xury
Thank You TD-er. I think at least I understood the define system.
Only one question:
I would like not touch too much in main files as I far away from code developing. So I read some info And prepare Custom.h file.
So can I put my custom definitions on custom.h ?
For eq

Code: Select all

#undef PLUGIN_BUILD_NORMAL
#define PLUGIN_BUILD_CUSTOM
#define PLUGIN_SET_SONOFF_POW // I don't know is the rigt place here (bottom) or on top?
#define <PLUGIN_WHAT_I_NEED>  // 
etc

Re: Support for "Sonoff Pow" (from ITead) with Power Consumption Measurement via HLW8012 (HLW 8012) IC?

Posted: 07 Aug 2018, 12:39
by kostett
How to calibrate HLW8012 device in ESPEasy mega web interface?
Why does I receive only Voltage and no other values?

Added:
Check that you're not using GPIO-14 elsewhere in settings explicit HLW8012 device.