Announcement

Collapse
No announcement yet.

Energy Monitoring Smart Plug for under $10

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Energy Monitoring Smart Plug for under $10

    Amazon has an upcoming 3 PM Pacific Lightning deal for 3 pack BN-LINK Smart WiFi Energy monitoring plug. It also has another 5% off in the listing. Even at list price these are the best value I have seen for 15A energy monitoring plug. I expect to reflash with Tasmota for HTTP or MQTT control.

  • #2
    Do you know if this plug can be flashed with tuya-convert ?

    Comment


    • #3
      That is how I expect to do it. I done about 1/2 dozen different brands and all with success. Of course don't know for certain until I try

      Comment


      • #4
        I just successfully flashed the Luntak plug today with tuya-convert. I'm going for the 4 pack of the BN-LINK since it looks like a great deal. How do I figure out the GPIO assignments if I'm able to flash it?

        Comment


        • #5
          It is detective work. I have done two dual energy plugs documented in http://mcsSprinklers.com/mcsMQTT.pdf. They both used the same GPIO for the energy module and varied in button and LED use. I started with Blitzwolf SHP config which used GPIO12 for BL0937 while same pin was Relay1 for the WS212 and NX-SP201. I typically start with generic module and pin by pin find the inputs best starting guesses are based upon a similar function module. Leave GPIO0 & 2 until I find some missing function at the end. These are special boot mode pins that could brick the device if done wrong. If that happens then need to open the device for serial flashing. Next is the relay. Then change to an energy module type and if it does not work then need to change source. For this one I will start with the WS212 template that I added to source.

          Once I charactize it I will update document and post.

          Comment


          • #6
            Thanks so much. Your mcsMQTT.pdf is very useful. Thanks for the info on the lightning deals too.

            Comment


            • #7
              Got my plug today and did the easy part of the characterization. Now I need to figure out the mapping of the three pins for the energy device BL0937. New builds needed for each attempt. I will continue tomorrow

              Here is what I have so far.
              Code:
                { "BN-LINK Energy",   // BN-LINK Energy Monitoring model BNC-60/U133TJ (ESP8286 - BL0937 or HJL-01 Energy Monitoring)
                                    // https://www.amazon.com/gp/product/B07CX5KLXN/ref=ppx_od_dt_b_asin_title_s00?ie=UTF8&psc=1
              
                   0,                // GPIO00 
                   GPIO_LED2_INV,    // GPIO01 Red Led (1 = On, 0 = Off)
                   0,                // GPIO02 
                   GPIO_KEY1,        // GPIO03 Button                                     GPIO_NRG_SEL_INV BL0937 or HJL-01 Sel output (0 = Voltage)  GPIO_USER, 
                   0,                // GPIO4 
                   0,                // GPIO05                                            GPIO_HJL_CF,      BL0937 or HJL-01 CF power
                                     // GPIO06 (SD_CLK   Flash)
                                     // GPIO07 (SD_DATA0 Flash QIO/DIO/DOUT)
                                     // GPIO08 (SD_DATA1 Flash QIO/DIO/DOUT)
                   0,                // GPIO09 (SD_DATA2 Flash QIO or ESP8285)
                   0,                // GPIO10 (SD_DATA3 Flash QIO or ESP8285)
                                     // GPIO11 (SD_CMD   Flash)
                   0,                // GPIO12 
                   GPIO_LED1_INV,    // GPIO13 Blue Led plug 1(1 = On, 0 = Off)
                   GPIO_REL1,        // GPIO14                                            GPIO_NRG_CF1 BL0937 or HJL-01 CF1 current / voltage
                   0,                // GPIO15 
                   0, 0
                }

              Comment


              • #8
                Thanks Michael. Great info. What do you mean by "new builds needed for each attempt"?

                Comment


                • #9
                  I finished the characterization. It is documented in http://mcsSprinklers.com/mcsMQTT.pdf Section 14.12.5. It contains the links to the binary and source based on Tasmota 6.4.1.

                  Tasmota has functions that are user-selectable and functions that are programmer-selectable. The relay, for example, can be selected for a Generic template pin use by user. The CF1 pin for energy monitoring is a programmer-selectable one. New builds are needed to map programmer-selectable functionality.

                  Since I did not know for certain which power monitoring chip was being used and so many combinations would be needed I decided to pop the top off of the plug. I was able to confirm the BL0937 was used and able to make a reasonable guess on pins based upon the marking and an ohm meter.

                  Comment


                  • #10
                    Thanks for the effort in this characterization. I plan on working on my plugs in the next few days. Btw, the link to the binary tasmota file on pg.193 gets a Not Found 404 error.

                    Comment


                    • #11
                      Thanks for letting me know about the hyperlink. It just spanned too many words. It has been corrected.

                      I find the energy plug in concert with Tasmota rules to be the easiest way to notify when activity completes such as a load of laundry. Thinking about it, I installed a new dishwasher last year and used a j-box and plug so I could put one on it to provide dishes done notification. Thinking again, I really do not want to pull the dishwasher just for this reason. Microwave may be good. Just need to check amperage requirements.

                      Comment


                      • #12
                        I attempted to flash the BN-LINK with your mcsTasmota641B.bin using the
                        curl "http: //10.42.42.42/flashURL?url=http: //10.42.42.1/files/mcsTasmota641B.bin"

                        I see this in the log:
                        [I 190314 12:01:37 web:2246] 200 GET /files/mcsTasmota641B.bin (10.42.42.42) 15026.23ms

                        It is supposed to reboot and give me a sonoffxxxx SSID to connect to - but it does not. The power switch LED keeps blinking blue even after disconnecting and reconnecting power. Holding the power button down for 5 sec does not change LED blinking behavior. Did I brick the plug? what do you think went wrong?
                        Was I supposed to flash with the sonoff-basic.bin first and then upgrade via web page to your binary?

                        Comment


                        • #13
                          I have always used option 3 (flash3) as the first image with tuyaconvert. I think you have my Tasmota image flashed and now trying to get wifi connection.

                          Two suggestions.
                          1. The image has default/default for ssid & password so setup an old router to provide this access point.
                          2. Four short presses of a standard module will put device in AP mode where you can connect via 192.168.4.1. I think the problem will be that the button pin on this device is not what Tasmota is expecting so it will not know that you are pressing the button. Give it a try.

                          Comment


                          • #14
                            The four short press method does not work. I tried to set up "default" as the Guest SSID on my existing AP..but WPA requires an eight character password and "default" is 7. I tried no password but the plug does not connect. Any ideas?
                            What is correct method to flash your binary on the plug. Should I flash option 3 (flash 3) first..then what? thanks for the assist.

                            Comment


                            • #15
                              The method I use is option 3. Connect to the Sonoff AP. Connect laptop wifi to Sonoff AP SSID. Setup WiFi credentials to network with browser url 192.168.4.1. Look at DHCP server to find IP assigned and connect to it with browser. Firmware upgrade to desired image. Configure image to be BL-LINK module and other configuration as desired.

                              Make your RPi a router so you can create the default network. You could flash a new SD or backup and update your current one. I have never done it, but google search has many hits. I also saw one at https://www.mysensors.org/build/esp8266_gateway to do it with an ESP8266. See if a neighbor or friend has a spare router to use temporarily.

                              The configuration that comes up by default is for a Sonoff Basic. It expects button on GPIO0. GPIO0 is available on the digital card of the plug, but quite hard to get access to the board and then the pin. I also would not want to play with it after it is plugged into the mains. 3.3V and Gnd are available on the connection between the mains circuit and digital circuit cards. The digital edge connector contains the following signals. Only the backside edge and a pad on the backside for GPIO0 are needed.
                              From left to right - 3.3v, gnd, Rx, Tx, GPIO12, GPIO14 on the back side of the digital.
                              RST, A0, GPIO13, GPIO4, GPIO5 on the front side.

                              This is a long way to go and much easier to get a default network setup.

                              Comment

                              Working...
                              X