Skip to content

Commit

Permalink
Restyled by prettier-markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits committed Nov 2, 2021
1 parent 0671653 commit d42865d
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 22 deletions.
17 changes: 13 additions & 4 deletions examples/ota-provider-app/esp32/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# ota-provider-app (ESP32)

### Build and flash OTA apps
- Build and flash [ESP32 OTA provider app](.) and [ESP32 OTA Requestor app](../../ota-requestor-app)

- Build and flash [ESP32 OTA provider app](.) and
[ESP32 OTA Requestor app](../../ota-requestor-app)

```
$ cd examples/ota-provider-app/esp32
$ idf.py -p <RequestorSerialPort> build flash
Expand All @@ -10,18 +13,22 @@ $ cd examples/ota-requestor-app/esp32
$ idf.py -p <ProviderSerialPort> build flash
```

- Flash hello-world OTA binary in providor app. Please find hello-world.bin [here](http://shubhamdp.github.io/esp_ota/esp32/hello-world-flash-in-ota-provider-partition.bin)
- Flash hello-world OTA binary in providor app. Please find hello-world.bin
[here](http://shubhamdp.github.io/esp_ota/esp32/hello-world-flash-in-ota-provider-partition.bin)

```
esptool.py -p <ProviderSerialPort> write_flash 0x206400 hello-world-flash-in-ota-provider-partition.bin
```

- Run IDF monitor for both applications in separate terminals
- Run IDF monitor for both applications in separate terminals

```
idf.py -p <RequestorSerialPort> monitor
idf.py -p <ProviderSerialPort> monitor
```

### Commission both apps

```
# Commission OTA Provider
$ ./chip-tool pairing ble-wifi 12345 <ssid> <passphrase> 0 20202021 3841
Expand All @@ -31,11 +38,13 @@ $ ./chip-tool pairing ble-wifi 123456 <ssid> <passphrase> 0 20202021 3840
```

## QueryImage from requestor console

```
esp32> QueryImage <ip> 12345 // node id should be in decimal
```

When the image download is complete device waits for an ApplyUpdate command, so fire following command from Requestor app
When the image download is complete device waits for an ApplyUpdate command, so
fire following command from Requestor app

```
esp32> ApplyUpdateRequest <ip> 12345 // node id should be in decimal
Expand Down
66 changes: 48 additions & 18 deletions examples/ota-requestor-app/esp32/README.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,87 @@
# ota-requestor-app (ESP32)

A prototype application that demonstrates device OTA requester.

For now, this application rely on the [Linux OTA Providor app](../linux)

### Setup Linux OTA Provider
- Build the linux OTA Provider

- Build the linux OTA Provider

```
# Change to chip top level directory
$ cd ../../../
$ cd ../../../
$ scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug chip_config_network_layer_ble=false
```
- Build CHIP Tool

- Build CHIP Tool

```
$ scripts/examples/gn_build_example.sh examples/chip-tool out/debug
```
- In terminal 1 run linux ota provider. One can build the [hello world example](https://github.com/espressif/esp-idf/tree/master/examples/get-started/hello_world) or use one from [here](https://shubhamdp.github.io/esp_ota/esp32/hello-world.bin)

- In terminal 1 run linux ota provider. One can build the
[hello world example](https://github.com/espressif/esp-idf/tree/master/examples/get-started/hello_world)
or use one from
[here](https://shubhamdp.github.io/esp_ota/esp32/hello-world.bin)

```
$ ./out/debug/chip-ota-provider-app -f hello-world.bin
```
- In terminal 2 run the CHIP tool to provision OTA provider

- In terminal 2 run the CHIP tool to provision OTA provider

```
$ ./out/debug/chip-tool pairing 12345 20202021
```

Now we have a OTA provider ready for use

### Building the Example Application
- Assuming that esp-idf is and chip environment is already set up if not please check [all-clusters-examples/esp32](../../all-clusters-app/esp32) this example.
- Build the Application

- Assuming that esp-idf is and chip environment is already set up if not
please check [all-clusters-examples/esp32](../../all-clusters-app/esp32)
this example.
- Build the Application

```
$ idf.py build
```
- Flash application

- Flash application

```
$ idf.py -p <SerialPort> flash monitor
```
- Provision OTA Requester

- Provision OTA Requester

```
./out/debug/chip-tool pairing ble-wifi 12346 <ssid> <passphrase> 0 20202021 3840
```
- After commissioning is successful, query for OTA image. Head over to ESP32 console and fire the following command. This command start the OTA image tranfer in 10 seconds.

- After commissioning is successful, query for OTA image. Head over to ESP32
console and fire the following command. This command start the OTA image
tranfer in 10 seconds.

```
QueryImage <OtaProviderIpAddress> <OtaProviderNodeId>
```
- Once transfer is complete it applies OTA and boots up from another partition.

- Once transfer is complete it applies OTA and boots up from another
partition.

## Features
- Code for running a full BDX download exists in BDX
- Sends QueryImage command using command line
- Downloads a file over BDX served by an OTA Provider server

- Code for running a full BDX download exists in BDX
- Sends QueryImage command using command line
- Downloads a file over BDX served by an OTA Provider server

## Limitations
- Do not support ApplyUpdateRequest command
- Needs chip-tool to commission the OTA Provider device first because the Node ID and IP Address of the OTA Provider must be supplied to this reference application
- Does not verify QueryImageResponse message contents or status
- Does not support AnnounceOTAProvider command or OTA Requestor attributes

- Do not support ApplyUpdateRequest command
- Needs chip-tool to commission the OTA Provider device first because the Node
ID and IP Address of the OTA Provider must be supplied to this reference
application
- Does not verify QueryImageResponse message contents or status
- Does not support AnnounceOTAProvider command or OTA Requestor attributes

0 comments on commit d42865d

Please sign in to comment.