Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamV:BK7231N_1.0.1
REG:cpsr spsr r13 r14
SVC:000000D3 00401C1C 000033AC
IRQ:000000d2 00000010 00401e0c a0e1cccd
FIR:000000d1 00000010 00401ffc 4f6f8c03
SYS:000000df 0040192c 00000158
ST:00000000
J 0x10000
bk_misc_init_start_type 0 0
prvHeapInit-start addr:0x414240, size:114112
[Flash]id:0xeb6015
sctrl_sta_ps_init
cset:0 0 0 0
Entering initLog()...
Commands registered!
initLog() done!
Info:MAIN:Main_Init_Before_Delay
nelliug54 wrote:@dheenhasty
To avoid getting in the corruption state I would suggest one change in the script.
As the sensor aproximates to the critical battery voltage (2V) we could publish an mqtt error message and ask to replace batteries and increase DeepSleep to 4h for example or gradually the DeepSleep timer to 2h, 4h or 10h with adding more 'if' statements..
for example:
. . . . .
echo "activate voltage meassurement"
setChannel 5 1
delay_s 1
if $CH4/1000<=2200 then goto batlow
. . . . .
. . . . .
DeepSleep 600
batlow:
publish "Bat_fail_Replace_asap" $CH4/1000'
. . . . . .
. . . . . .
echo "deepsleep 4h for example"
DeepSleep 14400
nelliug54 wrote:Hi guys, it is logged this set of error messages everytime the read is launched:
Error:CMD:command with name SHT_Calibrate already exists!
Error:CMD:command with name SHT_MeasurePer already exists!
Error:CMD:command with name SHT_LaunchPer already exists!
Error:CMD:command with name SHT_StopPer already exists!
Error:CMD:command with name SHT_Measure already exists!
Error:CMD:command with name SHT_Heater already exists!
Error:CMD:command with name SHT_GetStatus already exists!
Do you know the reason for it?
nelliug54 wrote:I don't get the function of the Q1 n-mosfet , its connections have been checked several times...
I hope no mistakes.
p.kaczmarek2 wrote:Wasn't Q1 for reverse polarity protection?
@dheenhasty are your changes ready to merge? At least that part that's done.
By the way, it seems that "wake up on GPIO" works only on T and not on N.
Quote:static commandResult_t CMD_DeepSleep(const void* context, const char* cmd, const char* args, int cmdFlags) {
int timeMS, idx_map = 0, edg_map = 0;
Tokenizer_TokenizeString(args, 0);
// following check must be done after 'Tokenizer_TokenizeString',
// so we know arguments count in Tokenizer. 'cmd' argument is
// only for warning display
if (Tokenizer_CheckArgsCountAndPrintWarning(cmd, 1)) {
return CMD_RES_NOT_ENOUGH_ARGUMENTS;
}
timeMS = Tokenizer_GetArgInteger(0);
idx_map = Tokenizer_GetArgInteger(1);
edg_map = Tokenizer_GetArgInteger(2);
#ifdef PLATFORM_BEKEN
// It requires a define in SDK file:
// OpenBK7231T\platforms\bk7231t\bk7231t_os\beken378\func\include\manual_ps_pub.h
// define there:
// #define PS_SUPPORT_MANUAL_SLEEP 1
extern void bk_wlan_ps_wakeup_with_timer(UINT32 sleep_time, UINT32 idx_map, UINT32 edg_map);
bk_wlan_ps_wakeup_with_timer(timeMS, idx_map, edg_map);
return CMD_RES_OK;
#elif defined(PLATFORM_W600)
#endif
return CMD_RES_OK;
}
Quote:void bk_wlan_ps_wakeup_with_timer(UINT32 sleep_time,UINT32 idx_map, UINT32 edg_map)
{
PS_DEEP_CTRL_PARAM deep_sleep_param;
deep_sleep_param.sleep_time = sleep_time;
deep_sleep_param.wake_up_way = PS_DEEP_WAKEUP_GPIO;
deep_sleep_param.gpio_index_map = idx_map;
deep_sleep_param.gpio_edge_map = edg_map;
os_printf("---deep sleep test param : 0x%0X 0x%0X 0x%0X 0x%0X %d %d\r\n",
deep_sleep_param.gpio_index_map,
deep_sleep_param.gpio_edge_map,
deep_sleep_param.gpio_last_index_map,
deep_sleep_param.gpio_last_edge_map,
deep_sleep_param.sleep_time,
deep_sleep_param.wake_up_way);
bk_enter_deep_sleep_mode(&deep_sleep_param);
}
startDriver SHT3X
startDriver NTP
setChannelType 1 temperature_div10
setChannelType 2 humidity
SHT_Measure
ntp_setServer 172.17.7.1
addRepeatingEvent 60 -1 SHT_Measure
dheenhasty wrote:
i have tried tuya mcu for some powersaving it include .... but it's not making any difference.
dheenhasty wrote:
the only thing that came in mind is that after the reset it lost the init/preinit pattern. you can try to do a stop of sht driver it will launch a soft reset of the SHT sensor.
ShadowLight30 wrote:
Ok I didn't know about the power saving feature. Since I'm using relays, it doesn't matter for me![]()