AWP07L Wifi Socket

2,739 views
Skip to first unread message

Ciaran Baulig

unread,
Aug 17, 2018, 11:57:03 AM8/17/18
to SonoffUsers

Philip Knowles

unread,
Aug 18, 2018, 4:30:27 AM8/18/18
to Ciaran Baulig, SonoffUsers

If you can upload a pic someone may be able to work it out for you.

 

Regards

 

Phil K

 

Sent from Mail for Windows 10

 

From: Ciaran Baulig
Sent: 17 August 2018 16:57
To: SonoffUsers
Subject: AWP07L Wifi Socket

 

Hey,

 

I recently bought a new smart socket that uses an ESP8266EX. Unfortunately I don't know which pins I should solder to to upload Tasmota (no labeling on the PCB). Can anyone help me out here?

 

Thanks in advance.

 

ciB

--
You received this message because you are subscribed to the Google Groups "SonoffUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

Ciaran Baulig

unread,
Aug 18, 2018, 6:44:40 AM8/18/18
to SonoffUsers

IMG_20180817_174431_787.jpg

I did upload a picture.. didn't that work? Here is another one 

Phil

unread,
Aug 18, 2018, 12:07:25 PM8/18/18
to SonoffUsers
https://www.esp8266.com/wiki/doku.php?id=esp8266-module-family

looks similar to an -04 module but with contacts on more than 2 opposing sides????
might be a custom job..

skilled folk can with tiny wires solder connections to the microchip legs, check out the upgrades to expose further gpio pins on the esp8266-01 modules..  

that might be the easiest option if its a custom board and not a standard module??

David

unread,
Aug 24, 2018, 9:47:24 AM8/24/18
to SonoffUsers
Hi,

maybe i can shed some light. I also ordered a set of those sockets which arrived yesterday. I successfully flashed them with tasmota today after figuring out the pinout of the ESP-board by simply checking which ESP8266EX pins are connected to which pins of the ESP-board/pcb (see attached picture).

I'm running tasmota v5.14.0, because with other sockets/switches, i had some bad experiences like repeated reset/relais flicker and inaccessible devices with the latest version.

Now i'm struggling with the GPIO mapping. When selecting the Sonoff Pow from the module config, the socket is at least switchable using the web UI, but the metrics shown after switching it on is crap.
When selecting generic, the following pins can be configured to get relais, button and led working:
GPIO0 - Led1i
GPIO13 - Button1
GPIO15 - Relay1

I have no experience in the power measurement/metrics stuff, perhaps someone can help. If we can figure out the pin mapping, it's just an entry in sonoff_template.h to get this socket to work including metrics :-) Because as far as i see, the HLW-pins are currntly configured as just program-selectable (not through UI). Which could of course also be changed...

Best regards
David

Am Freitag, 17. August 2018 17:57:03 UTC+2 schrieb Ciaran Baulig:
Hey,

I recently bought a new smart socket that uses an ESP8266EX. Unfortunately I don't know which pins I should solder to to upload Tasmota (no labeling on the PCB). Can anyone help me out here?

Thanks in advance.

ciB

AWP07L_Pinout.jpg

AWP07L_Pinout.jpg

David Windhausen

unread,
Aug 28, 2018, 4:41:09 AM8/28/18
to sonof...@googlegroups.com
Hi,

i finally found out how the ESP is wired. It's pretty similar to the BlitzWolf sockets. I upgraded to tasmota 6.1.1. and did some adaptions in the sources, and now it's working fine.

In addition to the before mentioned button, led and relay mapping, the following needs to be set (module type Generic):
GPIO5: GPIO_HLW_CF
GPIO12: GPIO_HLW_Sel
GPIO14: GPIO_HLW_CF1

As soon as those three HLW pins have been mapped, tasmota will execute the required code to provide energy metrics. By default, these pins can't be selected through the web UI, but you can change this by moving these pins from the ProgramSelectablePins enum to the UserSelectablePins enum in sonoff_template.h and recompiling the binary.
Of course, you may also add a new module type with the fixed mapping. There is a tutorial in the wiki on how this can be achieved.

As the ballast resistors seem to be different on the AWP07L compared to the BlitzWolf sockets, the predefined calibration/ratio will not fit and you will get implausible values for current, voltage and power.
To correct this, i attached a resistive load to the socket (some light bulb) and measured the real voltage and current and calculated the power. Then use the mqtt commands VoltageSet, CurrentSet and PowerSet with your measured/calculated values to calibrate the socket. This can be done using the console, f.ex. "cmnd/currentset 32" if you measured 32 mA. This needs to be done while the device is still switched on! After all three values are set/calibrated, the socket should show good values.

Hope this helps.

Best regards
David

Thomas Froitzheim

unread,
Oct 26, 2018, 9:40:24 AM10/26/18
to SonoffUsers
Hi,

could you please be so kind and provide the bin file of your modified tasmota firmware please?

Thank you!

Kind regards

Thomas

Sandro Sandro

unread,
Dec 1, 2018, 4:09:18 AM12/1/18
to sonof...@googlegroups.com

Houzetek AWP07L


This is all the pins in the back of the module.

95c9ob0tj2y11.jpg




esp8266_01.jpg


Message has been deleted

Hauke Walden

unread,
Dec 1, 2018, 11:19:19 AM12/1/18
to SonoffUsers
David,

thanky you very much, this was most helpful!
One question remains: If I use setCurrent(0.164), setVoltage(231) and setPower(40W), I do get the values as expected. However, If I then replace the 40W light bulb with a 12,5W, I get the correct Wattage (13), but the same current(0.164) as before and therefore of course a wrong voltage (82V). Shouldn't it be enough to set just 2 of the values?! I don't understand how the calibration mechanism works - maybe you can shed some even more light?

Thank you!

Sandro Sandro

unread,
Dec 1, 2018, 11:22:15 AM12/1/18
to SonoffUsers
I just flashed the socket with Tasmota, I am trying to assign GPIO with the generic template, but I didn't understand how to configure the Power Meter, I can't find the GPIO_HLW_CF, GPIO_HLW_Sel, GPIO_HLW_CF1 in the generic list.
Thanks.
Sandro.

Hauke Walden

unread,
Dec 1, 2018, 11:41:57 AM12/1/18
to SonoffUsers
Sandro,

see Davids two posts (https://groups.google.com/d/msg/sonoffusers/v0hEUKN5hpQ/MN5h_yAwAwAJ).
For the time being, you *must* change the source code in sonoff_template.h.

Here's what I have done:

1. Change the enum SupportedModules
{
/* keep the other existing modules */ ...
/* add this line before MAXMODULE: */
AISIRER,
MAXMODULE
};


2. Add the module to the kModuleNiceArray:

(add it whereever you like, I choose some place in the middle)

SK03_TUYA,
AISIRER, // <-- here!
NEO_COOLCAM, // Socket Relay Devices

3. Add this to the enum at the end of the file:

{
"AWP07L", // Aisirer DIN with Energy Monitoring
GPIO_LED1_INV, // GPIO00 Blue LED behind the button
0, // GPIO01
0, // GPIO02
0, // GPIO03
0, // GPIO04
GPIO_HLW_CF, // GPIO05 BL0937 or HJL-01 CF power
0, // GPIO06
0, // GPIO07
0, // GPIO08
0, // GPIO09
0, // GPIO10
0, // GPIO11
GPIO_NRG_SEL, // GPIO12 HLW8012/HLJ-01 Sel output (1 = Voltage)
GPIO_KEY1, // GPIO13 Button
GPIO_NRG_CF1, // GPIO14 HLW8012/HLJ-01 CF1 voltage / current
GPIO_REL1, // GPIO15
0, // GPIO16
0 // GPIO17
}


Build a minimum image, flash it, build a standard image, flash it, and select "AWP07L" from the device list. Afterwards, don't forget to calibrate (as David has described above).

Good luck!

Hauke Walden

unread,
Dec 1, 2018, 11:44:24 AM12/1/18
to SonoffUsers
Oh, and: yes, the names for

GPIO12: GPIO_HLW_Sel
GPIO14: GPIO_HLW_CF1

are either wrong or have changed since 6.1.

They are replaced by 

GPIO_HLW_Sel -> GPIO_NRG_Sel
GPIO_HLW_CF1 -> GPIO_NRG_CF1

Sandro Sandro

unread,
Dec 2, 2018, 9:58:06 AM12/2/18
to SonoffUsers
Oh wow thank you, perfect explanation, I've changed the sonoff_template.h and used a power meter to calibrate the Houztek smart plug.
Looks like it is perfectly working.
Thanks Hauke / David


Screenshot 2018-12-02 at 15.51.07.png

Screenshot 2018-12-02 at 15.51.21.png

Gianluca Perez

unread,
Jan 11, 2019, 3:18:12 PM1/11/19
to SonoffUsers
Hi to all,
I'd tried to follow your instructions but now i've a plug that has a blue led always on and that is alway active. The fisic button do not shut off the plug and the plug do not connect via wifi.

Can anyone help me please?

I'd used atom and platformio to flash, used the last Tasmota release, changed the sonoff_template.h as Hauke said, then flash first minimal then standard image

Message has been deleted

wolly Domotica

unread,
Mar 14, 2019, 10:05:17 PM3/14/19
to SonoffUsers
Ciao 
Che valori hai usato per calibrare la presa??
grazie

Phil

unread,
Mar 14, 2019, 10:14:32 PM3/14/19
to SonoffUsers
Check the wiki for calibration instructions with a known load.

btw hope you did an OTA flash using the tuya-convert method

the 'smart life' app indicated in the op#s link indicates these devices are OTA flashing compatible.

wolly Domotica

unread,
Mar 15, 2019, 5:27:11 AM3/15/19
to SonoffUsers
ho fatto la calibrazione 
ma se metto un carico diverso della lampadina da 60watt.
Va rifatta sempre la calibrazione ??
i dati sono corretti solo con la lampadina

Phil

unread,
Mar 15, 2019, 9:28:07 AM3/15/19
to SonoffUsers
while i am no electrician, my understanding si that its the supply that may vary from location to location, by calibrating with a known load such as a 60w bulb your device is calibrated to your supply for the range of loads you pull through the switch, so no once done with a 60w load you are done ;)

Philip Knowles

unread,
Mar 15, 2019, 1:13:25 PM3/15/19
to Phil, SonoffUsers

There’s a problem with this though. This table shows the results for differing voltages

V

I

R

W

250

0.260417

960

65.10417

245

0.255208

960

62.52604

240

0.25

960

60

235

0.244792

960

57.52604

230

0.239583

960

55.10417

225

0.234375

960

52.73438

220

0.229167

960

50.41667

The only constant is the resistance so at 235V your 60W bulb is only using 57.5V of Power.

 

What you should really do to calibrate is to measure the resistance of the bulb and then measure the Voltage. You can then use Ohm’s Law to calculate the Current. If you put those 2 values in you should have a true calibration. To be really accurate you should measure the resistance of the bulb when it’s hot.

 

Sent from Mail for Windows 10

 

--

Colin Law

unread,
Mar 16, 2019, 4:38:57 AM3/16/19
to SonoffUsers
I don't think the calibration technique on the wiki is the best way.  I think the best way is to connect to a load such as a bulb or resistor that we know should have a power factor of 1 (which means it is resistive, not inductive).  Then use a meter to measure the current and voltage and put those in.  Since we know that the power factor is 1 you can then calculate the power as Volts * Current (in amps) and put that in. Finally check that power factor is 1, if not you have made a mistake in the calcs.  This technique does require that you have a meter capable of measuring the AC current.  Obviously take great care when using the meter, there is always the danger of death when doing this sort of thing.  I advise always disconnecting the power, connect the meter up in a way that does not require holding probes onto terminals, so use croc clips or similar, power up and take the reading, then disconnect the power again.

Colin

wolly Domotica

unread,
Mar 26, 2019, 10:27:33 AM3/26/19
to SonoffUsers
someone knows how to open this socket.
AWP08L 16A
IMG_4110.HEIC
IMG_4107.HEIC
IMG_4108.HEIC
IMG_4109.HEIC

Phil

unread,
Mar 26, 2019, 2:03:15 PM3/26/19
to SonoffUsers
I dont think you need to!  google led me here http://www.avatarcontrols.com/index.php?ac=article&at=read&did=191 and scrolling down the page revels the free app used to control the device out of the box is 'Smart-Life'

Smart-Life is the app used to control devices that usually contain the tuya esp8266 module. And these can currently be reflashed OTA using the tuya-convert method :)  You will need a Pi3B or 3B+,  a 4Gb+ micro sd card and a mobile phone or tablet you can use to connect to a temporary AP during the procedure.  It takes about an hour do prep the pi (flash sd card and run updates/installations) but once prepped the sd card is a ready to boot ota flashing device you can use in 10 minutes..   https://www.youtube.com/watch?v=O5GYh470m5k

wolly Domotica

unread,
Mar 26, 2019, 2:19:31 PM3/26/19
to SonoffUsers
flash my code


Il giorno martedì 26 marzo 2019 19:03:15 UTC+1, Phil ha scritto:
I dont think you need to!  google led me here http://www.avatarcontrols.com/index.php?ac=article&at=read&did=191 and scrolling down the page revels the free 



Phil

unread,
Mar 26, 2019, 2:26:43 PM3/26/19
to sonof...@googlegroups.com
Yes you can use this method to flash any firmware that will fit/work

FLASH third-party firmware

BE SURE THE FIRMWARE FITS YOUR DEVICE!

  1. Place or link your binary file to ./files/thirdparty.bin.

    Currently a Sonoff-Tasmota v6.5.0 basic build is already included. It will open an WiFi access point named sonoff-XXX. Please note that while we include this for your convenience, we are not affliated with the Sonoff-Tasmota project and cannot provide support for post installation issues. Please refer to the respective project for support.

    Binary requirements:

    • full binary including first-stage bootloader
    • maximum filesize 512KB for first flash
  2. Start flashing process

     # curl http://10.42.42.42/flash3

Alternatively you can request a certain file to be requested and flashed by the device:

# curl http://10.42.42.42/flash3?url=http://10.42.42.1/files/thirdparty.bin


from https://github.com/ct-Open-Source/tuya-convert

so just replace the sonoff v6.5 bin file (thirdparty.bin) with your own

paukl

unread,
Mar 26, 2019, 3:19:18 PM3/26/19
to SonoffUsers
Cool, also got my AWP08L sockets today and planning on falshing them via the tuya-convert method.
Need to set up a pi, or find a usbstick to boot linux off first ^^

* Only thing I'm wondering: is there a pre-built firmware that works with that device?
* What happens if I choose a wrong one, can i still go back with that undo command (given the dumping of the firmware worked before)?

thx!

Anders Frihagen

unread,
Mar 27, 2019, 4:26:17 PM3/27/19
to SonoffUsers
The problem about measuring the resistance of a lightbulb is that the resistance is low at room temperature, and increases (dramatically) while lit.....

AF-J

unread,
Dec 9, 2019, 3:36:21 AM12/9/19
to TasmotaUsers
Hi, 
Does anyone has the original firmware for the socket? I think I have broken it somehow trying to install third party firmwares.. and I would like to revert it and see if I could recover it somehow. 

Thanx!!

Utz Späth

unread,
Jan 11, 2020, 2:38:08 PM1/11/20
to sonof...@googlegroups.com
Could you please tell me, does it also works fine for small loads and without?

I just bought some Gosund SP112 and are totally unhappy because e. g. with no load it shows like 2 W and 8 VAr  ...with 250 W Hairdryer it shows fine 252 Watts and 0 VAr .. So I am about to buy a pack of Avatar AWP07L ..

//EDIT: To answer my own question: 0 Watts are 0 Watts for the AWP07L from Avatar but it also measures way slower.. SP112 like 3 values per second but AWP07L is more like 1 value every 3 seconds ;-)
Also this is the correct template for it, took me a while to figure out... 

{"NAME":"AWP07L","GPIO":[56,255,255,255,255,134,255,255,131,17,132,21,255],"FLAG":0,"BASE":18}

AF-J

unread,
Feb 1, 2020, 8:57:02 AM2/1/20
to TasmotaUsers
Hi, how did you disassembly the socket. I cannot find the way. Thanx!


El viernes, 17 de agosto de 2018, 17:57:03 (UTC+2), Ciaran Baulig escribió:

ROBERTO MONACO

unread,
Mar 6, 2020, 5:31:10 AM3/6/20
to TasmotaUsers
Hello,
I also have the same problem, have you solved somehow?
thank you!
Reply all
Reply to author
Forward
0 new messages