Skip to content

Commit

Permalink
1.9.3 clear LCM_beta after emergency
Browse files Browse the repository at this point in the history
  • Loading branch information
HomeACcessoryKid committed Mar 6, 2020
1 parent 28cbbcb commit 136766a
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Initial install, WiFi settings and over the air firmware upgrades for any esp-op

## OUTAGE caused by GitHub change of HTTP headers
Yes, it really really doesn't work any more for versions < 1.9.1. You can follow this issue in the community [here](https://git.luolix.topmunity/t5/GitHub-API-Development-and/GitHub-changed-the-capitalisation-of-the-HTTP-headers-and-OTA/td-p/48247).
We are waiting for GitHub to roll back their change. The alternative is to connect via serial and flash version 1.9.2 otabootbeta.bin.
We are waiting for GitHub to roll back their change. The alternative is to connect via serial and flash version 1.9.3 otabootbeta.bin.
The emergency mode is ready so that if this ever happens again, there is a plan B in place.

## Version
Expand Down
38 changes: 19 additions & 19 deletions deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,29 @@ cd life-cycle-manager
- initial steps to be expanded

#### These are the steps if not introducing a new key pair
- create/update the file versions1/latest-pre-release without new-line and setup 1.9.2 version folder
- create/update the file versions1/latest-pre-release without new-line and setup 1.9.3 version folder
```
mkdir versions1/1.9.2v
echo -n 1.9.2 > versions1/1.9.2v/latest-pre-release
cp versions1/certs.sector* versions1/1.9.2v
cp versions1/public*key* versions1/1.9.2v
mkdir versions1/1.9.3v
echo -n 1.9.3 > versions1/1.9.3v/latest-pre-release
cp versions1/certs.sector* versions1/1.9.3v
cp versions1/public*key* versions1/1.9.3v
```
- set local.mk to the ota-main program
```
make -j6 rebuild OTAVERSION=1.9.2
mv firmware/otamain.bin versions1/1.9.2v
make -j6 rebuild OTAVERSION=1.9.3
mv firmware/otamain.bin versions1/1.9.3v
```
- set local.mk back to ota-boot program
```
make -j6 rebuild OTAVERSION=1.9.2
mv firmware/otaboot.bin versions1/1.9.2v
make -j6 rebuild OTAVERSION=1.9.2 OTABETA=1
cp firmware/otaboot.bin versions1/1.9.2v/otabootbeta.bin
make -j6 rebuild OTAVERSION=1.9.3
mv firmware/otaboot.bin versions1/1.9.3v
make -j6 rebuild OTAVERSION=1.9.3 OTABETA=1
cp firmware/otaboot.bin versions1/1.9.3v/otabootbeta.bin
```
- remove the older version files
#
- commit this as version 1.9.2
- set up a new github release 1.9.2 as a pre-release using the just commited master...
- commit this as version 1.9.3
- set up a new github release 1.9.3 as a pre-release using the just commited master...
- upload the certs and binaries to the pre-release assets on github
#
- erase the flash and upload the privatekey
Expand All @@ -42,18 +42,18 @@ esptool.py -p /dev/cu.usbserial-* --baud 230400 write_flash 0xf9000 versions1-pr
```
- upload the ota-boot BETA program to the device that contains the private key
```
make flash OTAVERSION=1.9.2 OTABETA=1
make flash OTAVERSION=1.9.3 OTABETA=1
```
- power cycle to prevent the bug for software reset after flash
- setup wifi and select the ota-demo repo without pre-release checkbox
- create the 2 signature files next to the bin file and upload to github one by one
- verify the hashes on the computer
```
openssl sha384 versions1/1.9.2v/otamain.bin
xxd versions1/1.9.2v/otamain.bin.sig
openssl sha384 versions1/1.9.3v/otamain.bin
xxd versions1/1.9.3v/otamain.bin.sig
```

- upload the file versions1/1.9.2v/latest-pre-release to the 'latest release' assets on github
- upload the file versions1/1.9.3v/latest-pre-release to the 'latest release' assets on github

#### Testing

Expand Down Expand Up @@ -102,14 +102,14 @@ esptool.py -p /dev/cu.usbserial-* --baud 230400 write_flash 0xf9000 versionsN-1-
```
- collect public-1.key.sig and store it in the new version folder and copy it to versions1
```
cp versions1/1.9.2v/public-1.key.sig versions1
cp versions1/1.9.3v/public-1.key.sig versions1
```
- then flash the new private key
```
esptool.py -p /dev/cu.usbserial-* --baud 230400 write_flash 0xf9000 versions1-privatekey.der
```
- collect cert.sector.sig and store it in the new version folder and copy it to versions1
```
cp versions1/1.9.2v/certs.sector.sig versions1
cp versions1/1.9.3v/certs.sector.sig versions1
```
- continue with a normal deployment to create the 2 signature files next to the bin files
2 changes: 1 addition & 1 deletion esp-wifi-config
7 changes: 4 additions & 3 deletions ota.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ void ota_read_rtc() {
UDPLGP("--- standard ota\n");
}
else if (count<5+count_step*2) { //reset wifi parameters and clear LCM_beta
UDPLGP("--- reset wifi\n");
UDPLGP("--- reset wifi and clear LCM_beta\n");
reset_wifi=1;
reset_otabeta=1;
}
else if (count<5+count_step*3) { //reset wifi parameters and set LCM_beta
UDPLGP("--- reset wifi\n");
UDPLGP("--- reset wifi and set LCM_beta\n");
reset_wifi=1;
otabeta=1;
}
Expand Down Expand Up @@ -133,7 +133,7 @@ void ota_read_rtc() {
otabeta=1; //using beta = pre-releases?
#endif
if (otabeta && !reset_otabeta) sysparam_set_bool("lcm_beta", 1);
if ( reset_otabeta) sysparam_set_bool("lcm_beta", 0);
if ( reset_otabeta) sysparam_set_bool("lcm_beta", NULL);
}

void ota_active_sector() {
Expand Down Expand Up @@ -992,6 +992,7 @@ int ota_emergency(char * *ota_srvr) {
char *value;
if (sysparam_get_string("ota_srvr", &value)== SYSPARAM_OK) *ota_srvr=value; else return 0;
sysparam_set_string("ota_srvr","");
sysparam_set_bool("lcm_beta", NULL);
UDPLGP("YES: backing up from http://%s" BOOTFILE "\n",*ota_srvr);
return 1;
} else return 0;
Expand Down
1 change: 0 additions & 1 deletion versions1/1.9.2v/latest-pre-release

This file was deleted.

File renamed without changes.
1 change: 1 addition & 0 deletions versions1/1.9.3v/latest-pre-release
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.9.3
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 136766a

Please sign in to comment.