arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
21.98k stars 4.77k forks source link

Support for bl0940 energy monitoring - BW-SHP10 - and Support for 1.5 stop bits in serial communication #8175

Closed MadDoct closed 4 years ago

MadDoct commented 4 years ago

Have you looked for this feature in other issues and in the docs?
yes Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.

Describe the solution you'd like
A clear and concise description of what you want to happen. Provide suport for bl0940 energy monitoring chip as used by bw-shp10 Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here. It uses UART for communication connected to tx and rx, but also has CF connected to gpio14 it seems to use baudrate 4800 8N and 1.5(?!) stop bits - this may be the problem... I've tried to comunicate with it using serialsend, but can't... Maybe due to the stopbits - tried 8N1 and 8N2 datasheet - http://www.belling.com.cn/media/file_object/bel_product/BL0940/datasheet/BL0940_V1.1_en.pdf

(Please, remember to close the issue when the problem has been addressed)

Lefuneste83 commented 4 years ago

I haven't had any unexpected power off since yesterday. I still need to validate the power indicator against a known load.

yoyolb commented 4 years ago

Hello guys.

@arendst I upload the latest development binary from thehackbox (build time: 20200614 16:01 GMT+2, version 8.3.1.3, commit 3c4fb6c).

Made some tests with a SONOFF POW R2 and BW-SHP10 in series. It looks OK. Devices are not calibrated. The load is a water pump, alternatively working and not working for about 40 minutes.

Energy read on SONOFF POW R2: 0,499 kWh Energy read on BW-SHP10: 0,478 kWh

Since neither SONOFF nor BW are calibrated, I believe the difference (<5%) is "normal".

Thank you a lot.

CervDotBe commented 4 years ago

CurrentSet on this version (or device?) seems to be in A and not in mA as described in the documentation

corporalp commented 4 years ago

@arendst Can you explain how to open the SHP10? After flashing it is not responding any more so I would like to take a look tnx

arendst commented 4 years ago

The top is glued on the body. Using a small screwdriver wiggle the glue loose all around the surface and then you must be able to remove it

un1te commented 4 years ago

where can i find 8.3.1.3 version? can't see any sensors with {"NAME":"BW-SHP10","GPIO":[0,107,0,108,157,21,0,0,0,17,134,0,0],"FLAG":0,"BASE":45}. using 8.3.1

CervDotBe commented 4 years ago

http://thehackbox.org/tasmota/

where can i find 8.3.1.3 version? can't see any sensors with {"NAME":"BW-SHP10","GPIO":[0,107,0,108,157,21,0,0,0,17,134,0,0],"FLAG":0,"BASE":45}. using 8.3.1

http://thehackbox.org/tasmota/

AdamWeglarz commented 3 years ago

Hi,

I have this device. I managed to open it without destroying it completely, Can you share info how to flash Tasmota into it? I have found all pins beside gpio0.

122413093_354126735853019_1760284159668359467_n

arendst commented 3 years ago

Look at the picture up in this thread. It contains labels near the test points. One of them is called IO0. That's gpio0.

napcode commented 3 years ago

You can flash these devices with tuya-convert. There is no need to open them anymore.

AdamWeglarz commented 3 years ago

Hi,

I have one more question: {"NAME":"BW-SHP10","GPIO":[0,107,0,108,157,21,0,0,0,17,134,0,0],"FLAG":0,"BASE":45} I am using this template and power consumption is not realistic. It shows 2watts on ender 3 printing :D Should I calibrate it or there is better template? {"NAME":"BW-SHP10","GPIO":[0,148,0,207,158,21,0,0,0,17,0,0,0],"FLAG":0,"BASE":18} this works perfect My version is Tasmota Version 8.4.0.3

Adam

dogbolt commented 3 years ago

I have just successfully flashed 10 of these devices with tuya-convert, but in doing so I discovered and repaired an internal hardware fault resulting in completely dead device with no LED activity etc. My device did not have the power monitoring chip. Thanks to the contributors on this page who confirmed how to open the device. I caused negligible physical damage, and the device is back working OK now.

The approach I adopted was to squeeze the body of the device in a vice and then gently, one millimetre at a time, went around the groove with very fine flat-bladed screwdriver levering the 2 parts apart. Every couple of millimetres there was a slight 'snik' sound as the joint progressively cracked open. Then I was able to check the voltages on the board but all were zero relative to ground everywhere.

To get further inside, I had to unsolder the 3 large L N E connections to remove the circuit board assembly. On inspection all 4 solder connections between the rear board and the small riser board were completely cracked through and were not providing support nor electrical connection. I resoldered the joints and reassembled the unit. I was then able to flash it, and it is now working correctly.

I hope this will be of use to anyone looking for information on opening and repairing these units.

BW-SHP10-repair

peterk6502 commented 3 years ago

I did not read the tuya-convert instructions carefully, therefore I ended up with also with an dead SHP10 device. The curl trick didn't work also, therefore the only option left was to open the device and flash it directly. I have made some recordings and pictures, maybe it is to some use to somebody (see youtube link). https://www.youtube.com/watch?v=o0oZF238xc0

alexelite commented 2 years ago

Hi,

Last year I bought a dozen BlitzWolf BW-SHP10-P and opened them up using the vise method. I disassembled one completely and tested it without the black plastic shield. It started arcing the moment I plugged it in the outlet without any load connected. The distance between a capacitor from the power supply and one of the power prong mounting points is very small and it arched. Also it arched between what looks like a fuse and the earth connection. 20211125_203434 20211125_202949

The plastic shield was even embossed from the metal mounting point. 20211125_203530 20211125_202927

I used some playdough to check the distance and it is very tiny. 20211125_203944 The plastic shield has a low melting point so some excessive heating in that area could lead to arching.

The arching was not enough to trip the 30mA RCD or the 16A breaker and I don't have arc fault circuit interrupters installed. Probably with enough time it would lead to melting and even fire. To mitigate this I installed mica insulating sheets cut to size before reinstalling the PCB.

bilogic commented 1 year ago

image

  1. I have a device labelled swa9s which comes with power monitoring using the BL0940
  2. Using the swa9 (non PM) template, this swa9s's switch can be toggled on/off.
  3. I have tried the template {"NAME":"SWA9","GPIO":[0,0,0,0,288,224,0,0,3200,32,5056,0,0,0],"FLAG":0,"BASE":18} and {"NAME":"SWA9","GPIO":[0,0,0,0,288,224,0,0,5056,32,3200,0,0,0],"FLAG":0,"BASE":18} but both are giving me "gibberish"

Any idea what I can do? Thanks!

bilogic commented 1 year ago

image

On my 2nd unit, it reports all 0s, unlike the 1st unit , this was never powered on while it was using the Tuya firmware.

bilogic commented 1 year ago

Was the code tested only against BW-SHP10's BL0940? Or with others as well?

barbudor commented 1 year ago

The only other device in the template repository that is using BL0940 is this one https://templates.blakadder.com/homcloud_AS-SM1E.html Doesn't seem much common

So it's likely that Blitzwolf BW-SHP10P is probably the main device using it

From the datasheet, the BL0940 can also work in SDI mode. So could it be possible that your device use that other mode (which is currently not supported by tasmota) ?

Have you opened the device ? Can you try to find out how the BL040 is connected to the ESP ? Which GPIOs (all of them) ?

bilogic commented 1 year ago

GPIO

Front

Back

Yes, it's opened. These are the pins with solder points. As the device works (can toggle on/off with LED) with SWA9 template, GPIO 13, 4 and 5 should be correct. That leaves only GPIO 12 and 14.

bilogic commented 1 year ago

SWA9S

20230510_025607

Back pins

back

Front pins

front 20230510_031121

barbudor commented 1 year ago

You didn't track the GPIO to the BL0940 This is what we are looking for

If BL0940 is connected in Serial, it should be connected to TX (GPIO1) and RX (GPIO3) GPIO1/TX should be set to "Serial TX" and GPIO3/RX should be set to "BL0940 RX"

Or translated in "template" : {"NAME":"SWA9","GPIO":[0,3200,0,5056,288,224,0,0,0,32,0,0,0,0],"FLAG":0,"BASE":18}

bilogic commented 1 year ago

image

What does "track" mean? I simply went by deduction when I saw only GPIO 12 and 14 remaining. I reconfigured GPIO1 and GPIO3, now I'm getting the right voltage and probably temp!

Thank you!!

barbudor commented 1 year ago

"track" as in follow the path of someone or an animall

So follow the PCB tracks from the esp device to the other parts using eyes and optionaly a test device like an ohmmeter

Glad it works don't forget to go through the calibration process

And please add an entry in the template repository https://templates.blakadder.com/new.html

Le-Duc0069 commented 4 months ago

I have a problem that needs to be solved, I am connecting bl0940 with tasmota connected to GPIO16 and 17 but do not see the electrical measurement parameters. Can anyone help me fix this error? IMG_2046 IMG_2047