FAQ
TL;DR: Stock firmware can empty two AAA cells in just 6 h at a 10-min refresh rate [Elektroda, dheenhasty, post #20385425] “SHT30 seems very simple to support” [Elektroda, p.kaczmarek2, post #20362193] Use DeepSleep + PowerSave to cut current by >90 %.
Why it matters: Proper scripting turns a one-week gadget into a months-long sensor.
Quick Facts
• MCU: Beken BK7231N CBU module, 3.3 V core, Wi-Fi b/g/n [Elektroda, p.kaczmarek2, post #20362193]
• Temp/Humidity chips: SHT30 or CHT8310/8315, I²C @ 100 kHz [Sensirion, 2023]
• Battery range: 2.0 – 3.0 V (two AAA) [Elektroda, user_param_key dump]
• DeepSleep current: ≈ 6 µA; active Wi-Fi current: ≈ 70 mA [Elektroda, dheenhasty, post #20393117]
• Typical script wake-time: 8–12 s, 15-min cycle ⇒ ~1 % duty-cycle power use.
How do I wire the UART for flashing?
Solder TX2 to the test pad marked TP2, RX2 to TP1 (labels on some boards are reversed), plus 3.3 V and GND. Pull CEN low during power-up to enter boot mode, then use BK7231 Flasher at 921 600 baud [Elektroda, sirhcsat, post #20905587]
Which GPIOs are used by the Wi-Fi-only SHT30 board?
Default Tuya layout: P7 =SCL, P8 =SDA, P17 =BAT_Relay, P20 =Button, P23 =BAT_ADC, P26 =LED [Elektroda, user_param_key dump, #20578864].
My sensor shows −49 °C and 3 % RH. What’s wrong?
Those values appear when the I²C pins or driver don’t match the chip. Select CHT8305 roles if your board carries CHT8310/8315 instead of SHT30 [Elektroda, sirhcsat, post #20905846]
Why does the device sometimes brick after a flat battery?
Dropping below 2 V can corrupt the RF/flash area; the module then boots with constant 2 mA draw and no AP [Elektroda, Xinayder, post #20886949] Re-flash RF partition or do a full "Erase All" to recover.
How can I stop endless waiting for MQTT when broker is offline?
Add a guard timer: addRepeatingEventID 30 1 999 DeepSleep 900
before waitFor MQTTState 1
; if MQTT is still down after 30 s the sensor sleeps for 15 min [Elektroda, erdeidominik1999, post #20792052]
What script gives longest battery life?
1 ) enable PowerSave
. 2 ) measure once, publish, sleep:
startDriver SHT3X
→ waitFor MQTTState 1
→ SHT_Measure
→ publishChannels
→ DeepSleep 900
. 3 ) Use flag 37 for quick Wi-Fi connect. Users report >30 days on AAA with a 15-min cycle [Elektroda, dheenhasty, post #20456982]
Edge case: device stays awake 60 s instead of 10 s
mqtt_broadcastInterval
left at 1 s sends five retained topics, stretching awake time. Set it to 60 s or disable extra broadcasts to avoid triple publishes [Elektroda, Xinayder, post #20882846]
Can I combine a door switch and temperature on one PCB?
Yes. Add an SHT30 to the unused P7/P8 lines of the door-sensor board. Door events will wake the MCU, publish temp/RH, then DeepSleep. Expect one extra MQTT burst per open/close [Elektroda, p.kaczmarek2, post #20906906]
How do I calibrate the SHT30?
Run SHT_Calibrate <TempOffset> <RHOffset>
once in autoexec, e.g. SHT_Calibrate -2.4 3
lowers reported temperature by 2.4 °C and raises humidity by 3 % RH [Elektroda, dheenhasty, post #20458926]
What statistic shows power-save success?
With PowerSave
active and no WebLog, idle current falls from ~70 mA to 6 - 8 mA, a 90 % reduction [Elektroda, dheenhasty, post #20393117]
Quick 3-step UART flashing?
- Hold CEN low, power the board at 3.3 V. 2. Use BK7231 Flasher, select BK7231N, click Erase All then Write OpenBK. 3. Release CEN and reboot; connect to the
OBK_XXXX
AP.
How to round sensor output to two decimals?
Set channel type to temperature_div10
for 0.1 °C granularity or divide in publish: publishFloat temp $CH2/10
. OBK trims trailing zeros from JSON [Elektroda, p.kaczmarek2, post #20458933]
What’s the failure threshold for Safe-Mode?
Five boots shorter than 5 s mark firmware as unstable and skip autoexec.bat
, letting you reconfigure via AP without UART [Elektroda, p.kaczmarek2, post #21014538]
Comments
Thank you for posting this. I can see that's a battery powered device. We need to enable power save in order to save battery. First of all, please add "PowerSave" command to short startup command, but... [Read more]
Thank you for your publications. I am curious how long the battery will last after changing the firmware and will there be a low battery notification? I wonder if the device can operate on 2 x AAA rechargeable... [Read more]
I have a similar sensor (I don't know if it's the same because I haven't disassembled it). On new good batteries it works 2-3 weeks depending on the temperature. It is worth mentioning that... [Read more]
Hello, anyone figured out how to config this device to show temp , humidity, battery lvl? [Read more]
@lionboy if you have the same device type, you should wait for the implementation for two things: - deep sleep (so batteries won't drain fast). Current "powerSave" command will not be enough for that -... [Read more]
I have the same sensor, i wll wait until fix the problem, is flashed but no problem, i saw from last night until now battery is empty :D [Read more]
Our team member and contributor, @btsimonh , has received a battery-powered PIR sensor (CBU module) few days ago with no MCU. He will be most likely looking into supporting that as well. [Read more]
Mine is 3 x AAA powered, 'N' based (CBU). I bought it 2nd hand on ebay, just so I had one :). But no manual or mountings. Looking at a manual online for a similar device, they claim 5 months on 3 x... [Read more]
Hi everibody, I'm new on the forum, I have some experience in "brain changes" to convert tuya devices to local control with Tasmota. At this moment I'm focussed in fotovoltaic generation and home energy... [Read more]
There is no datasheet, just our own research. But we have that: https://obrazki.elektroda.pl/8109819400_1673043809_thumb.jpg And that datasheet (but it's not BK7231 chip datasheet, but for module): https://www.elektroda.pl/rtvforum/download.php?id=1133903 How... [Read more]
Hello, new on this forum. i have publish a merge request to add the sht3X support. it works but measurement is not ideal even if i have taken the constructor reference for the sht3X. i support that... [Read more]
Hello, very good job. I will llook into your code, but have you considered using PowerSave command to reduce current consumption and lower heating? [Read more]
Yes it's activated at the init of the script. And i activate tuyamcu who suppose to deactivate wifi when not needed. For the moment the battery voltage is pretty stable. i have tested the measure... [Read more]
But that would be a per-device calibration? [Read more]
I don't know it's a supposition .... maybe a missread the documentation and you have some sort of calibration that can be done at init ..... So batterie Died in 6h with a 10 min refresh. Will try... [Read more]
@btsimonh , any progress with deep sleep? There is an API for deep sleep in the Beken SDK but I am not sure if I should point you towards it, @dheenhasty . If you enable deep sleep, then you might end... [Read more]
I have try to compile for the 8371N, but seems like the SDK is broken for the powe_save once i activate the manual power saving flag: beken378/func/power_save/manual_ps.c:190:20: error: 'SCTRL_LOW_PWR_CLK'... [Read more]
I have tested it only for BK7231T. Here is the only change needed to compile: https://obrazki.elektroda.pl/2617583000_1673796073_thumb.jpg If you are compiling for N, and for example SCTRL_LOW_PWR_CLK... [Read more]
@dheenhasty Very good job Here is the shematic. https://obrazki.elektroda.pl/9879827700_1673859980_thumb.jpg I think a new massurement could be taken, that is battery voltage. Just putting... [Read more]