add reboot log

This commit is contained in:
zhangsheng 2024-11-26 10:14:18 +08:00
parent 7c9a7a41fe
commit a3624af826
37 changed files with 25 additions and 10 deletions

BIN
Cidn-SH Executable file

Binary file not shown.

View File

@ -248,6 +248,8 @@ void SqliteDB::SqliteInit(const char *pDbName) {
execute_sql_file("/opt/configenv/firmware_upgrade.sql"); execute_sql_file("/opt/configenv/firmware_upgrade.sql");
execute_sql_file("/opt/configenv/receive_wave_status.sql"); execute_sql_file("/opt/configenv/receive_wave_status.sql");
execute_sql_file("/opt/configenv/reboot_record.sql");
} }
void SqliteDB::Createtable(const char *ptableName) { void SqliteDB::Createtable(const char *ptableName) {

BIN
debug/common/common_func.o Normal file

Binary file not shown.

Binary file not shown.

BIN
debug/dbaccess/sql_db.o Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
debug/localserver/web_cmd.o Normal file

Binary file not shown.

BIN
debug/main.o Normal file

Binary file not shown.

BIN
debug/minilzo/minilzo.o Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
debug/scheduler/schedule.o Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
debug/uart/uart.o Normal file

Binary file not shown.

BIN
debug/uart/uart_cmd.o Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
debug/utility/aes.o Normal file

Binary file not shown.

BIN
debug/utility/calculation.o Normal file

Binary file not shown.

BIN
debug/utility/md5.o Normal file

Binary file not shown.

BIN
debug/utility/search_dev.o Normal file

Binary file not shown.

BIN
debug/utility/secure.o Normal file

Binary file not shown.

BIN
debug/utility/serial.o Normal file

Binary file not shown.

BIN
debug/utility/tcp_cgi.o Normal file

Binary file not shown.

BIN
debug/utility/udp_scan.o Normal file

Binary file not shown.

BIN
debug/wifi_5g/dial.o Normal file

Binary file not shown.

BIN
debug/wifi_5g/wpa_client.o Normal file

Binary file not shown.

View File

@ -720,9 +720,20 @@ void JsonData::DataNodeStatusCheck() {
} }
} }
} }
if (count == nSize && nodeOnline) { if (count == nSize && nodeOnline && count != 0) {
zlog_error(zct, "ALL Node offline,count = %d", count); zlog_error(zct, "ALL Node offline,count = %d", count);
char whereCon[64]={0};
sprintf(whereCon,"DATE(timestamp, 'unixepoch') = DATE('now') ORDER BY timeStamp DESC limit 0,1");
std::string strCount = sqlite_db_ctrl::instance().GetData(" reboot_record ", "count", whereCon);
if (atoi(strCount.c_str()) < 3)//当天大于三次不再重启进程
{
char insertSql[64] = {0};
sprintf(insertSql, "'%s',%d,'%s'",localtimestamp,atoi(strCount.c_str())+1,"ALL Node offline");
sqlite_db_ctrl::instance().InsertData(" reboot_record ", insertSql);
exit(0); exit(0);
}else{
zlog_warn(zct, "reboot now count = %d",atoi(strCount.c_str()));
}
} }
} }
} }

View File

@ -770,6 +770,7 @@ void Uart::DealWave() {
wave_trans_ = false; wave_trans_ = false;
return; return;
} }
if (m_waveCountX > 0 || m_waveCountY > 0 || m_waveCountZ > 0){
char localtimestamp[32] = {0}; char localtimestamp[32] = {0};
GetTimeNet(localtimestamp, 1); GetTimeNet(localtimestamp, 1);
char insertSql[100] = {0x00}; char insertSql[100] = {0x00};
@ -778,6 +779,7 @@ void Uart::DealWave() {
memset(whereCon, 0x00, sizeof(whereCon)); memset(whereCon, 0x00, sizeof(whereCon));
sprintf(insertSql, "'%s','%02x%02x','%s',0,'1','%s' ", strMeasurementID.c_str(),(wave_shortAddr >> 8) & 0xFF,wave_shortAddr & 0xFF,localtimestamp,""); sprintf(insertSql, "'%s','%02x%02x','%s',0,'1','%s' ", strMeasurementID.c_str(),(wave_shortAddr >> 8) & 0xFF,wave_shortAddr & 0xFF,localtimestamp,"");
sqlite_db_ctrl::instance().InsertData(" receive_wave_status ", insertSql); sqlite_db_ctrl::instance().InsertData(" receive_wave_status ", insertSql);
}
std::string ran = ""; std::string ran = "";
int n = 0; int n = 0;