If I publish an empty message to $aws/things/chicken-door/shadow/name/door/get I receive the following message on $aws/things/chicken-door/shadow/name/door/get/accepted:
{
"state": {
"desired": {
"welcome": "aws-iot"
},
"reported": {
"welcome": "aws-iot",
"status": "off",
"value": "closed"
}
},
"metadata": {
"desired": {
"welcome": {
"timestamp": 1637421413
}
},
"reported": {
"welcome": {
"timestamp": 1637421413
},
"status": {
"timestamp": 1637735730
},
"value": {
"timestamp": 1638447783
}
}
},
"version": 1012,
"timestamp": 1638793997
}
That would be more than 256 (321bytes). So I set the buffersize to 512:
void setup()
{
Serial.begin(115200);
delay(5000);
Serial.println();
Serial.println();
WiFi.setHostname(THINGNAME);
WiFi.mode(WIFI_STA);
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
connectToWiFi(String("Attempting to connect to SSID: ") + String(WIFI_SSID));
net.setCACert(AWS_CERT_CA);
net.setCertificate(AWS_CERT_CRT);
net.setPrivateKey(AWS_CERT_PRIVATE);
client.setServer(AWS_IOT_ENDPOINT, MQTT_PORT);
client.setBufferSize(512);
client.setCallback(messageReceived);
connectToMqtt();
getShadow();
}
Still no luck unfortunately.. here is the output:
Attempting to connect to SSID: dehei.local...ok!
MQTT connecting connected!
Requesting Shadow [$aws/things/chicken-door/shadow/name/door/get]:
10658
15659
20660