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]