Announcement

Collapse
No announcement yet.

Energy Monitoring Smart Plug for under $10

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

  • Michael McSharry
    started a topic Energy Monitoring Smart Plug for under $10

    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.

  • taylormia
    replied
    The ANCCY info was part of the BN-LINK template page. See the link for this page in my post above. ANCCY is supported with tuya-convert. See this page: https://github.com/ct-Open-Source/tu...atible-devices

    Leave a comment:


  • Michael McSharry
    replied
    Great!

    I did not know about templates. Thanks for pointing me to something new. I see that the template provides the functionality for special chips such as the one this module uses for energy monitoring.

    Where did you find the info about the ANNCY? Is it something supported in current Tasmota builds?

    Leave a comment:


  • taylormia
    replied
    Just wanted to follow up on this. I successfully flashed my 4-pack of the BN-LINK plugs with tuya-convert using the Proxmox container documented here:
    https://github.com/whiskerz007/proxm...vert_container . It's very convenient if you run ProxMox. If not, here's the tuya-convert github page for the normal process: https://github.com/ct-Open-Source/tuya-convert

    I flashed with the built-in sonoff-basic.bin file and configured the module using the tasmota template for the BN-LINK - and it works great:

    https://blakadder.github.io/template...nk_bnc-60.html


    All four plugs needed to be power calibrated - which was easy to do following the tasmota wiki here: https://github.com/arendst/Sonoff-Ta...ng-calibration

    Here's the plug web page after calibration with a 40w incandescent lamp:


    Thanks again Michael for your guidance, excellent support and awesome plugin:

    Leave a comment:


  • Michael McSharry
    replied
    Thanks for the suggestion, I already took care of the mcsTasmota.zip and left the SSID blank to force AP mode. I will update the manual too just to make others aware of what we learned.

    Leave a comment:


  • taylormia
    replied
    Michael, No apologies necessary. I am learning as you are with this experience...and in my opinion - having a bricked device once in a way is a fair price to pay
    Also, I should have asked you the about the correct procedure to flash your binary instead of assuming that I could directly flash it with tuya-convert.
    As far as the bricked plug - I will return it for a replacement.
    I just succeeded in flashing the sonoff_basic.bin on to another BN-LINK and doing a firmware upgrade to the mcsTasmota image. I will play with the power calibration after I get my replacement plugs.
    A couple of suggestions. Please add in your mcsMQTT manual to first do the flash 3 option on the BN-LINK before upgrading to your mcsTasmota image via "Firmware Upgrade" on the tasmota web page. Also, perhaps change the SSID/password in your image to be WPA compliant.
    Thanks again for all your help with this and your awesome mcSMQTT plugin!

    Leave a comment:


  • Michael McSharry
    replied
    Sorry to put you through all of this. I can confirm that when a AP is setup using WEP/ASCII that Tasmota does not connect.

    I had a router provided by my ISP and it came with SSID of default and no password. The open system worked for me since I live in a very remote area. When I replaced it with a Ubiquiti AP a couple years ago I was more sensitive of security so never ran into a WPA key length problem. I learned a few things working with you on this.

    It is not that hard for me to reflash it via serial since I know the layout. If you are interested in sending it to me rather than discarding it I can paypal you $10. Let me know at mcsSolutions at CenturyTel dot net if you are interested.

    Leave a comment:


  • taylormia
    replied
    Michael, here's what I found trying to get the mcsTasmota flashed BL-LINK to connect to the "default" SSID with "default" password on an old router with DD-WRT.

    Using WPA or WPA2: the minimum length of the password required is 8. "default" is 7 characters - so this cannot be configured on any WPA/WPA2 router
    Using WEP: "default" as a passphrase can be configured, but the plug does not connect. WEP network passwords are hexadecimal strings known as keys. A WEP network can have 4 different keys; each key is assigned a "Key Index" value. For WEP encrypted networks, you need the SSID, the key, and key number.
    From the mcsTasmota "my_user_config.h" file I do not see any configuration for a WEP hexadecimal key or key number

    Also, I found the following code in the tasmota "support_wifi.ino" file that leads me to believe that WEP is not supported in tasmota while WPA is supported.

    ************************************************************ **********
    void WifiWpsStatusCallback(wps_cb_status status)
    {
    /* from user_interface.h:
    enum wps_cb_status {
    WPS_CB_ST_SUCCESS = 0,
    WPS_CB_ST_FAILED,
    WPS_CB_ST_TIMEOUT,
    WPS_CB_ST_WEP, // WPS failed because that WEP is not supported
    WPS_CB_ST_SCAN_ERR, // can not find the target WPS AP
    };

    / Enable from 6.0.0a until 6.1.0a - disabled due to possible cause of bad wifi connect on core 2.3.0
    // Re-enabled from 6.3.0.7 with ESP.restart replaced by ESP.reset
    void WifiDisconnect(void)
    {
    // Courtesy of EspEasy
    WiFi.persistent(true); // use SDK storage of SSID/WPA parameters
    ETS_UART_INTR_DISABLE();
    wifi_station_disconnect(); // this will store empty ssid/wpa into sdk storage
    ETS_UART_INTR_ENABLE();
    WiFi.persistent(false); // Do not use SDK storage of SSID/WPA parameters
    }
    ************************************************************ *******

    So, because the mcsTasmota image has a built-in password of 7 characters, it will not connect to a WPA SSID due to WPA password requirements not being met, nor to a WEP SSID because WEP is not supported.
    Do you agree?

    I'm not willing to open the plug and mess with GPIO pins - so from my perspective - the plug is bricked.
    What are your thoughts?

    Leave a comment:


  • taylormia
    replied
    Got it. Thanks Michael for taking the time to explain. With the Luntak I used the flash 3 option which used the sonoff-basic.bin image. I will try with the old wifi router and report back.

    Leave a comment:


  • Michael McSharry
    replied
    You are correct about the objective.

    The easiest way to get the desired SSID setup in that plug is to have an environment that has a default/default SSID/pw. Your spare router would be easier than setting up a RPi or ESP8266 as a temporary router. If you are successful at this step then the BL-LINK should stop blinking to indicate that it is not connected to the default wifi network.

    A browser is then used from a device (phone/laptop) that is also connected to default/default so it can talk to the BL-LINK plug and then change the SSID to one you really want to use. After this step you can decommission the temporary router with default/default.

    Next step would be to go to your main router, or some other device that can tell you what IP the DHCP server gave to the BL-LINK. With this IP you can connect and finish the setup and put the plug into service.

    I'm not certain what protocol Tasmota uses when trying to connect to the SSID. The source has references to WPA2, WPA and WEP. I use WPA2 on my router and never tried other modes to see was Tasmota does.

    When you flashed the Luntak plug you likely had an image that had no SSID setup so Tasmota did not use station mode, but directly into access point mode. I was not aware until now that is what it did. When a SSID is defined then it goes into station mode and tries to connect to it. The 4 short button press causes it to go to AP mode, but if the module is not configured to map the GPIO pin to the button function then no way to do the 4 presses that it will recognize except if GPIO0 does the short presses. This is because the Sonoff Basic is the default module on a Tasmota build and it uses GPIO0 for the button.

    When in station modeTasmota continues to try to connect to the defined SSID(s). I believe the core Arduino 2.5.0 has the lower level logic that actually makes the connection attempts and would have the WPA/WEP logic.

    Leave a comment:


  • taylormia
    replied
    Thanks Michael for the flashing procedure for my remaining plugs. I'm good here. I use a Ubuntu VM with a USB Wifi adapter and an old Android phone to do the flashing with tuya-convert. Have done this on the Luntak plugs successfully.
    I'm not clear yet on the setting up of the default network:
    What is the purpose of the RPI Router? I have a spare RPI Clone and a spare wifi router. Am I trying to get the mcsTasmota flashed BL-LINK to connect to the default wifi SSID and get an IP address to which I can open a web page to configure the actual SSID the plug needs to connect to? If I use the wifi router, do I use WEP since I cannot use WPA? Sorry for being dense.
    Thanks

    Leave a comment:


  • Michael McSharry
    replied
    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.

    Leave a comment:


  • taylormia
    replied
    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.

    Leave a comment:


  • Michael McSharry
    replied
    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.

    Leave a comment:


  • taylormia
    replied
    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?

    Leave a comment:

Working...
X