logo elektroda
logo elektroda
X
logo elektroda

Configuring GPIO and Power Monitoring Pins for Antela UK 13A Smart Plug with OpenBK7231N Flash

anthonythomas 1752 19
ADVERTISEMENT
  • #1 20495875
    anthonythomas
    Level 9  
    Hello,

    I have a number of Antela UK 13A Smart Plugs which have power monitoring.
    OpenBK7231N has flashed without any issues to the first one.

    Trying to figure out the GPIO config.
    So far I've figured out the important pins

    11 Led
    24 Rel
    26 Btn

    I now want to figure out the pins for the power monitoring - guessing BL0937.

    Is there an easy way to do this apart from attempting every combination of pins and channels with
    BL0937CF1
    BL0937CF
    BL0937SEL

    Configuring GPIO and Power Monitoring Pins for Antela UK 13A Smart Plug with OpenBK7231N Flash

    Configuring GPIO and Power Monitoring Pins for Antela UK 13A Smart Plug with OpenBK7231N Flash Configuring GPIO and Power Monitoring Pins for Antela UK 13A Smart Plug with OpenBK7231N Flash
  • ADVERTISEMENT
  • #2 20495882
    p.kaczmarek2
    Moderator Smart Home
    Hello, do you have original firmware backup from our BK7231 flasher?
    https://github.com/openshwprojects/BK7231GUIFlashTool
    Helpful post? Buy me a coffee.
  • #3 20495911
    anthonythomas
    Level 9  
    Sorry, I don't.
    I haven't attempted to do a teardown in case I damage the plug beyond repair.
  • #4 20495924
    p.kaczmarek2
    Moderator Smart Home
    How do you know it's not a BL0942? Maybe it would be worth to check if it's BL0942.
    How did you flash it without opening? Which profile did you use?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #5 20495931
    anthonythomas
    Level 9  
    I used tuya-cloudcutter to flash - OpenBK7231N_UG_1.15.597.bin
    Profile - tuya-generic-lspa7-plug
  • ADVERTISEMENT
  • #6 20495974
    p.kaczmarek2
    Moderator Smart Home
    Have you tried checking templates list?
    https://openbekeniot.github.io/webapp/devicesList.html
    I can see at least two LSPA7 versions here:
    Configuring GPIO and Power Monitoring Pins for Antela UK 13A Smart Plug with OpenBK7231N Flash
    Helpful post? Buy me a coffee.
  • #7 20634736
    baukje
    Level 5  

    Have you had any luck getting the power monitoring to work on these?
    I have a bunch arriving tomorrow. Did you verify the Tuya version before flashing?
    Have you been able to export the flash with the openbeken web app?
    I would rather avoid opening if possible.

    Cheers
  • #8 20634763
    p.kaczmarek2
    Moderator Smart Home
    @baukje you can try yourself, here's how to get Tuya JSON config from OpenBeken device via WiFi:
    https://www.youtube.com/watch?v=WunlqIMAdgw&t=1s&ab_channel=Elektrodacom
    Helpful post? Buy me a coffee.
  • #9 20634802
    baukje
    Level 5  

    Yes, I'll try. I hope they are the same, that's why I am looking for any clues that might help confirm without opening.
    Is the same model number F1s302-UK?
  • ADVERTISEMENT
  • #10 20636665
    baukje
    Level 5  

    First step is getting the correct openbeken version onto the device.
    How confident can I be that this is BK7231N and not "T"?

    I attached to one with the smartlife app.
    the version shows as:
    Configuring GPIO and Power Monitoring Pins for Antela UK 13A Smart Plug with OpenBK7231N Flash

    Added after 2 [hours] 9 [minutes]:

    Mac address identity
    Address Prefix FC:67:1F
    Vendor / Company Tuya Smart Inc.
  • #11 20646933
    baukje
    Level 5  

    So half of the plugs I got were patched (1.1.12) and have to be opened, and the rest are slightly older and unpatched (1.1.8) but work (with difficulty in tuya-cloudcutter).

    openbeken flashed, but how do I use the power monitoring? All the pins were discovered from backup, but I don't see power output in the webUI or in MQTT... How do I enable?
  • #12 20646951
    p.kaczmarek2
    Moderator Smart Home

    Hello, how does your GPIO config look like? What do you have on the main WWW panel, and which drivers are running?
    Helpful post? Buy me a coffee.
  • #13 20646971
    baukje
    Level 5  

    The main WWW only showed toggle relay..... at first :) I just checked again and it shows the power stats as expected.
    Other than calibration, does it need any other configuration?

    Device configuration, as extracted from Tuya:
    - BL0937 SEL on P8
    - Button (channel 1) on P26
    - BL0937 VI on P6
    - WiFi LED on P11
    - BL0937 ELE on P7
    - Relay (channel 1) on P24
    Device seems to be using CB2S module, which is using BK7231N.
    And the Tuya section starts, as usual, at 2023424

    Configuring GPIO and Power Monitoring Pins for Antela UK 13A Smart Plug with OpenBK7231N Flash
  • #14 20646983
    p.kaczmarek2
    Moderator Smart Home

    Well, you can do a lot of things. You can enable SSDP to make the device discoverable by Windows. You can enable PowerSave to save some energy. You can set up energy stats to get more info in HA.
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/README.md
    Helpful post? Buy me a coffee.
  • #15 20647141
    baukje
    Level 5  
    Are there any example setups for HA? I can't get it to show kWh, only in totals

    Configuring GPIO and Power Monitoring Pins for Antela UK 13A Smart Plug with OpenBK7231N Flash


    Added after 9 [hours] 41 [minutes]:

    ok, found the flag to show totals in kWh in mqtt.
  • #16 20648023
    p.kaczmarek2
    Moderator Smart Home

    So, is everything working as expected?

    You can pair the device with HA manually (by writing YAML) or use our Home Assistant Discovery
    Helpful post? Buy me a coffee.
  • #17 20648112
    baukje
    Level 5  

    p.kaczmarek2 wrote:
    So, is everything working as expected?

    The units seem to sometimes show in Wh and sometimes kWh
    Configuring GPIO and Power Monitoring Pins for Antela UK 13A Smart Plug with OpenBK7231N Flash

    On a similar Tasmota device, I got this as default:
    Configuring GPIO and Power Monitoring Pins for Antela UK 13A Smart Plug with OpenBK7231N Flash

    btw,
    What does "powersave" actually do?
  • #18 20652286
    baukje
    Level 5  
    Just serial flashed 4 of these and they each start up with OpenBK7231N_xxxxxxxxxx and I connect to 192.168.4.1 and can access the menu but not the webapp page. Changed wifi to my router but it failed to join and had to force into safe mode and take it back to open AP.
    Eventually tried connecting to a hotspot on my phone and it worked, later used that as second AP and used my regular AP as first and it connected. This is quite a chore

    So how do I export general config and apply it to all my plugs?
    Tried to import a template json, and it applies the config to the plug but doesn't save it. Is there a way to common settings likeapply wifi and mqtt?

    Added after 17 [minutes]:

    also, applied flags in the imported json, but it selected different flags in the config.
    Flags 1024

    I copied from Version: 1.17.175 (1.17.180 available) to new plug with 1.17.180. Are the flags/config likely to be different?
  • #19 20652423
    p.kaczmarek2
    Moderator Smart Home
    PowerSaves just saves the power, it sleeps the WiFi module for many very short intervals, like 0.001 seconds, so it reduces used current, power and also reduces heating.

    Nothing was changed in regards to Web App, what do you mean by Web App doesn't work?

    Maybe I know what's wrong - are you aware about the fact that Web App is fetched live via Github?

    If you disable your laptop WiFi, and lose internet connection, and connect to OBK access point, then Web App will have no way to fetch.

    That's why I usually only first connect OBK to my WiFi, and then I use the Web App to configure it, while having my internet connection back.
    Helpful post? Buy me a coffee.
  • #20 20652689
    baukje
    Level 5  
    p.kaczmarek2 wrote:
    Maybe I know what's wrong - are you aware about the fact that Web App is fetched live via Github?

    If you disable your laptop WiFi, and lose internet connection, and connect to OBK access point, then Web App will have no way to fetch.


    You are right, I didn't realise that the webapp was fetched live, I thought it was just the template parts.
    I don't know whether it is bad hardware or something in the config that differs or something in the latest openbeken, but this switch (2 of them now on obk 1.7.180) seems keep rebooting and rejoining wifi. When they do reboot they toggle the switch to off.
    I have another Identical hardware that was on tuya 1.1.8 originally and it stays connected on openbeken 1.7.175

    Added after 11 [minutes]:

    Info:MAIN:Main_Init_Before_Delay
    Info:CFG:####### Boot Count 63 #######
    Warn:CFG:CFG_InitAndLoad: Correct config has been loaded with 9 changes count.
    Error:CMD:no file early.bat err -2
    Info:EnergyMeter:Read ENERGYMETER status values. sizeof(ENERGY_METERING_DATA)=32
    Info:MAIN:Started BL0937.
    Info:GEN:PIN_SetupPins pins have been set up.
    Info:MAIN:Main_Init_Before_Delay done
    Info:MAIN:Main_Init_Delay
    Info:MAIN:Main_Init_Delay done
    Info:MAIN:Main_Init_After_Delay


    Added after 3 [minutes]:

    One of the 1.7.180 devices has a copy of the json from the 1.7.175 (working) device and another with obk 1.7.180 is minimally configured but also rebooting at seemingly random intervals and toggling relay OFF.

    Added after 2 [hours] 57 [minutes]:

    the 1.7.175 plug started rebooting now. the log moves too fast and has limited buffer, is there a way to extend the log buffer of send elsewhere??
    Can I downgrade or change firmware in OTA?
    Any ideas?

Topic summary

The discussion revolves around configuring GPIO and power monitoring pins for the Antela UK 13A Smart Plug after flashing it with OpenBK7231N firmware. The user identifies key GPIO pins for the LED, relay, and button but seeks assistance in configuring the power monitoring pins, speculating the use of the BL0937 chip. Various participants suggest checking the firmware version, exploring device templates, and using Tuya Cloudcutter for flashing. They discuss the importance of identifying the correct chip (BL0937 or BL0942) and share configurations for power monitoring, including pin assignments for the BL0937. Users also inquire about enabling power monitoring features and troubleshooting connectivity issues with the OpenBK web app.
Summary generated by the language model.
ADVERTISEMENT