0

Im using a standart ESP8266 (No NodeMCU) to connect with AWS: and everything goes normally, I can upload the code to my module: Im using the libraries 2.5 for esp8266 I already did my part in AWS

/*
  ESP8266 AWS IoT demo
  Simple demo code to provide static data into AWS IoT platform
#include <ESP8266WiFi.h>
#include <AmazonIOTClient.h>
#include >

Esp8266HttpClient httpClient;
Esp8266DateTimeProvider dateTimeProvider;

AmazonIOTClient iotClient;
ActionError actionError;

const char* ssid = "Bra";
const char* password = "12345678";

void initWLAN()
{
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED)
  {
    delay(500);
  }
}

void initAWS()
{
  iotClient.setAWSRegion("us-east-2");
  iotClient.setAWSEndpoint("amazonaws.com");
  iotClient.setAWSDomain("QWERTYU");
  iotClient.setAWSPath("/things/thingy/shadow");
  iotClient.setAWSKeyID("XDDDDDD");
  iotClient.setAWSSecretKey("XDDDDDDI");
  iotClient.setHttpClient(&httpClient);
  iotClient.setDateTimeProvider(&dateTimeProvider);

}

void setup() {
  Serial.begin(115200);
  delay(10);
  Serial.println("begin");
  initWLAN();
  Serial.println("wlan initialized");
  initAWS();
  Serial.println("iot initialized");
}

void loop()
{
  char shadow[100];
  strcpy(shadow, "{\"state\":{\"reported\":{\"test_value1\":123, \"test_value2\":234}}}");

  Serial.println("Trying to send data");
  Serial.print(shadow);

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

  delay(10000);
}

It seems that everything works fine but, the module load perfect... Im getting the error:

" can't setup SSL connection "

Any ideas? Honestly Im lost

  • Make sure you have the correct domain here: `iotClient.setAWSDomain("QWERTYU")`. Eg. `foobar.iot.eu-west-1.amazonaws.com` – Defozo Feb 29 '20 at 13:27
  • So, in the code everything works? In that case Im gonna check again... Just to be clear, this is not happening because a missing library? – Roberto Franco Feb 29 '20 at 22:51

0 Answers0