Skip to content

Commit

Permalink
2.0.2 overwrite RavenSystem/haa filename with lcm special version
Browse files Browse the repository at this point in the history
this special version uses sysparam definition compatible with lcm
  • Loading branch information
HomeACcessoryKid committed Apr 18, 2020
1 parent 68365a7 commit 7dde19c
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 21 deletions.
3 changes: 3 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 2.0.2 overwrite RavenSystem/haa filename with lcm special version
- this special version uses sysparam definition compatible with lcm

## 2.0.1 fix serial config menu after confirm stalling

## 2.0.0 stable new version with new functions
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ You can follow this issue [#23](https://github.com/HomeACcessoryKid/life-cycle-m
except that GitHub has marked our 7000 views and 51 Kudos message as Spam!
We were waiting for GitHub to roll back their change but personally I gave up. We are very disapointend – they didn't even bother to write back once!
You will have to access the device again via the serial port and flash a new otaboot.bin file
- download the latest [otaboot.bin](https://github.com/HomeACcessoryKid/life-cycle-manager/releases/download/2.0.1/otaboot.bin)
- download the latest [otaboot.bin](https://github.com/HomeACcessoryKid/life-cycle-manager/releases/latest/download/otaboot.bin)
- `esptool.py -p /dev/cu.usbserial-* write_flash 0x2000 ~/Downloads/otaboot.bin`

This will preserve all other info in your device like homekit pairing, wifi, etc. unless you stored them below 0x6D000
Expand Down
38 changes: 19 additions & 19 deletions deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@ 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 2.0.1 version folder
- create/update the file versions1/latest-pre-release without new-line and setup 2.0.2 version folder
```
mkdir versions1/2.0.1v
echo -n 2.0.1 > versions1/2.0.1v/latest-pre-release
cp versions1/certs.sector* versions1/2.0.1v
cp versions1/public*key* versions1/2.0.1v
mkdir versions1/2.0.2v
echo -n 2.0.2 > versions1/2.0.2v/latest-pre-release
cp versions1/certs.sector* versions1/2.0.2v
cp versions1/public*key* versions1/2.0.2v
```
- set local.mk to the ota-main program
```
make -j6 rebuild OTAVERSION=2.0.1
mv firmware/otamain.bin versions1/2.0.1v
make -j6 rebuild OTAVERSION=2.0.2
mv firmware/otamain.bin versions1/2.0.2v
```
- set local.mk back to ota-boot program
```
make -j6 rebuild OTAVERSION=2.0.1
mv firmware/otaboot.bin versions1/2.0.1v
make -j6 rebuild OTAVERSION=2.0.1 OTABETA=1
cp firmware/otaboot.bin versions1/2.0.1v/otabootbeta.bin
make -j6 rebuild OTAVERSION=2.0.2
mv firmware/otaboot.bin versions1/2.0.2v
make -j6 rebuild OTAVERSION=2.0.2 OTABETA=1
cp firmware/otaboot.bin versions1/2.0.2v/otabootbeta.bin
```
- remove the older version files
#
- update Changelog
- commit this as version 2.0.1
- set up a new github release 2.0.1 as a pre-release using the just commited master...
- commit this as version 2.0.2
- set up a new github release 2.0.2 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 @@ -43,18 +43,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=2.0.1 OTABETA=1
make flash OTAVERSION=2.0.2 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/2.0.1v/otamain.bin
xxd versions1/2.0.1v/otamain.bin.sig
openssl sha384 versions1/2.0.2v/otamain.bin
xxd versions1/2.0.2v/otamain.bin.sig
```

- upload the file versions1/2.0.1v/latest-pre-release to the 'latest release' assets on github
- upload the file versions1/2.0.2v/latest-pre-release to the 'latest release' assets on github

#### Testing

Expand Down Expand Up @@ -107,14 +107,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/2.0.1v/public-1.key.sig versions1
cp versions1/2.0.2v/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/2.0.1v/certs.sector.sig versions1
cp versions1/2.0.2v/certs.sector.sig versions1
```
- continue with a normal deployment to create the 2 signature files next to the bin files
1 change: 1 addition & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ void ota_task(void *arg) {
#endif
if (ota_boot()) ota_write_status("0.0.0"); //we will have to get user code from scratch if running ota_boot
if ( !ota_load_user_app(&user_repo, &user_version, &user_file)) { //repo/file must be configured
if (!strcmp(user_repo,HAAREPO)) user_file=HAAFILE;
#ifdef OTABOOT
if (ota_boot()) {
new_version=ota_get_version(user_repo); //check if this repository exists at all
Expand Down
2 changes: 2 additions & 0 deletions ota.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#define MAINFILE "otamain.bin"
#define BOOTFILE "otaboot.bin"
#define CERTFILE "certs.sector"
#define HAAREPO "RavenSystem/haa"
#define HAAFILE "haa_lcm.bin"
#define HOLDOFF_MULTIPLIER 20 //more like 20 -> 20s,400 (~6min),8000 (~2h),160000 (~2days)
#define HOLDOFF_MAX 604800 //more like 604800 (1 week)
#define BLINKDELAY 250
Expand Down
1 change: 0 additions & 1 deletion versions1/2.0.1v/latest-pre-release

This file was deleted.

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

0 comments on commit 7dde19c

Please sign in to comment.