logo elektroda
logo elektroda
X
logo elektroda

[BK7231N] QCNX Plug with Smartmeter: ESP Chip, MQTT, Tasmota, OpenBK Firmware & Pin Settings

sirlouen 3312 19
ADVERTISEMENT
  • #1 20513837
    sirlouen
    Level 4  
    I recently purchased a QCNX Plug because I thought they had an ESP chip, to find that they are using a BK7231N

    Since I already had the UART interface soldered (trying to flash Tasmota and failing on the process), I checked the chip and found the BK7231N inscription so I downloaded the OpenBK firmware flashing firmware and decided to flash it.

    [BK7231N] QCNX Plug with Smartmeter: ESP Chip, MQTT, Tasmota, OpenBK Firmware & Pin Settings

    And it flashed well.

    Now I have configured it via MQTT with my HA installation, and it also works well.

    Driver active says its BL0937

    I copied the Pin settings for a similar device (Aubess Smart Plug LSPA9)

    "pins": {
    "6": "BL0937CF1;0",
    "7": "BL0937CF;0",
    "8": "LED_n;1",
    "23": "Btn;1",
    "24": "BL0937SEL;0",
    "26": "Rel;1"
    },

    [BK7231N] QCNX Plug with Smartmeter: ESP Chip, MQTT, Tasmota, OpenBK Firmware & Pin Settings

    It also could be a ELIVCO LSPA9, which has the Button on Pin 10 instead of 23.

    But I'm not sure if they are right. According to the Tasmota docs from Blakadder, these are the pins (at least for the ESP version, BASE 18)
    {"NAME":"QNCX","GPIO":[0,0,0,32,2720,2656,0,0,2624,320,224,0,0,0],"FLAG":0,"BASE":18}

    [BK7231N] QCNX Plug with Smartmeter: ESP Chip, MQTT, Tasmota, OpenBK Firmware & Pin Settings

    But here I find that this use a BASE28

    My question:

    How can I discover which is the right pin for each component:

    - BL0937CF1
    - BL0937CF
    - LED
    - Button
    - BL0937SEL
    - Relay

    Note that the power meter is not reporting

    [BK7231N] QCNX Plug with Smartmeter: ESP Chip, MQTT, Tasmota, OpenBK Firmware & Pin Settings

    Button in PIN 10 and LED in PIN 8 seem to be working though.

    I'm not sure what are the CF1, CF and SEL, and also REL
    I understand that CF1, CF and SEL are for the power metering and the REL is the relay for on/off capabilities through the web interface, so the REL seems to be also working

    Then the only PINs I have not identified are CF1, CF and SEL in case they are the ones related to power metering as I say because I have this connected to a 800W device, and it doesn't report power.
  • ADVERTISEMENT
  • #2 20514056
    p.kaczmarek2
    Moderator Smart Home
    Hello, have you opened the device to do the flashing? The simplest way is to follow the traces on the board.
    Or maybe do you happen to have 2MB firmware backup, so we can import pin settings from that?
    Is the BK7231N inside in the CB3S form module? Maybe we could map TYWE3S pins to CB3S... or TYWE2S to CB2S.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 20514060
    sirlouen
    Level 4  
    I've done a backup of the firmware. I will upload it here this evening.

    Added after 1 [hours] 22 [minutes]:

    p.kaczmarek2 wrote:
    Hello, have you opened the device to do the flashing? The simplest way is to follow the traces on the board.
    Or maybe do you happen to have 2MB firmware backup, so we can import pin settings from that?
    Is the BK7231N inside in the CB3S form module? Maybe we could map TYWE3S pins to CB3S... or TYWE2S to CB2S.


    Here I attach the 2MB firmware BIN to see if we can find the GPIO pins for the power meter

    Also I've noticed that after I plug in the socket the button works, but after 2 hours or so, it doesn't work anymore. Not sure why.
  • ADVERTISEMENT
  • #4 20514271
    p.kaczmarek2
    Moderator Smart Home
    Is the Webpage still working after two hours? Is switching relay from WWW panel works?
    I have forwarded the binary for analysis, I will (hopefully) have pinout later today.
    Please try adding PowerSave 1 command to startup command line in OBK to reduce the power usage of the device and increase it's stability, this helps with the cheapest devices that has low quality power supplies
    Helpful post? Buy me a coffee.
  • #5 20514282
    sirlouen
    Level 4  
    p.kaczmarek2 wrote:
    Is the Webpage still working after two hours? Is switching relay from WWW panel works?
    I have forwarded the binary for analysis, I will (hopefully) have pinout later today.
    Please try adding PowerSave 1 command to startup command line in OBK to reduce the power usage of the device and increase its stability, this helps with the cheapest devices that have low quality power supplies


    The whole system works after 2 hours, I can access the web interface and that.

    It's only the button to power on/off that stops working
  • #6 20515896
    p.kaczmarek2
    Moderator Smart Home
    I don't have analyzed dump yet, but can you try: CF on P9 (ESP GPIO04), CF1 on P8 (ESP GPIO05), Sel on P24 (ESP GPIO12)? Those are mappings based on Tasmota template.

    Btw, it's worth to add a screenshot of the device:
    [BK7231N] QCNX Plug with Smartmeter: ESP Chip, MQTT, Tasmota, OpenBK Firmware & Pin Settings

    Added after 10 [minutes]:

    update:
    I can't see anything more than that in binary:
    
    {
    	"bt1_lv": 0,
    	"bt1_pin": 10,
    	"bt_type": 0,
    	"ch_cddpid1": 9,
    	"ch_dpid1": 1,
    	"ch_num": 1,
    	"crc": 94,
    	"ffc_select": 0,
    	"jv": "1.1.5",
    	"module": "CB2S",
    	"net_trig": 1,
    	"netled1_lv": 0,
    	"netled1_pin": 8,
    	"netled_reuse": 0,
    	"netn_led": 1,
    	"nety_led": 2,
    	"reset_t": 3,
    	"rl1_lv": 1,
    	"rl1_pin": 26,
    	"total_stat": 2
    }
    

    Relay on P26, WiFi LED on P8, button on P10.

    Maybe it's without energy meter? Or maybe it's BL0942? Remove BL0937 pin setting, reboot, and try "startDriver BL0942"...
    Helpful post? Buy me a coffee.
  • #7 20516012
    sirlouen
    Level 4  
    p.kaczmarek2 wrote:
    Maybe it's without energy meter? Or maybe it's BL0942? Remove BL0937 pin setting, reboot, and try "startDriver BL0942"...


    I've switched to BL0942

    With pins format

      "pins": {
        "8": "WifiLED_n;1",
        "10": "Btn;1",
        "26": "Rel;1"
      },


    Using the bootload command

    backlog startDriver BL0942; VREF 15987.125000; PREF -683.023987; IREF 272302.687500


    From ELVCO LSPA9 Power metering plug

    I have not set any of the CF, CF1, parameters.
  • ADVERTISEMENT
  • #9 20516261
    sirlouen
    Level 4  
    p.kaczmarek2 wrote:
    Sorry, but is it working now?


    It was working already, but not the power meter functionality.
  • #10 20516283
    p.kaczmarek2
    Moderator Smart Home
    So it's not BL0942?

    The JSON config from binary file doesn't seem to contain anything about BL0937.... but the binary has BL0942 string inside so it might be BL0942 based device:
    [BK7231N] QCNX Plug with Smartmeter: ESP Chip, MQTT, Tasmota, OpenBK Firmware & Pin Settings
    This is why I asked you to start BL0942 driver and try. Are you getting and correct readings on WWW panel?
    Helpful post? Buy me a coffee.
  • #11 20516340
    sirlouen
    Level 4  
    p.kaczmarek2 wrote:
    So it's not BL0942?

    The JSON config from binary file doesn't seem to contain anything about BL0937.... but the binary has BL0942 string inside so it might be BL0942 based device:
    [BK7231N] QCNX Plug with Smartmeter: ESP Chip, MQTT, Tasmota, OpenBK Firmware & Pin Settings
    This is why I asked you to start BL0942 driver and try. Are you getting any correct readings on WWW panel?


    BL0942 is loaded
    [BK7231N] QCNX Plug with Smartmeter: ESP Chip, MQTT, Tasmota, OpenBK Firmware & Pin Settings

    This is the pins I currently have config'd.
    [BK7231N] QCNX Plug with Smartmeter: ESP Chip, MQTT, Tasmota, OpenBK Firmware & Pin Settings
  • #12 20516515
    p.kaczmarek2
    Moderator Smart Home
    Hmm no resutls here. Well, maybe we just try looking inside?

    You already had a flash dump, so you must have already opened the device.

    You can easily check with multimeter where the signals are going.
    Helpful post? Buy me a coffee.
  • #13 20516522
    sirlouen
    Level 4  
    p.kaczmarek2 wrote:
    Hmm no results here. Well, maybe we just try looking inside?

    You already had a flash dump, so you must have already opened the device.

    You can easily check with multimeter where the signals are going.


    I'm not that expert in electronics :P

    Some guide on how I can do this?
  • #14 20516602
    p.kaczmarek2
    Moderator Smart Home
    Well, let's start with some photos from inside. Where is the BL0937 and where is WiFi module? Is WIFI module in CB2S form?
    Helpful post? Buy me a coffee.
  • #16 20517645
    p.kaczmarek2
    Moderator Smart Home
    I am sorry to say this but the photos confirms the data from the binary. It seems there is no power metering chip in this plug. There is only an empty place for one, which matches BL0937 footprint:
    [BK7231N] QCNX Plug with Smartmeter: ESP Chip, MQTT, Tasmota, OpenBK Firmware & Pin Settings
    If you want, you can post more photos so we can double check, because maybe I am missing something, but it really seems that this plug has no power metering chip.

    Did you test that device with original Tuya app? Did it have power metering?
    Helpful post? Buy me a coffee.
  • #17 20517662
    sirlouen
    Level 4  
    I did not test the Tuya app. I installed this straight away.

    More images

    [BK7231N] QCNX Plug with Smartmeter: ESP Chip, MQTT, Tasmota, OpenBK Firmware & Pin Settings
    [BK7231N] QCNX Plug with Smartmeter: ESP Chip, MQTT, Tasmota, OpenBK Firmware & Pin Settings [BK7231N] QCNX Plug with Smartmeter: ESP Chip, MQTT, Tasmota, OpenBK Firmware & Pin Settings [BK7231N] QCNX Plug with Smartmeter: ESP Chip, MQTT, Tasmota, OpenBK Firmware & Pin Settings [BK7231N] QCNX Plug with Smartmeter: ESP Chip, MQTT, Tasmota, OpenBK Firmware & Pin Settings

    I specifically bought the model with power monitor. There was a cheaper model without power monitor

    16A Power Monitor, EU, 100-250V, China
    


    [BK7231N] QCNX Plug with Smartmeter: ESP Chip, MQTT, Tasmota, OpenBK Firmware & Pin Settings
  • #18 20517706
    p.kaczmarek2
    Moderator Smart Home
    Can you look here?
    Tuya LSPA9 smart socket - teardown, OpenBeken flashing guide for CB2S, BL0942
    This is my old LSPA9 teardown. The power metering sockets have the SOIC/SO/SSOP chip populated, here:
    [BK7231N] QCNX Plug with Smartmeter: ESP Chip, MQTT, Tasmota, OpenBK Firmware & Pin Settings
    They also have a shunt resistor populated, because it is required to do measurements. By measuring a voltage drop on shunt resistor, and knowing the resistance value, the current can be calculated.

    Your device, on other hand:
    [BK7231N] QCNX Plug with Smartmeter: ESP Chip, MQTT, Tasmota, OpenBK Firmware & Pin Settings
    has no BL0942/BL0937 IC and furthermore, the is no shunt resistor - it is replaced with a jumper soldered in it's place.

    I am sorry, but I am 100% sure that your device has no power metering capability. Please open a ticket/dispute on Aliexpress and you may try to receive a refund. I had issues with them several times, but usually they refunded the money. At least part of it.
    Helpful post? Buy me a coffee.
  • #19 20517714
    sirlouen
    Level 4  
    p.kaczmarek2 wrote:
    I am sorry, but I am 100% sure that your device has no power metering capability. Please open a ticket/dispute on Aliexpress and you may try to receive a refund. I had issues with them several times, but usually they refunded the money. At least part of it.


    Ok, dispute opened. I've bought a couple more last week with "theoretically power metering functionality". Let's see if they come with such BL controller

    So basically now we have a new device. The QCNX without power meter version. They sent me the wrong one. Still the pins I set here
    https://www.elektroda.com/rtvforum/topic3968081.html#20516340
    Are not working well.

    I will also unload the BL driver because it's useless in this case.
  • #20 20517718
    p.kaczmarek2
    Moderator Smart Home
    Was the power metering advertised on original packaging and manual? Maybe it was just one time mistake by them.
    Helpful post? Buy me a coffee.

Topic summary

The discussion revolves around the QCNX Plug, which utilizes a BK7231N chip instead of the expected ESP chip. The user successfully flashed the OpenBK firmware and configured the device with MQTT for Home Assistant (HA) integration. However, issues arose regarding the power metering functionality, as the device appeared to lack the necessary components (BL0937 or BL0942 chips) for power monitoring. Despite attempts to configure pin settings based on similar devices, the power meter did not function correctly. The user was advised to check the internal components and ultimately opened a dispute for a refund, suspecting they received a non-power metering version of the plug.
Summary generated by the language model.
ADVERTISEMENT