diff --git a/deploy.md b/deploy.md index 98c6603..3d071bd 100644 --- a/deploy.md +++ b/deploy.md @@ -7,19 +7,19 @@ cd life-cycle-manager ``` #initial steps to be expanded -mkdir versions/0.1.8v -cp versions/certs.sector versions/0.1.8v +mkdir versions/0.1.9v +cp versions/certs.sector versions/0.1.9v #set local.mk to the ota-main program -make -j6 rebuild OTAVERSION=0.1.8 -mv firmware/otamain.bin versions/0.1.8v +make -j6 rebuild OTAVERSION=0.1.9 +mv firmware/otamain.bin versions/0.1.9v #set local.mk back to ota-boot program -make -j6 rebuild OTAVERSION=0.1.8 -cp firmware/otaboot.bin versions/0.1.8v +make -j6 rebuild OTAVERSION=0.1.9 +cp firmware/otaboot.bin versions/0.1.9v #remove the older versions files -#commit this as version 0.1.8 -#set up a new github release 0.1.8 as a pre-release using the just commited master... +#commit this as version 0.1.9 +#set up a new github release 0.1.9 as a pre-release using the just commited master... #erase the flash and upload the privatekey ``` @@ -27,12 +27,12 @@ esptool.py -p /dev/cu.usbserial-* --baud 230400 erase_flash esptool.py -p /dev/cu.usbserial-* --baud 230400 write_flash 0xf5000 privatekey.der ``` #upload the ota-boot program to the device that contains the private key -make flash OTAVERSION=0.1.8 +make flash OTAVERSION=0.1.9 #power cycle to prevent the bug for software reset after flash #create the 3 signature files next to the bin file and upload to github one by one #verify the hashes on the computer -openssl sha384 versions/0.1.8v/otamain.bin -xxd versions/0.1.8v/otamain.bin.sig +openssl sha384 versions/0.1.9v/otamain.bin +xxd versions/0.1.9v/otamain.bin.sig #make the release a production release on github #remove the private key ``` diff --git a/ota.c b/ota.c index 4a32d2b..0c16f4c 100644 --- a/ota.c +++ b/ota.c @@ -411,12 +411,12 @@ char* ota_get_version(char * repo) { retc = ota_connect(HOST, HTTPS_PORT, &socket, &ssl); //release socket and ssl when ready if (!retc) { - UDPLOG("send request......"); + UDPLGP("%s",recv_buf); ret = wolfSSL_write(ssl, recv_buf, send_bytes); if (ret > 0) { - UDPLOG("OK\n\n"); + UDPLGP("sent OK\n"); - wolfSSL_shutdown(ssl); //by shutting down the connection before even reading, we reduce the payload to the minimum + //wolfSSL_shutdown(ssl); //by shutting down the connection before even reading, we reduce the payload to the minimum ret = wolfSSL_peek(ssl, recv_buf, RECV_BUF_LEN - 1); if (ret > 0) { recv_buf[ret]=0; //error checking @@ -487,12 +487,12 @@ int ota_get_file_ex(char * repo, char * version, char * file, int sector, byte retc = ota_connect(HOST, HTTPS_PORT, &socket, &ssl); //release socket and ssl when ready if (!retc) { - UDPLOG("send request......"); + UDPLGP("%s",recv_buf); ret = wolfSSL_write(ssl, recv_buf, send_bytes); if (ret > 0) { - UDPLOG("OK\n\n"); + UDPLGP("sent OK\n\n"); - wolfSSL_shutdown(ssl); //by shutting down the connection before even reading, we reduce the payload to the minimum + //wolfSSL_shutdown(ssl); //by shutting down the connection before even reading, we reduce the payload to the minimum ret = wolfSSL_peek(ssl, recv_buf, RECV_BUF_LEN - 1); if (ret > 0) { recv_buf[ret]=0; //error checking, e.g. not result=206 @@ -562,7 +562,7 @@ int ota_get_file_ex(char * repo, char * version, char * file, int sector, byte ret = wolfSSL_write(ssl, recv_buf, send_bytes); recv_bytes=0; if (ret > 0) { - UDPLOG("OK\n\n"); + UDPLOG("OK\n"); header=1; memset(recv_buf,0,RECV_BUF_LEN); @@ -606,10 +606,10 @@ int ota_get_file_ex(char * repo, char * version, char * file, int sector, byte } collected+=ret; int i; - for (i=0;i<4;i++) UDPLOG("%02x ", recv_buf[i]); - UDPLOG("... "); - for (i=4;i>0;i--) UDPLOG("%02x ", recv_buf[ret-i]); - UDPLOG(" "); + for (i=0;i<3;i++) UDPLOG("%02x", recv_buf[i]); + UDPLOG("..."); + for (i=3;i>0;i--) UDPLOG("%02x", recv_buf[ret-i]); + UDPLOG(" "); } } else { if (ret) {ret=wolfSSL_get_error(ssl,ret); UDPLOG("error %d\n",ret);} @@ -618,7 +618,7 @@ int ota_get_file_ex(char * repo, char * version, char * file, int sector, byte } header=0; //move to header section itself } while(recv_bytes -char udplogstring[1450]={0}; //in the end I do not know to prevent overflow, so I use the max size of 1 UDP packet +char udplogstring[2900]={0}; //in the end I do not know to prevent overflow, so I use the max size of 1 UDP packet int udplogstring_len=0; void udplog_send(void *pvParameters){ @@ -38,7 +38,7 @@ void udplog_send(void *pvParameters){ lwip_bind(lSocket, (struct sockaddr *)&sLocalAddr, sizeof(sLocalAddr)); while (1) { - if ((!i && udplogstring_len) || udplogstring_len>1000) { + if ((!i && udplogstring_len) || udplogstring_len>700) { lwip_sendto(lSocket, udplogstring, udplogstring_len, 0, (struct sockaddr *)&sDestAddr, sizeof(sDestAddr)); udplogstring_len=0; i=10; diff --git a/versions/0.1.8v/certs.sector b/versions/0.1.9v/certs.sector similarity index 100% rename from versions/0.1.8v/certs.sector rename to versions/0.1.9v/certs.sector diff --git a/versions/0.1.8v/otaboot.bin b/versions/0.1.9v/otaboot.bin similarity index 69% rename from versions/0.1.8v/otaboot.bin rename to versions/0.1.9v/otaboot.bin index f660bd2..ff17852 100644 Binary files a/versions/0.1.8v/otaboot.bin and b/versions/0.1.9v/otaboot.bin differ diff --git a/versions/0.1.8v/otamain.bin b/versions/0.1.9v/otamain.bin similarity index 69% rename from versions/0.1.8v/otamain.bin rename to versions/0.1.9v/otamain.bin index 212682c..e55b95e 100644 Binary files a/versions/0.1.8v/otamain.bin and b/versions/0.1.9v/otamain.bin differ