How can I flash OpenBeken on the WL2S module with the LN882HK chip used in the ELIVCO LSPA9?
Yes — the LN882H/LN882HK platform was eventually ported to OpenBeken, and the thread shows a working build with relay control, OTA, and later BL0937 power metering support [#20904300][#20905873][#20968262] To flash it, put the chip into download/burn mode by pulling GPIOA9 low, connect TX0/RX0/GND/3.3V, and use the LN882H command-line tool to write `flashimage.bin`; several users found that lowering the baud rate to 115200 fixed `Fail. Error downloading file` problems [#20891275][#20908318][#20908420] If UART download is troublesome, SWD/J-Link also works for erase/flash and for restoring or dumping stock firmware [#20826012][#20905937] The build flow was to place the OpenBeken app inside the LN882H SDK tree, then build `flashimage.bin` for UART flashing and `flashimage-ota-xz-v0.1.bin` for OTA [#20917594][#20917867] The team also noted that an all-flash erase can act like a factory reset, and that future updates included BLE/power-save tweaks to reduce power draw and heat [#20914959][#20937215]
AI summary based on the discussion. May contain errors.
I've uploaded 6 builds ((BLE/NO_BLE) * (NO_POWERSAVE/MIN_POWERSAVE/MAX_POWERSAVE)) https://litter.catbox.moe/y9s2le.zip (The link will be available for 3 days)
>>20921637 I tested these builds by uploading via OTA. This is more indicative because I measured it with a wattmeter plugged into the socket. More accurate measurements would mean I would have to desolder the system again and connect it to the power supply. I can only do this on the weekend. So the measurements look like this: NO_BLE_NO_POWERSAVE - 0.6W; LN temp: 50.984253 NO_BLE_MIN_POWERSAVE - 0.4/0.3W; LN temp: 41.141731 NO_BLE_MAX_POWERSAVE - 0.4/0.3W; LN temp: 39.960632 NO_POWERSAVE - 0.6W; LN temp: 56.102364 MIN_POWERSAVE - 0.4W; LN temp: 43.503937 MAX_POWERSAVE - 0.4W; LN temp: 42.322834 Where it is 0.4/0.3W, the wattmeter simply showed such values alternately. The temperatures are also approximate because you would have to leave the system for a few minutes to stabilize.
So the maximum power consumption during operation is 0.3W at a temperature of about 27*C Charged from an hour simultaneously by [ping -t] and toggle every 1 second. Pretty good.
Therefore, it seems that the system itself works stably and does not heat up. Maybe it`s a relay or a poor power supply that is responsible for the heating of the whole thing?
Added after 4 [hours] 24 [minutes]:
After soldering the module to the switch and closing the housing, the temperature jumped to 40-45*C within a few minutes. Evidently, it is not the LN882 chip itself that heats up, but the rest of it [mainly the power supply and the relay, and of course the casing also does its job].
Why powersave=1 is not the default option for OpenBK7231T_App?
> Temperature is not a good measurement.
@p.kaczmarek2, debatable. Power consumption is not constant and it is not very correct to estimate energy by what the ammeter shows at a moment in time. While temperature integrates consumption over time. ___
@ksichu, how do you measure temperature? In the room? On the chip itself? With a thermal imager, I see ~50C on the chip with an external power supply (NO_BLE, MIN_POWERSAVE). Current consumption is between 50 and 65 mA.
> Maybe it's a relay or a poor power supply that is responsible for the heating of the whole thing?
According to the oscilloscope, the original power supply produces a normal output (3v3 with bursts not exceeding 150mV in amplitude). Checked with and without the board.
Powersave disabled by default due to BL0937 issues
Why powersave=1 is not default option for OpenBK7231T_App?
There have been up to 3 powersave-related issues reported so far:
- BL0937 power metering sockets lose their precision on powersave devices because BL0937 works by BK counting pulses on CF/CF1 pins
- IR send/receive is said to work worse on BL0937 for the similiar reasons
- there have been also some kind of early report that PowerSave broke something for one particular user but I don't know much about it
Related issue:
https://github.com/openshwprojects/OpenBK7231T_App/issues/678
@tarwirdur The given temperature is read from the firmware. I also tried contact measurement on the chip itself using ds18b20. It comes out a bit more [max 28.5°C]. [Battery powered + AMS1117 LDO 3.3V]
After assembly and power supply from 230V, the temperature quickly reaches 45°C.
The difference is clear, the conclusions are quite obvious
I have this device now too. Shall I make a new post with opening and flashing experience @p.kaczmarek2 or just post OBK template here when I have flashed it? I like adding to the device list, especially new LN882 😀
Added after 13 [minutes]:
Well, similar, mine is labelled BSD34 not LSPA9, but it does have WL2S.
The script will dump until it errors. I thought there was 4MB flash on these units, possibly it's wrapping or doing something strange.
You can always specify a range parameter eg 0x200000 for the script.
thinking about this again @sweetlilmre the flash size specified in the py is 0xFFFFFFFF. which is 4GB rather than 4MB. was that a high number you picked to be sure it got to the end of any flash size or was it to be 0x400000?
anyway, I've used 0x200000 and the dump completes with an OK rather than an error.
Thinking about this again @sweetlilmre, the flash size specified in the py is 0xFFFFFFFF, which is 4GB rather than 4MB. Was that a high number you picked to be sure it got to the end of any flash size, or was it supposed to be 0x400000?
Anyway, I've used 0x200000 and the dump completes with an OK rather than an error.
Yes, exactly. 0xFFFFFFFF was "read until it breaks". 0x200000 is the correct value for these devices. I will amend the script to default to that and put it in GH.
Why powersave=1 is not the default option for OpenBK7231T_App?
> Temperature is not a good measurement.
@p.kaczmarek2, debatable. Power consumption is not constant and it is not very correct to estimate energy by what the ammeter shows at a moment in time. While temperature integrates consumption over time.
___
@ksichu, how do you measure temperature? In the room? On the chip itself?
With a thermal imager, I see ~50C on the chip with an external power supply (NO_BLE, MIN_POWERSAVE). Current consumption is between 50 and 65 mA.
> Maybe it's a relay or a poor power supply that is responsible for the heating of the whole thing?
According to the oscilloscope, the original power supply produces a normal output (3v3 with bursts not exceeding 150mV in amplitude). Checked with and without the board.
Hi,
Before I merge this, I'd like to find out what @p.kaczmarek2 thinks of completely disabling BLE.
We can also implement the power saving option in the firmware and let users test, perhaps combining the BLE code with the wifi power save mode.
FYI: My board is also rock solid at max 30C outside of circuit.
It seems that BL0937 driver was finally implemented and power measurement works now as well. So my LN882H based LSPA9 works with "all features". A big THX to all implementers and tester! Really awesome work.
Hi
I too have come across a socket with an LN882HKI chip on a WL2S module.
Elivco brand socket supposedly 20A and relay only 16A .
I uploaded the firmware with the Chinese GUI software at a speed of 115200.
The configuration is almost good (about that below):
Code: JSON
Log in, to see the code
.
The problem with the configuration is the Relay setting.
In the REL setting, on relay on mode the red LED does not light, and on REL_n mode, the red LED lights up with the relay on but the status in OpenBeken is OFF (a status swap would be needed).
You're right, stupid me didn't realise I had a separate LED channel here for relay status information, because 99% of the sockets I had only had one LED channel, and the eventual LED was connected to the relay.
A propo. Have you perhaps solved the situation of one LED simply, for WiFi status info and at the same time for relay status as it is on the Tasmota?
Discussion focused on flashing OpenBeken on ELIVCO LSPA9 smart switch modules using the WL2S board with a Lightning LN882HK/LN882H chip. Initial UART bootlog capture was difficult, but later logs showed the chip uses a Tuya-based firmware and that the correct boot/debug output appears on TXD1 at 921600 baud. The community determined that BK7231/OpenBK binaries do not work on this platform and that LN882H requires its own SDK, flashing tools, and boot/download procedure. Progress included compiling and flashing SDK examples via KEIL/GCC, identifying J-Link SWD as a reliable way to erase/flash, and later confirming UART flashing is possible by grounding GPIOA9 and using LN882H_CMD_Tool with the correct baud rate. A Python flash dumper was created to back up flash and OTP, and the original firmware was successfully dumped and restored. OpenBeken was then ported far enough to boot, drive GPIO, create an AP, and later add STA support, with remaining work centered on OTA and further HAL integration. AI summary based on the discussion. May contain errors.