logo elektroda
logo elektroda
X
logo elektroda

[BL602] Elivco smart plug with energy monitor BL0937 RMC004

sverd2 21201 84
ADVERTISEMENT
  • Bought a Wifi smart plug from AliExpress which seems to be of the Elivco brand, model number RMC004.

    [BL602] Elivco smart plug with energy monitor BL0937 RMC004 [BL602] Elivco smart plug with energy monitor BL0937 RMC004 [BL602] Elivco smart plug with energy monitor BL0937 RMC004 [BL602] Elivco smart plug with energy monitor BL0937 RMC004 [BL602] Elivco smart plug with energy monitor BL0937 RMC004 [BL602] Elivco smart plug with energy monitor BL0937 RMC004 [BL602] Elivco smart plug with energy monitor BL0937 RMC004

    Opening the plug is relatively straightforward. In order to get the PCB off the plug I had to de-solder it from the 2 connections to the pins of the plug. After that the PCB with relay could easily be removed.
    Closer inspection showed that the plug contained a BL602 board and a BL0937 IC for the energy monitoring. The power for the PCB seems to be supplied by a BP2525 IC. (I was unable to get the IC markings clearly visible on the pictures, using magnification the markings were clearly visible).

    Another thing to notice is that the relay seems to be for 16A max whereas the plug is rated for 20A max. As a result I think the plug should not be used with >16A, or am I overseeing something there?

    Flashing with the BL602 firmware seems to work, but configuration is necessary and at this moment the BL0937 energy monitoring does not seem to function. Following the traces on the PCB and checking continuity with a multi meter I found the following "configuration":
    LED: pin 29 on the BL602, so GPIO20
    Relay; P2, so GPIO2
    Button: pin 31 on the BL602, so GPIO22
    BL0937 CF1: pin4 on the BL602, so GPIO3
    BL0937 CF: pin 22 on the BL602, so GPIO14
    BL0937 SEL: pin 30 on the BL602 so GPIO21
    as mentioned above at this moment this pin assignments work for LED, relay and button, but the BL0937 does not show up at all.

    Cool? Ranking DIY
    About Author
    sverd2
    Level 3  
    Offline 
    sverd2 wrote 8 posts with rating 4. Been with us since 2022 year.
  • ADVERTISEMENT
  • #2 20359721
    p.kaczmarek2
    Moderator Smart Home
    Thank you, this is the first time I see BL0937 used with BL602. Currenty BL0937 driver on BL602 will not work, because it's missing a HAL interrupt falling edge counter that is required to count number of pulses representing voltage, current and power. I will look into enabling that.

    It seems that more and more devices with BL602 shows up, I also recently ported DHT (DHT11, DHT21, DHT12, DHT22) driver to BL602 and also enable UART drivers (for CSE and BL0942).
    Helpful post? Buy me a coffee.
  • #3 20378910
    jony4t
    Level 8  
    good evening. Indeed I just received elivco with BL602 with bl0937 energy meter. The plug works correctly except for the energy meter. I wish I had the ability to help, but I don't have enough knowledge
  • #4 20385949
    krzychunh86
    Level 11  
    I have an identical socket, the only thing that saves you is replacing the module with ESP-02S, you can order it on ali. Today I managed to solder a new chip, upload supple to the device, and configure it. I described the topic on the supli forum if you are interested. Regards
  • #5 20386004
    p.kaczmarek2
    Moderator Smart Home
    @krzychunh86 OpenBL602 almost supports BL0937, just need to add edge counter support which is missing for this platform now. However, replacing it with ESP-02S is also a good idea, if you want to write an article with photos on this topic, you can receive a gift for a detailed description: https://www.elektroda.pl/rtvforum/topic3550170.html
    Helpful post? Buy me a coffee.
  • #6 20442638
    nomek
    Level 18  
    Hello
    I bought the same socket, unfortunatelly works without energy meter.
    @p.kaczmarek2 do you have any news about that?
  • ADVERTISEMENT
  • #7 20442985
    p.kaczmarek2
    Moderator Smart Home
    I think that BL0937 support for BL602 just needs an interrupt counter to be added, this is not much, all remaining code is in place. It should be relatively simple to enable it, especially now that we have OTA for BL602.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #8 20517570
    nomek
    Level 18  
    @p.kaczmarek2 do you have any info on BL0937 support?
  • #9 20545535
    patentjyp
    Level 5  
    >>20357626

    I have the same plug but I cannot get it open...

    Any hint on prying open the plug?
  • #10 20548602
    nomek
    Level 18  
    You have to get tired - one went easily and the other, unfortunately, was hard and that's why it's so bent, but it can be glued together.
    [BL602] Elivco smart plug with energy monitor BL0937 RMC004 [BL602] Elivco smart plug with energy monitor BL0937 RMC004
  • ADVERTISEMENT
  • #11 20612385
    sverd2
    Level 3  
    >>20517570
    I tried again today with the latest version of the firmware. Not sure whether things have been fixed already, but things are not completely working for me. When I use "startDriver BL0937" I do get some info in the overview screen regarding Channel 0 and Channel 1. The value of Channel 1 responds to whether a load is drawing some current or not (changes from 0 to 1 and back). Hence I do think some things are working, but at the same time all values regarding voltage, power etc. remain 0.0 all the time, only the value for power factor seems to be always 1.0 (probably some default value).

    Am I doing something terribly wrong? Maybe that "edge counter thing" is not yet there? I'm not sure what is the happening at this moment..
  • #12 20617278
    P0intLess
    Level 4  
    >>20545535
    I used a dremel-like tool and a diamond cutting disc on medium speed:
    [BL602] Elivco smart plug with energy monitor BL0937 RMC004
    If you don't have such a tool on your hands you can do this with a thin saw (or even a blade from it, if you don't have a saw - should be cheap to buy) for metal works <1mm thickness . And of course the overall look will suffer a bit in the end. So, having a cold heart and sharp mind:
    1. Fix the socket in a vise or something like it by the body.
    2. Step around 1.5 mm from the edge.
    3. Do a careful 360 degree cut about 1.5mm depth maximum (be careful not to damage anything inside).
    4. Volia!
    Then simply clean edges from excess plastic pieces with a sharp knife, do your stuff inside, and use anything you want to seal it back: super glue, hot glue, white silicone glue, epoxy resin etc. to fix it up (even a duct or insulating tape, but that will look brutal :) )
  • #13 20617308
    sverd2
    Level 3  
    Well, I was able to open up the plug and flash the device (see also the first post). However, the energy measurement part was/is not functioning. The author (@pkaczmarek2 ) confirmed that this was not working some months ago and I was wondering whether something had changed in the mean time (it was mentioned that it required some kind of counter which could easily be added)...
  • #14 20617329
    P0intLess
    Level 4  
    Well, I honestly think that @p.kaczmarek2 is willing to help anyone who needs, but time is a limited resource, and number of features to add and bugs to fix is literaly limitless, so you just have to wait a bit longer. Thanks to him and all contributors for all the work done - and to be done.
  • #15 20617453
    sverd2
    Level 3  
    I totally agree with that and was only wondering whether changes were already done or not as I'm probably not good enough in going through the source myself. Not trying to push anyone at all, just wondering.
  • #16 20617503
    p.kaczmarek2
    Moderator Smart Home
    Thank you for pinging me @P0intLess , I haven't seen this reply. Unfortunately, the BL602 interrupt counter is still not finished. I looked at that some time ago and it turned out to be somewhat problematic and didn't have time to check it since then. If you have a BL602 device, and some basic knowledge, you can just fork OBK and edit our driver:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/src/driver/drv_bl0937.c , those calls must be working:
    [BL602] Elivco smart plug with energy monitor BL0937 RMC004
    Here you need to add #ifdef PLATFORM_BL602 and a proper interrupt on GPIO change:
    [BL602] Elivco smart plug with energy monitor BL0937 RMC004
    Basically you need an "on change interrupt" for both CF and CF1 pins, so both functions are called.

    You don't need to worry about compiling. If you do your own fork of OBK on Github, you will get online builds for all platforms, so you can just download new binaries for each test.

    I don't have currently a working BL602 board, it has died some time ago when I tried to figure our a method to change MAC address of the device and the queue of things TODO is currently a bit long so on my side BL602 interrupts will have to wait, but you can try if you want. It shouldn't be hard and it most likely won't break anything.
    Helpful post? Buy me a coffee.
  • #17 20617512
    sverd2
    Level 3  
    Thanks a lot for the response and for the tips! I really did not intend to "push" you in any way so please forgive me if that impression was made.
    Also thanks a lot for the hint how to fix things, I will probably give it a try in the near future (If I do not mesh up the whole project it is worth a try!).
    Thanks again, and if I get things working, I'll report back!
  • #18 20617523
    p.kaczmarek2
    Moderator Smart Home
    You can look at OpenBL602 SDK:
    https://github.com/openshwprojects/OpenBL602
    Search for, for example, IRQ_TRIGGER_RISING_EDGE
    https://github.com/openshwprojects/OpenBL602/...components/fs/vfs/include/hal/soc/gpio.h#L123
    Maybe that could work?
    Code: C / C++
    Log in, to see the code

    Of course now that brings the question what is gpio_dev_t ....
    Code: C / C++
    Log in, to see the code

    So you would need to do something like:
    Code: C / C++
    Log in, to see the code


    maybe something like that could work, I could do another attempt with that for you, but it doesn't change the fact that I don't have BL602 device to test. Do both of you have BL602 + BL0937 combo?
    Helpful post? Buy me a coffee.
  • #19 20617618
    P0intLess
    Level 4  
    As for me, I don't have any of these, so I'm bailing out. ;)
  • #20 20618437
    sverd2
    Level 3  
    >>20617523
    I do have the BL602+BL0937 combo and also followed your suggestions for adjusting the driver (I think). As suggested I applied those in a fork of your main repo (so it should be kind of safe): [url=]https://github.com/sverd/OpenBK7231T_App/blob/main/src/driver/drv_bl0937.c[/url]
    In addition to your suggestion I also added an "#ifdef PLATFORM_BL602" to the BL0937_Shutdown_Pins() function as I got the impression otherwise the function would do nothing for this platform (not sure if this was needed).

    You mentioned earlier that in case of a fork on github compilation would be done automatically, should I adjust anything else to make that happen?
    As I will be away the coming couple of days, a possible next step will take some time, but I will for sure try whether I can get the device to work...
  • #21 20618480
    p.kaczmarek2
    Moderator Smart Home
    Hmm that's strange, I was sure it would build on it's own on your fork. If it does not build, maybe just open a pull request already, then I am 100% sure that it will build.
    Helpful post? Buy me a coffee.
  • #22 20629558
    sverd2
    Level 3  
    Maybe the problem is with my Github account? I did get some popups about enabling building/making the project for new users/forks. I think I enabled everything but maybe this is causing things not the build automatically. As suggested I did issue the pull request, may be that helps.
  • #24 20630724
    sverd2
    Level 3  
    Hello!
    The automagic building started to work. I'm not sure why, but at least it is working. I did manage to get things to compile after a few attempts. However, now I am getting "undefined references" to hal-functions. So it seems libhal_drv.a is not included in the linking step... I somehow did not manage to figure out how to add this library in the build system. Do you maybe have some tip/hint for that?
  • #25 20693371
    miegapele
    Level 15  
    Bought some cheap sockets from AliExpress Elivco store (in March 2023), with the intention to cut from the cloud.
    This one is a 16A smart socket marked RMC004.
    Close-up of Elivco RMC004 smart socket with technical label.
    It has firmware V1.1.8, and so BK7231N chip. Flashed with cloudcutter. Config is different than before:
    {
      "vendor": "Tuya",
      "bDetailed": "0",
      "name": "Elivco EU Smart Socket 16A",
      "model": "RMC004",
      "chip": "BK7231N",
      "board": "TODO",
      "flags": "1024",
      "keywords": [
        "TODO",
        "TODO",
        "TODO"
      ],
      "pins": {
        "6": "BL0937CF1;0",
        "7": "BL0937CF;0",
        "8": "LED_n;1",
        "10": "Btn;1",
        "24": "BL0937SEL;0",
        "26": "Rel;1"
      },
      "command": "PowerSave 1",
      "image": "https://obrazki.elektroda.pl/8298087300_1692028221.jpg",
      "wiki": "https://www.elektroda.com/rtvforum/viewtopic.php?p=20693371#20693371"
    }
    
  • #26 20693385
    p.kaczmarek2
    Moderator Smart Home
    So RMC004 is also Beken? Ok, thank you. I've added this entry to templates list.
    Helpful post? Buy me a coffee.
  • #27 20693493
    miegapele
    Level 15  
    They might be using whatever modules they can get. Or it's just clones of clones. But at least this one is "16A", so that's difference
  • #28 20726023
    viol_ten0q
    Level 6  
    I just received a smart-plug from Aliexpress that is ewelink branded with BL602 and BL0937 combo. I am not technically great with embedded stuff, but is there a chance that I can get this to work with OpenBeken or ESPHome - Libertiny?

    Close-up of a smart plug circuit board with a visible BL0937 chip. Close-up of a smart plug circuit board with markings and components.
  • #29 20726027
    p.kaczmarek2
    Moderator Smart Home
    ESPHome does not support that hardware and I do not recommend that. OpenBeken works ok on many platforms, including BL602:





    Helpful post? Buy me a coffee.
  • #30 20730645
    viol_ten0q
    Level 6  
    Thank you for your response.

    Can I just follow the guide as it is even though it's for a different device? Also, I got a hint at various places about being able to replace these chips altogether with ESP/Beken chips with easy configuration from there on. Is that also possible? I can solder good enough, and follow guides to the T, but lack detailed electronics knowledge to be able to do something that hasn't been done before.

    p.kaczmarek2 wrote:
    ESPHome does not support that hardware and I do not recommend that. OpenBeken works ok on many platforms, including BL602:





Topic summary

The discussion revolves around the Elivco smart plug model RMC004, which incorporates a BL602 microcontroller and a BL0937 energy monitoring IC. Users report challenges with the energy monitoring functionality, primarily due to the absence of a necessary interrupt counter in the BL602 driver for the BL0937. Some users have successfully opened the plug and attempted to modify the firmware, while others have suggested replacing the BL602 with an ESP-02S module for better compatibility. Calibration of the energy monitoring feature is also highlighted as essential for accurate readings. Recent updates indicate that the OpenBL602 firmware now supports the BL0937, although users still report issues with accuracy and functionality. Various methods for opening the plug and flashing the firmware are discussed, including using Arduino as a USB-TTL adapter and troubleshooting connection issues.
Summary generated by the language model.
ADVERTISEMENT