0

I'm trying to connect a NodeMCU ESP8266 and upload a shadow. I am following the tutorial from IoT Design Pro. When i first ran it, I did see the shadow updated on AWS. On subsequent loops, it stopped updating. Now i get a message "can't setup SSL connection". Here are my code and the serial output window:

#include <ESP8266WiFi.h>

#include <AmazonIOTClient.h>

#include "ESP8266AWSImplementations.h"

Esp8266HttpClient httpClient;

Esp8266DateTimeProvider dateTimeProvider;

AmazonIOTClient iotClient;

ActionError actionError;

char *ssid="xxxxxxxxxxxxxxxxxxx";

char *password="xxxxxxxxxxx";

void setup() {

  Serial.begin(115200);

  delay(10);

  // Connect to WAP

  Serial.print("Connecting to ");

  Serial.println(ssid);

  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {

    delay(500);

    Serial.print(".");

  }

  Serial.println("");

  Serial.println("WiFi connected");

  Serial.println("IP address: ");

  Serial.println(WiFi.localIP());



  iotClient.setAWSRegion("us-west-2");//axxxxxxxxxxxb-ats.iot.us-west-2.amazonaws.com

  iotClient.setAWSEndpoint("amazonaws.com");

  iotClient.setAWSDomain("axxxxxxxxxxxb-ats.iot.us-west-2.amazonaws.com");

  iotClient.setAWSPath("/things/MyThing/shadow");

  iotClient.setAWSKeyID("AxxxxxxxxxxxxxxxxxxW");

  iotClient.setAWSSecretKey("BxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxWmN1");

  iotClient.setHttpClient(&httpClient);

  iotClient.setDateTimeProvider(&dateTimeProvider);

}



void loop(){

  char* shadow = "{\"state\":{\"reported\": {\"Foobar\": \"bar\"}}}";

  char* result = iotClient.update_shadow(shadow, actionError);

  Serial.print(result);

  delay(500000);

}

with serial output:

WiFi connected
IP address: 
10.1.10.128
a2rl12mynda91b-ats.iot.us-west-2.amazonaws.com
443
POST /things/MyThing/shadow HTTP/1.1
Content-Type: application/json
Connection: close
Content-Length: 41
Host: axxxxxxxxxxxb-ats.iot.us-west-2.amazonaws.com
x-amz-content-sha256: d8af3f7d20512e6c2f9feddf0e729a9f9201023da39cde8ffa6826175c069174
x-amz-date: 20200122T221521Z
Authorization: AWS4-HMAC-SHA256 Credential=AxxxxxxxxxxxxxxxxxxW/20200122/us-west-2/iotdata/aws4_request,SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date,Signature=1d5e8b7d70a67d91704403796fd7bdae28b7f9396523314af98e3e1857b4368a

{"state":{"reported": {"Foobar": "bar"}}}




can't setup SSL connection

And AWS IoT shadow output: enter image description here Does the serial output indicate it connected or not? I would think with the Authorization line it would be implying it is connecting, no? I can't see where I am going wrong.

Thanks.

3
  • I am testing the same tutorial code and I get the same error. Any progress on your side to resolve this? Commented Jan 29, 2020 at 22:25
  • Sorry, not yet. I asked a more specific related question about how to diagnose the problem, but no answer yet. Command to read AWS SSL connection error with ESP8266 Commented Feb 4, 2020 at 6:58
  • Any updates on this yet? Commented Feb 14, 2020 at 7:20

1 Answer 1

0

A similar problem happened to me.

Having 2 boards ESP32 and ESP8266 only 32 were able to make the request over HTTPS.

Option 1: Send requests without SSL

Option 2: Send requests with the correct fingerprint

Some helpful links:

https://buger.dread.cz/simple-esp8266-https-client-without-verification-of-certificate-fingerprint.html

https://github.com/esp8266/Arduino/issues/3417

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.