
This is an interesting device that has two separate power measurement circuits. It can be now run without cloud, in OpenBeken.
I added support (version 1.18.17) for measuring devices with two BL0942 connected to UART1 and UART2 (Beken).
Currently, energy is always counted only from the first BL0942, the second one is informatives and values are not counted in main energy. In the future, the option of counting energy from UART1 and UART2 together could be added.
For HASS (MQTT), the second one reports with the suffix _b.
To use this feature, code must be compiled with flag ENABLE_BL_TWIN enabled in obk_config.h (or using compiler directive)
Code: C / C++
See related topic for online builds: https://www.elektroda.com/rtvforum/topic4033833.html
To activate function, there is a new command BL0942opts [value]
The meaning of the value is simple (bit0 = UART1, bit1 = UART2)
0 - default (as before this modification), one BL0942 on the port according to flag 26 (as the main one, with energy)
3 - two BL0942 on the UART1 and UART2 ports, UART1 is taken as the main one (with energy calculation) and the second as informative (without energy)
When working with both ports, I recommend disabling logging on UART.
To activate the twin BL mode, you need to add the following to autoexec.bat
logtype none
BL0942opts 3
startDriver BL0942
WebUI using two BL0942:

Flashing instructions:
Always use an external power supply [3V3] to ensure sufficient power. As bonus, on most devices you don't need to connect the CEN pin and just turn off/on to start flashing.
1. Connect the CBU module to the USBTTL converter using the CBU pins:
VCC , GND , RX1 , TX1

2. Backup the original using BK7231Flasher.exe
- select the correct com port + speed (my USBTTL converter works fine up to 1500000 baud for BK7231N)
- processor set type BK7231N
- read backup
- on / off - reading flash will start
3. Compile your own flash for BK7231N with the ENABLE_BL_TWIN flag enabled
- save the compiled bin to the BK7231Flasher.exe folder with the firmware
4. Upload a new flash using BK7231Flasher.exe
- select correct com + speed 1500000
- processor set type BK7231N
- select compiled bin (the one with ENABLE_BL_TWIN enabled)
- flash backup write
- on / off - flash write starts
4. BK7231Flasher.exe - Change OBK settings for flash write
- set SSID+pass
- write only OBK configuration
- on / off - obk config write starts
This is my "How do I that"

Using "spring contacts" pins without soldering.

Develop forum topic {history}: https://www.elektroda.com/rtvforum/topic4086343-90.html
Cool? Ranking DIY