How do I flash an LSPA7 Tuya smart plug with a CB2S/BK7231N module to OpenBeken over UART using a CP2102 adapter?
0x1D1000 after a successful erase. [#20934148]Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamDevice configuration, as extracted from Tuya:
- Button (channel 1) on P6
- WiFi LED on P8
- Relay (channel 1) on P26
Device seems to be using CB2S module, which is using BK7231N.
And the Tuya section starts, as usual, at 2023424
json format
{
"rl1_lv":"1",
"bt1_pin":"6",
"net_trig":"2",
"jv":"1.0.3",
"netled1_lv":"0",
"netled_reuse":"0",
"bt1_type":"0",
"ffc_select":"0",
"nety_led":"1",
"over_cur":"16000",
"bt1_lv":"0",
"reset_t":"5",
"netled1_pin":"8",
"chip_type":"3",
"lose_vol":"70",
"over_vol":"300",
"module":"CB2S",
"ch_cddpid1":"9",
"ch1_stat":"2",
"rl1_type":"0",
"ch_num":"1",
"ele_fun_en":"1",
"rl1_pin":"26",
"netn_led":"0",
"vol_def":"0",
"ch_dpid1":"1",
"crc":"29",
"}hfX^Agw_dieAmf_test_close":"40.00",
"pv":"2.2",
"lpv":"3.3",
"pk":"<secret>",
"firmk":"<secret>",
"cadv":"true",
"cdv":"1.0.0",
"dev_swv":"1.1.7",
"s_id":"null",
"dtp":"0",
"sync":"0",
"attr_num":"0",
"mst_tp_0":"0",
"mst_ver_0":"null",
"mst_tp_1":"0",
"mst0dAtls_ca_cntpasswd":"<secret>",
"md":"0",
"random":"0",
"wfb64":"1",
"stat":"2",
"token":"<secret>",
"region":"null",
"reg_key":"null",
"dns_prio":"0^Atimer_arr08Atls_ca_cnt0fBastro_timer{abi",
"id":"<secret>",
"swv":"1.1.7",
"bv":"40.00",
"mst_ver_1":"null",
"mst_tp_2":"0",
"mst_ver_2":"null",
"mst_tp_3":"0",
"mst_ver_3":"null }<secret>",
"mode":"rw",
"property":"{type"
}
(True) success!
Going to do erase, start 1904640, sec count 1!
Erasing sector 1904640... ok!
All selected sectors erased!
Now will also write OBK config...
Long name from CFG: OpenBK_E2D100031
Short name from CFG: obk_E2D100031
Web Root from CFG: https://openbekeniot.github.io/webapp/
Writing config sector 0x1D1000...Writing file data to chip successs.TL;DR: This FAQ helps OpenBeken users recover and flash an LSPA7 Tuya plug with 3 key pins already identified, and confirms that “P7 is a good solution” when the original relay pad is damaged. It solves UART flashing, GPIO mapping, and BL0942 setup questions for the CB2S/BK7231N version of this plug. [#20936155]
Why it matters: The thread turns a failed smart plug teardown into a reusable OpenBeken procedure, including a proven relay-pad workaround and the correct BL0942 driver setup.
| Item | Original / default | Verified workaround | Result |
|---|---|---|---|
| Relay control pin | P26 | P7 | Worked correctly |
| BL0942 setup | Start driver only | No GPIO remap needed | Uses UART1 |
| Flash power source | CP2102 at 3.3 V | Same adapter through full flash | Reported sufficient |
Key insight: The most important finding is that BL0942 does not need dedicated GPIO entries in the template. On this LSPA7, OpenBeken only needs
startDriver BL0942, and a broken relay pad can be bypassed by moving the relay to P7. [#20936155]
0x1D1000 after a successful erase. [#20934148]startDriver BL0942, which the maintainer states is all that is required. [#20936155]VoltageSet 0.1, CurrentSet 0.1, PowerSet 0.01, and stated that it did not work. The only setup command explicitly confirmed in the discussion is startDriver BL0942, because BL0942 runs on UART1. [#20936819]<secret>, such as keys and tokens. [#20934148]
Comments
Which pad of CB2S is broken, maybe we can fix it? Judging by the voltage of the relay, I would guess it's using 5V power supply, then it uses LDO to get 3.3V for WiFi module Here is OBK template: ... [Read more]
I broke p26 pad off :-( the one for the relay. The OBK template is missing the details for the BL0942, isn't it? I did think I could just move the relay in software to p7 as it doesn't look like it gets... [Read more]
All required BL0942 details are in the template. BL0942 is always on UART1, so there is no need to select GPIO for that. You just need to start the driver. Yes, you can route relay to P7, it's a good... [Read more]
I used P7 for my relay pin assignment and it worked just fine. What are the minimum values the BL chip can read? I am currently running the whole thing from a 5vdc source and I see the 5v on the index... [Read more]