From d1a6d12878200e5247cedc276463b7cee997ed6f Mon Sep 17 00:00:00 2001 From: zzh Date: Wed, 18 Jun 2025 10:03:50 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BF=A1=E5=8F=B7?= =?UTF-8?q?=E8=B6=85=E6=97=B6=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/main.c b/main.c index 78c39ac..1f3268b 100644 --- a/main.c +++ b/main.c @@ -82,6 +82,12 @@ int searchTimeNew=0; int lightsnNum=0; int mqtt_port=1883; +static time_t last_2323_time = 0; // 记录上次收到0x2323的时间 +static bool waiting_for_4646 = false; // 是否在等待0x4646 + +// 函数声明 +void *thread_timeout_check(void *arg); + int getLedOtaVersion(char *filename); int getApOtaVersion(char *filename,char *modename); void hmacsha1(char *key,char* data,char *signbase64,int signbase64_len); @@ -1280,11 +1286,15 @@ void *thread_uart_recv_ack(void *arg){ prctl(PR_SET_NAME, "uart_ack"); uint16_t parm_ack; int ret=0; + while(1){ ret=uart_data_receive_ack(&uartSend,&parm_ack); if(ret>0){ LOG_I("ack:%x\n",parm_ack); if(parm_ack==0x2323){ + // 记录收到0x2323的时间,并设置等待0x4646标志 + time(&last_2323_time); + waiting_for_4646 = true; if(isLightOn){ char *flash=mqtt_parm.msg_flash; char *light=mqtt_parm.msg_lightDuration; @@ -1406,8 +1416,12 @@ void *thread_uart_recv_ack(void *arg){ isLabelUp=false; } }else if(parm_ack==0x4646){ + last_2323_time = 0; // 重置时间 + waiting_for_4646 = false; // 重置等待状态 isSendComEnd=true; }else if(parm_ack==0x4f4f){ + last_2323_time = 0; // 重置时间 + waiting_for_4646 = false; // 重置等待状态 isSendComEnd=true; if(isOtaEnable){ otaCount++; @@ -1419,12 +1433,18 @@ void *thread_uart_recv_ack(void *arg){ } } }else if(parm_ack==0x5252){ + last_2323_time = 0; // 重置时间 + waiting_for_4646 = false; // 重置等待状态 uart_data_receive_version(&uartSend); isSendComEnd=true; isAPOtaSuccess=true; }else if(parm_ack==0x5454){ + last_2323_time = 0; // 重置时间 + waiting_for_4646 = false; // 重置等待状态 isSendComEnd=true; }else if(parm_ack==0x4848){ + last_2323_time = 0; // 重置时间 + waiting_for_4646 = false; // 重置等待状态 isAPBack=true; } } @@ -2070,6 +2090,7 @@ int main(int argc, char *argv[]) int getTimeCount=0; char *readresult=NULL; char networktype[32]={0}; + pthread_t timeout_thread; // 添加超时检测线程变量 LOG_I("version:%s\n",softwareVersion); system("insmod /system/lib/modules/wk2xxx_spi.ko"); @@ -2179,6 +2200,16 @@ int main(int argc, char *argv[]) pthread_detach(pt_removelog); } + // 创建超时检测线程 + ret = pthread_create(&timeout_thread, NULL, thread_timeout_check, NULL); + if(ret!=0){ + LOG_I("pthread_create timeout_check fail\n"); + system("reboot"); + }else{ + LOG_I("pthread_create timeout_check success\n"); + pthread_detach(timeout_thread); + } + ret = pthread_create(&pt_ota,NULL,thread_ota,NULL); if(ret!=0){ LOG_I("pthread_create ota fail\n"); @@ -2276,6 +2307,31 @@ int main(int argc, char *argv[]) } } #endif + return 0; } +// 超时检测线程 +void *thread_timeout_check(void *arg) { + prctl(PR_SET_NAME, "timeout_check"); + + while(1) { + if(last_2323_time != 0 && waiting_for_4646) { // 只有在等待0x4646时才检查超时 + time_t current_time; + time(¤t_time); + if(difftime(current_time, last_2323_time) >= 10.0) { // 超过10秒 + LOG_I("thread_timeout_check: Timeout after receiving 0x2323, no 0x4646 received, setting isSendComEnd to 1\n"); + isSendComEnd = 1; + last_2323_time = 0; // 重置时间 + waiting_for_4646 = false; // 重置等待状态 + isLightEnable = 1; // 重置点亮使能标志 + isLightOn = false; // 重置点亮状态 + isLightOnByRule = false; // 重置规则点亮状态 + isLabelUp = false; // 重置标签更新状态 + } + } + usleep(100*1000); // 每100ms检查一次 + } + return NULL; +} + From 2f9147f5ffefe0671cf93333b3e7e5795a346aa5 Mon Sep 17 00:00:00 2001 From: zzh Date: Wed, 18 Jun 2025 14:41:52 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E9=83=A8=E5=88=86system?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=EF=BC=8Creboot=E5=89=8D=E5=81=9A=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=EF=BC=8C=E5=8F=96=E6=B6=88=E6=97=A5=E5=BF=97=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=EF=BC=8C=E6=9D=A5=E5=88=A4=E6=96=AD=E5=86=85=E6=A0=B8?= =?UTF-8?q?=E5=B4=A9=E6=BA=83=E9=97=AE=E9=A2=98=E6=98=AF=E5=90=A6=E8=A7=A3?= =?UTF-8?q?=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debug_print/debug_print.c | 2 + main.c | 134 +++++++++++++++++++++++++++++++++----- mqtt_utils/mqtt_utils.c | 8 ++- 3 files changed, 127 insertions(+), 17 deletions(-) diff --git a/debug_print/debug_print.c b/debug_print/debug_print.c index 144ae5d..178a312 100644 --- a/debug_print/debug_print.c +++ b/debug_print/debug_print.c @@ -60,11 +60,13 @@ int debug_print(const char *__restrict format, ...) va_end(valist); printf("%s", buffer); + /* char opTime[16]={0}; char logFileName[32]={0}; getDayStr(opTime,16); sprintf(logFileName,"Log.%s",opTime); buffer_to_file(logFileName,buffer,strlen(buffer),"a"); + */ return ret; } #endif diff --git a/main.c b/main.c index 1f3268b..4e8cb02 100644 --- a/main.c +++ b/main.c @@ -348,24 +348,84 @@ void otaAp(){ } } -void enableWatchDog(){ - system("echo 1 > /sys/class/gpio/export");//watchdog enable pin SGM820 - system("echo 112 > /sys/class/gpio/export");//feed watchdog pin 112 - system("echo out > /sys/class/gpio/gpio1/direction"); - system("echo out > /sys/class/gpio/gpio112/direction"); - system("echo 1 > /sys/class/gpio/gpio1/value"); +void enableWatchDog() { + int fd; + char path[64]; + char value[2]; + + // Enable watchdog pin SGM820 + fd = open("/sys/class/gpio/export", O_WRONLY); + if (fd < 0) { + LOG_I("Failed to open gpio export: %s\n", strerror(errno)); + return; + } + write(fd, "1", 1); + close(fd); + + // Enable feed watchdog pin + fd = open("/sys/class/gpio/export", O_WRONLY); + if (fd < 0) { + LOG_I("Failed to open gpio export: %s\n", strerror(errno)); + return; + } + write(fd, "112", 3); + close(fd); + + // Set gpio1 direction + fd = open("/sys/class/gpio/gpio1/direction", O_WRONLY); + if (fd < 0) { + LOG_I("Failed to open gpio1 direction: %s\n", strerror(errno)); + return; + } + write(fd, "out", 3); + close(fd); + + // Set gpio112 direction + fd = open("/sys/class/gpio/gpio112/direction", O_WRONLY); + if (fd < 0) { + LOG_I("Failed to open gpio112 direction: %s\n", strerror(errno)); + return; + } + write(fd, "out", 3); + close(fd); + + // Set gpio1 value + fd = open("/sys/class/gpio/gpio1/value", O_WRONLY); + if (fd < 0) { + LOG_I("Failed to open gpio1 value: %s\n", strerror(errno)); + return; + } + write(fd, "1", 1); + close(fd); + LOG_I("enable watchdog\n"); - system("echo 1 > /sys/class/gpio/gpio112/value"); + + // Set gpio112 value + fd = open("/sys/class/gpio/gpio112/value", O_WRONLY); + if (fd < 0) { + LOG_I("Failed to open gpio112 value: %s\n", strerror(errno)); + return; + } + write(fd, "1", 1); + close(fd); } -void feedWatchDog(){ - while(1){ - //LOG_I("feed watchdog\n"); - system("echo 0 > /sys/class/gpio/gpio112/value"); +void feedWatchDog() { + int fd = open("/sys/class/gpio/gpio112/value", O_WRONLY); + if (fd < 0) { + LOG_I("can not open watchdog gpio112\n"); + return; + } + + while(1) { + write(fd, "0", 1); usleep(100*1000); - system("echo 1 > /sys/class/gpio/gpio112/value"); + write(fd, "1", 1); sleep(1); } + + close(fd); + return; } void rebootSystem(void){ @@ -375,7 +435,6 @@ void rebootSystem(void){ time_t timep; time (&timep); result = localtime(&timep); - //printf("%d:%d:%d\n",result->tm_hour, result->tm_min, result->tm_sec); if(result->tm_hour==0 && result->tm_min==0 && result->tm_sec==10){ isTimeToReboot=true; LOG_I("prepare to reboot\n"); @@ -383,7 +442,7 @@ void rebootSystem(void){ } sleep(1); } - + system("sync"); system("reboot"); } @@ -1765,7 +1824,7 @@ void *thread_mqtt_recv(void *arg){ sleep(15); system("unzip ota/tx_ota.zip"); system("mv tx_ota/* ota"); - system("rm -fr tx_ota"); + system("rm -fr tx_ota"); system("mv ota/start.sh /root"); system("sync"); sleep(1); @@ -2093,19 +2152,62 @@ int main(int argc, char *argv[]) pthread_t timeout_thread; // 添加超时检测线程变量 LOG_I("version:%s\n",softwareVersion); + #if 1 system("insmod /system/lib/modules/wk2xxx_spi.ko"); - //system("busybox udhcpc -i eth0"); + + // 设置时区为 Asia/Shanghai,直接修改 /etc/localtime 软链接 + unlink("/etc/localtime"); + symlink("/usr/share/zoneinfo/Asia/Shanghai", "/etc/localtime"); + + // 导出 GPIO 63 + { + int fd = open("/sys/class/gpio/export", O_WRONLY); + if (fd >= 0) { + write(fd, "63", 2); + close(fd); + } + } + // 设置 GPIO 63 方向为 in + { + int fd = open("/sys/class/gpio/gpio63/direction", O_WRONLY); + if (fd >= 0) { + write(fd, "in", 2); + close(fd); + } + } + // 导出 GPIO 113 + { + int fd = open("/sys/class/gpio/export", O_WRONLY); + if (fd >= 0) { + write(fd, "113", 3); + close(fd); + } + } + // 设置 GPIO 113 方向为 out + { + int fd = open("/sys/class/gpio/gpio113/direction", O_WRONLY); + if (fd >= 0) { + write(fd, "out", 3); + close(fd); + } + } + #endif + #if 0 + system("insmod /system/lib/modules/wk2xxx_spi.ko"); + system("busybox udhcpc -i eth0"); system("timedatectl set-timezone Asia/Shanghai"); system("echo 63 > /sys/class/gpio/export");//reset key system("echo in > /sys/class/gpio/gpio63/direction"); system("echo 113 > /sys/class/gpio/export");//pin 113 yellow system("echo out > /sys/class/gpio/gpio113/direction"); + #endif uart_open(&uartSend,"/dev/ttyS0");//GT U12 ttyS0,U14 ttyS4,U21 ttysWK0 U13 ttysWK1 U15 ttysWK2 U22 ttysWK3 U20 ttyS1 uart_init(&uartSend,115200,8,1,'N',0); uart_open(&uartRecvData,"/dev/ttyS4");//DT uart_init(&uartRecvData,115200,8,1,'N',0); uart_open(&uartRecvBack,"/dev/ttysWK0");//HT uart_init(&uartRecvBack,115200,8,1,'N',0); + #if 0 struct dma_config cfg = { .buf = malloc(256), diff --git a/mqtt_utils/mqtt_utils.c b/mqtt_utils/mqtt_utils.c index 9075837..12d5b44 100644 --- a/mqtt_utils/mqtt_utils.c +++ b/mqtt_utils/mqtt_utils.c @@ -192,7 +192,13 @@ json_error: } void mqtt_net_failure(int *failure_times){ - system("echo 0 > /sys/class/gpio/gpio113/value"); + int fd = open("/sys/class/gpio/gpio113/value", O_WRONLY); + if (fd < 0) { + LOG_I("Failed to open gpio113 value: %s\n", strerror(errno)); + } else { + write(fd, "0", 1); + close(fd); + } if(failure_times != NULL){ (*failure_times)++; LOG_I("mqtt net failure_times = %d\n", *failure_times); From a77fd8408b60164f0ad914df38bbfe0dadcc5012 Mon Sep 17 00:00:00 2001 From: zzh Date: Thu, 19 Jun 2025 09:34:55 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AB=AF=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E6=97=B6=E5=88=A0=E9=99=A4Log=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 4e8cb02..2431f4a 100644 --- a/main.c +++ b/main.c @@ -59,7 +59,7 @@ int fd; int UPCASE=0; int count_value=0; int getPayloadTime=120*1000;//usecond -char softwareVersion[16]="1.1.12"; +char softwareVersion[16]="1.1.13"; char stationsn[16]="TJ251372224247";//TJ250995217957 char productid[8]="10045"; char appKey[32]="fdhQmhqhvbL1cf1K9mUqt"; @@ -2150,10 +2150,13 @@ int main(int argc, char *argv[]) char *readresult=NULL; char networktype[32]={0}; pthread_t timeout_thread; // 添加超时检测线程变量 + char syscmd[256]={0}; LOG_I("version:%s\n",softwareVersion); #if 1 system("insmod /system/lib/modules/wk2xxx_spi.ko"); + snprintf(syscmd, sizeof(syscmd), "ls Log.*|xargs rm -fr"); + system(syscmd); // 设置时区为 Asia/Shanghai,直接修改 /etc/localtime 软链接 unlink("/etc/localtime"); @@ -2293,6 +2296,7 @@ int main(int argc, char *argv[]) pthread_detach(pt_removeduplicatetag); } +#if 0 ret = pthread_create(&pt_removelog,NULL,thread_removelog,NULL); if(ret!=0){ LOG_I("pthread_create removelog fail\n"); @@ -2301,6 +2305,7 @@ int main(int argc, char *argv[]) LOG_I("pthread_create removelog success\n"); pthread_detach(pt_removelog); } +#endif // 创建超时检测线程 ret = pthread_create(&timeout_thread, NULL, thread_timeout_check, NULL); From 64a10c83d070f4f329f81b6e6877539c6881641d Mon Sep 17 00:00:00 2001 From: zzh Date: Sat, 21 Jun 2025 09:51:46 +0800 Subject: [PATCH 4/6] =?UTF-8?q?1.=20=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B71.1.15=202.=20=E5=88=A0=E9=99=A4=E4=B8=8D=E5=BF=85?= =?UTF-8?q?=E8=A6=81=E7=9A=84reboot=203.=20=E4=BF=AE=E6=94=B9ota=E9=80=BB?= =?UTF-8?q?=E8=BE=91=204.=20ota=E4=BB=BB=E5=8A=A1=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=A0=87=E5=BF=97=E4=BD=8D=E9=98=B2=E6=AD=A2=E5=A4=9A=E6=AC=A1?= =?UTF-8?q?=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.c | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/main.c b/main.c index 2431f4a..5eb26ef 100644 --- a/main.c +++ b/main.c @@ -59,7 +59,7 @@ int fd; int UPCASE=0; int count_value=0; int getPayloadTime=120*1000;//usecond -char softwareVersion[16]="1.1.13"; +char softwareVersion[16]="1.1.15"; char stationsn[16]="TJ251372224247";//TJ250995217957 char productid[8]="10045"; char appKey[32]="fdhQmhqhvbL1cf1K9mUqt"; @@ -695,7 +695,6 @@ int readQrcode() ret = pthread_create(&pt_handleqrcode,NULL,actHandleQrcode,input_value_copy); if(ret!=0){ LOG_I("pthread_create handleqrcode fail\n"); - system("reboot"); }else{ pthread_detach(pt_handleqrcode); } @@ -1802,8 +1801,7 @@ void *thread_mqtt_recv(void *arg){ system("reboot"); }else if(strcmp(mqtt_parm.msg_type,"1014")==0){ LOG_I("1014 update fw\n"); - system("rm -fr ota"); - system("mkdir ota"); + isSendComEnd=false; get_int_from_json_string_by_key(msg_data, "needWifi", &mqtt_parm.msg_needWifi); LOG_I("needWifi:%d\n",mqtt_parm.msg_needWifi); get_string_from_json_string_by_key_unescape(msg_data, "zipPath", mqtt_parm.msg_zipPath, sizeof(mqtt_parm.msg_zipPath)); @@ -1818,14 +1816,15 @@ void *thread_mqtt_recv(void *arg){ LOG_I("version:%s\n",mqtt_parm.msg_version); mqtt_service_reply(stationsn,mqtt_parm.msg_messageId,"ok",1,productid); char otaCmd[256]={0}; - sprintf(otaCmd,"curl -o /root/ota/tx_ota.zip %s",mqtt_parm.msg_zipPath); + sprintf(otaCmd,"curl -o /userdata/tx_ota.zip %s",mqtt_parm.msg_zipPath); //sprintf(otaCmd,"curl -o /root/tx_server https://fscdn.zto.com/cloudm/iot-device-package/7d609af2165b4d14ae318f17659b2fbf.bin"); system(otaCmd); sleep(15); - system("unzip ota/tx_ota.zip"); - system("mv tx_ota/* ota"); - system("rm -fr tx_ota"); - system("mv ota/start.sh /root"); + system("unzip /userdata/tx_ota.zip"); + //system("mv ../tx_ota/* /userdata/ota"); + //system("rm -fr /userdata/ota/tx_ota"); + system("mv /userdata/tx_ota /userdata/ota"); + system("mv /userdata/ota/ustart.sh /userdata"); system("sync"); sleep(1); system("reboot"); @@ -2227,25 +2226,25 @@ int main(int argc, char *argv[]) ret = pthread_create(&pt_watchdog,NULL,thread_feed_watchdog,NULL); if(ret!=0){ LOG_I("pthread_create watchdog fail\n"); - system("reboot"); }else{ LOG_I("pthread_create watchdog success\n"); pthread_detach(pt_watchdog); } #endif + +#if 0 ret = pthread_create(&pt_reboot,NULL,thread_reboot,NULL); if(ret!=0){ LOG_I("pthread_create reboot fail\n"); - system("reboot"); }else{ LOG_I("pthread_create reboot success\n"); pthread_detach(pt_reboot); } +#endif ret = pthread_create(&pt_uart_recv_ack,NULL,thread_uart_recv_ack,NULL); if(ret!=0){ LOG_I("pthread_create uart_recv_ack fail\n"); - system("reboot"); }else{ pthread_detach(pt_uart_recv_ack); LOG_I("pthread_create uart_recv_ack success\n"); @@ -2254,7 +2253,6 @@ int main(int argc, char *argv[]) ret = pthread_create(&pt_uart_recv_data,NULL,thread_uart_recv_data,NULL); if(ret!=0){ LOG_I("pthread_create uart_recv_data fail\n"); - system("reboot"); }else{ pthread_detach(pt_uart_recv_data); LOG_I("pthread_create uart_recv_data success\n"); @@ -2263,7 +2261,6 @@ int main(int argc, char *argv[]) ret = pthread_create(&pt_uart_recv_back,NULL,thread_uart_recv_back,NULL); if(ret!=0){ LOG_I("pthread_create uart_recv_back fail\n"); - system("reboot"); }else{ pthread_detach(pt_uart_recv_back); LOG_I("pthread_create uart_recv_back success\n"); @@ -2272,7 +2269,6 @@ int main(int argc, char *argv[]) ret = pthread_create(&pt_mqtt_recv,NULL,thread_mqtt_recv,NULL); if(ret!=0){ LOG_I("pthread_create mqtt_recv fail\n"); - system("reboot"); }else{ pthread_detach(pt_mqtt_recv); LOG_I("pthread_create mqtt_recv success\n"); @@ -2281,7 +2277,6 @@ int main(int argc, char *argv[]) ret = pthread_create(&pt_tagsearch,NULL,thread_tag_search_send,NULL); if(ret!=0){ LOG_I("pthread_create tag search send fail\n"); - system("reboot"); }else{ LOG_I("pthread_create tag search success\n"); pthread_detach(pt_tagsearch); @@ -2290,7 +2285,6 @@ int main(int argc, char *argv[]) ret = pthread_create(&pt_removeduplicatetag,NULL,thread_remove_duplicate_tag,NULL); if(ret!=0){ LOG_I("pthread_create remove duplicate tag send fail\n"); - system("reboot"); }else{ LOG_I("pthread_create remove duplicate tag success\n"); pthread_detach(pt_removeduplicatetag); @@ -2311,7 +2305,6 @@ int main(int argc, char *argv[]) ret = pthread_create(&timeout_thread, NULL, thread_timeout_check, NULL); if(ret!=0){ LOG_I("pthread_create timeout_check fail\n"); - system("reboot"); }else{ LOG_I("pthread_create timeout_check success\n"); pthread_detach(timeout_thread); @@ -2320,7 +2313,6 @@ int main(int argc, char *argv[]) ret = pthread_create(&pt_ota,NULL,thread_ota,NULL); if(ret!=0){ LOG_I("pthread_create ota fail\n"); - system("reboot"); }else{ LOG_I("pthread_create ota success\n"); pthread_detach(pt_ota); @@ -2329,7 +2321,6 @@ int main(int argc, char *argv[]) ret = pthread_create(&pt_doota,NULL,thread_do_ota,NULL); if(ret!=0){ LOG_I("pthread_create doota fail\n"); - system("reboot"); }else{ LOG_I("pthread_create doota success\n"); pthread_detach(pt_doota); @@ -2392,7 +2383,6 @@ int main(int argc, char *argv[]) ret = pthread_create(&pt_mqtt,NULL,thread_mqtt,NULL); if(ret!=0){ LOG_I("pthread_create mqtt fail\n"); - system("reboot"); }else{ pthread_detach(pt_mqtt); LOG_I("pthread_create mqtt success\n"); From 3672a5792f7cbf9180d894caf658c4b6b090857a Mon Sep 17 00:00:00 2001 From: zzh Date: Sat, 21 Jun 2025 10:28:55 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B71.1.16=20=E4=BF=AE=E6=94=B9ota=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 5eb26ef..8e91ac0 100644 --- a/main.c +++ b/main.c @@ -59,7 +59,7 @@ int fd; int UPCASE=0; int count_value=0; int getPayloadTime=120*1000;//usecond -char softwareVersion[16]="1.1.15"; +char softwareVersion[16]="1.1.16"; char stationsn[16]="TJ251372224247";//TJ250995217957 char productid[8]="10045"; char appKey[32]="fdhQmhqhvbL1cf1K9mUqt"; @@ -1823,6 +1823,7 @@ void *thread_mqtt_recv(void *arg){ system("unzip /userdata/tx_ota.zip"); //system("mv ../tx_ota/* /userdata/ota"); //system("rm -fr /userdata/ota/tx_ota"); + system("rm -fr /userdata/ota"); system("mv /userdata/tx_ota /userdata/ota"); system("mv /userdata/ota/ustart.sh /userdata"); system("sync"); From a59202320dfb3308373039891f98b4956cc88779 Mon Sep 17 00:00:00 2001 From: zzh Date: Tue, 24 Jun 2025 09:16:53 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=BA1.1.17?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 8e91ac0..d530946 100644 --- a/main.c +++ b/main.c @@ -59,7 +59,7 @@ int fd; int UPCASE=0; int count_value=0; int getPayloadTime=120*1000;//usecond -char softwareVersion[16]="1.1.16"; +char softwareVersion[16]="1.1.17"; char stationsn[16]="TJ251372224247";//TJ250995217957 char productid[8]="10045"; char appKey[32]="fdhQmhqhvbL1cf1K9mUqt";