fix T->t modify getLocalip upto v1.1.8

This commit is contained in:
hyx 2025-04-09 12:40:51 +08:00
parent 103d478ba7
commit b2805dfefe
4 changed files with 19 additions and 10 deletions

2
cp.sh
View File

@ -1,4 +1,4 @@
sshpass -p "PddloTSecPwdOnly!" scp ./output/bin/tx_server root@10.10.10.225:/home/linaro/
sshpass -p "PddloTSecPwdOnly!" scp ./output/bin/tx_server root@192.168.0.148:/home/linaro/
#sshpass -p "PddloTSecPwdOnly!" scp ./output/bin/tx_server root@10.10.10.132:/root/
#sshpass -p "PddloTSecPwdOnly!" scp ./start.sh root@10.10.10.225:/root/
#sshpass -p "PddloTSecPwdOnly!" scp ./start.sh root@10.10.10.132:/root/

19
main.c
View File

@ -36,7 +36,7 @@ int fd;
int UPCASE=0;
int count_value=0;
int getPayloadTime=120*1000;//usecond
char softwareVersion[16]="1.1.7";
char softwareVersion[16]="1.1.8";
char stationsn[16]="TJ251372224247";//TJ250995217957
char productid[8]="10045";
char appKey[32]="fdhQmhqhvbL1cf1K9mUqt";
@ -334,7 +334,7 @@ int readQrcode()
if(UPCASE==1){
input_value[count_value]='T';
}else{
input_value[count_value]='t';
input_value[count_value]='T';
}
UPCASE=0;
count_value++;
@ -1447,9 +1447,13 @@ void hmacsha1(char *key,char* data,char *signbase64,int signbase64_len){
void getLocalIp(char *local_ip){
char hostname[32]={0};
gethostname(hostname,32);
LOG_I("hostname:%s\n",hostname);
get_ip_by_domain(hostname, local_ip, 32);
FILE *fp;
char buffer[64]={0};
//get_ip_by_domain(hostname, local_ip, 32);
fp=popen("ifconfig eth0 | grep 'inet' | awk '{print $2}' | cut -d':' -f2","r");
fgets(buffer,sizeof(buffer),fp);
LOG_I("buffer:%s\n",buffer);
memcpy(local_ip,buffer,strlen(buffer)-1);
}
void saveStartUpTime(){
@ -1602,7 +1606,12 @@ int main(int argc, char *argv[])
readresult=NULL;
LOG_I("saved mqttRawPassword:%s\n",mqttRawPassword);
}else{
if((ping("8.8.8.8") == 0)||(ping("8.8.4.4") == 0)){
getDevRawPassword(stationsn);
}else{
LOG_I("getDevRawPassword net not ready\n");
sleep(3);
}
}
readresult=file_to_buffer("LightEnable",&len);

View File

@ -1,6 +1,6 @@
. compile.sh
rm -fr output
mkdir output
#rm -fr output
#mkdir output
cd output
cmake ..
make

2
ssh.sh
View File

@ -1,2 +1,2 @@
#sshpass -p "PddloTSecPwdOnly!" ssh root@10.10.10.132
sshpass -p "PddloTSecPwdOnly!" ssh root@10.10.10.225
sshpass -p "PddloTSecPwdOnly!" ssh root@192.168.0.148