Updated AWS IoT (markdown)

Michael Ingraham 2019-10-23 22:53:26 -04:00
parent 29469bcfd3
commit df3b79b0e9
1 changed files with 18 additions and 4 deletions

@ -2,7 +2,21 @@
*This feature is still experimental, and undergoing thorough testing to check stability (i.e. that memory pressure does not cause a crash). After a few weeks of testing, it appears extremely stable (no crash).*
> As of Tasmota version 6.6.0.3, the device-specific credentials are not anymore inserted at compile time. You can now use the same firmware for all your devices, AWS IoT credentials are stored in Flash memory and will survive firmware updates and OTA.
To use this feature you must compile your own firmware by adding the following lines to `user_config_override.h`. AWS IoT also requires [Tasmota TLS](TLS).
```
#ifndef USE_MQTT_TLS
#define USE_MQTT_TLS
#define USE_MQTT_TLS_CA_CERT // Optional but highly recommended
#endif
#ifndef USE_MQTT_AWS_IOT
#define USE_MQTT_AWS_IOT
#endif
#ifdef USE_DISCOVERY
#undef USE_DISCOVERY
#endif
```
> As of Tasmota version 6.6.0.3, the device-specific credentials are no longer restricted to being set at compile time only. You can now use the same firmware for all your devices. AWS IoT credentials can be set through the Console at runtime and are stored in flash memory. Credentials will survive firmware updates and OTA.
## Benefits
@ -219,11 +233,11 @@ Your setup is done in AWS IoT. Let's proceed to the custom firmware.
### Step 6. Enable AWS IoT in Tasmota
Using your favorite IDE, create `sonoff/user_config_override.h`, and add `#define USE_MQTT_AWS_IOT`. It is highly suggested to also add `#define USE_MQTT_TLS_CA_CERT`. You will need to #undef `#define USE_DISCOVERY` because mDNS will add too much code size.
Using your favorite IDE, create `user_config_override.h` and add the required compilation directives as documented at the top of this article.
Note: TLS handshake takes ~1.2s on ESP8266 @80MHz. You may choose to switch to 160MHz if the power supply of your device supports it. If you do so, handshake time should be ~0.7s.
Try to compile the firmware to make sure everything is good.
Compile the firmware and ensure it completes successfully.
> This step is only to check compilation goes well. Your firmware is still not usable since it does not contain the Private Key + Certificate.
@ -235,7 +249,7 @@ Flash your device the normal way; either through serial or OTA. If you use OTA,
You will now need to convert your AWS IoT credentials to Tasmota commands. Credentials are composed of two distinct parts, first a Private Key - this is the secret that will allow your device to prove it is who it pretends to be. Consider this as sensitive as a password. The Private Key is exactly 32 bytes (256 bits).
The second part is the Certificate delivered by AWS IoT. Tasmota will also need it to athenticate to the AWS IoT endpoint.
The second part is the Certificate delivered by AWS IoT. Tasmota will also need it to authenticate to the AWS IoT endpoint.
Both credentials must be stored in Tasmota Flash memory, in that order, using the new `TLSKey` command.