The Emonio sends its measurement values directly to AWS IoT Core: via MQTT, encrypted and with mutual authentication by certificates (TLS, port 8883). This guide applies to Emonio P3, P3plus and P3plusN with firmware 3.0.81.
e465b829a708, SYSTEM page, line ID) and the device name (SYSTEM page, line Name).
xxxxx-certificate.pem.crt), the private key (xxxxx-private.pem.key) and the root certificate Amazon Root CA 1 (AmazonRootCA1.pem, download from Amazon). The private key can only be downloaded in this step. Amazon's guide: Create device certificates.{
"Version": "2012-10-17",
"Statement": [
{ "Effect": "Allow", "Action": "iot:Connect",
"Resource": "arn:aws:iot:REGION:ACCOUNT:client/DEVICE-ID" },
{ "Effect": "Allow", "Action": ["iot:Publish", "iot:Receive"],
"Resource": [ "arn:aws:iot:REGION:ACCOUNT:topic/DEVICE-ID/*",
"arn:aws:iot:REGION:ACCOUNT:topic/$aws/things/DEVICE-NAME/shadow/*" ] },
{ "Effect": "Allow", "Action": "iot:Subscribe",
"Resource": "arn:aws:iot:REGION:ACCOUNT:topicfilter/$aws/things/DEVICE-NAME/shadow/*" }
]
}
xxxxxxxxxxxxxx-ats.iot.eu-central-1.amazonaws.com.
Log in to the Emonio as admin and open SETUP, section Security (key vault). Upload the three files one by one:
| File from AWS | Selection under Upload |
|---|---|
| AmazonRootCA1.pem | MQTT CA Cert |
| xxxxx-certificate.pem.crt | MQTT Client Cert |
| xxxxx-private.pem.key | MQTT Client Key |
The certificates are then kept in the protected key vault, not as files in the file system. To replace one, simply upload a new file with the same selection. More: SETUP – Security.
SETUP, section Telemetry, Advanced view:
%I (replaced by the device ID).Click Save & Apply. Username, password and key are not used with AWS IoT and therefore hidden; encryption is always on.
The Emonio uses its device ID as MQTT client ID. The policy must therefore allow client/DEVICE-ID.
With topic %I the Emonio publishes on these topics:
DEVICE-ID/values: the measured values at the set interval (JSON, structure as described under MQTT Protocol)DEVICE-ID/debug: device state (uptime, memory, WiFi signal, temperatures)DEVICE-ID/status: offline as last will when the connection breaksTo watch the data, use the MQTT test client in the AWS console (subscribe to DEVICE-ID/#).
The Emonio uses the classic device shadow named $aws/things/DEVICE-NAME/shadow. DEVICE-NAME is the device name in lower case, spaces become _. If no device name is set, emonio- plus the last six characters of the device ID is used (for device ID e465b829a708 that is emonio-29a708).
conf).Example: set the debug interval to 120 seconds, on topic $aws/things/DEVICE-NAME/shadow/update:
{"state":{"desired":{"config":{"telemetry_dbgint":120}}}}
The Emonio applies every valid value, saves it and reports it back in reported.config. This settles the delta, so it is not sent again. Unknown keys or values out of range are not applied but removed from desired.config. Shadow documents up to 2 kB are processed.
Withdraw all requests:
{"state":{"desired":{"config":null}}}
The thing does not strictly have to be registered for the shadow to work, but without a registry entry the console does not show the shadow.
Switch on the diagnosis (SETUP, section Diagnosis) and open SYSTEM → Diagnosis. Typical messages and causes:
| Message in the log | Cause |
|---|---|
| no 'mqtt_ca.crt' in vault / no 'mqtt_cl.crt' in vault / no 'mqtt_cl.key' in vault | Certificate missing in the key vault (step 2). |
| No connection (timeout while connecting) | The policy does not allow the client ID (client/DEVICE-ID), wrong certificate, or the policy is not attached / the certificate is not active. |
| disconnected (server disconnect), shortly after connecting | The policy does not allow the topic. Compare topic and policy (topic/DEVICE-ID/*, shadow with the device name). |
The Emonio needs outgoing TCP port 8883 to the endpoint. Firmware before 3.0.81 put a leading / in front of the topic with the default template, which AWS rejects. Please update first.
Questions: support@emonio.de, technical support +49 30 9210 148 10.