Как подключить Intel Edison Arduino Broard к aws iot - PullRequest
0 голосов
/ 13 января 2020

В настоящее время работает над Intel Edison Wide для подключения aws iot. Может делать пробное мигание, датчик температуры подключается к Arduino Wide, но необходимо вывести данные sh в aws, где я застрял, и поделиться своими фрагментами кода ниже, пожалуйста, проверьте это.

#include "certs.h"
#include <MQTTClient.h>
#include <ArduinoJson.h>
#include <WiFiClientSecure.h>
#include <WiFi.h>
#include <SPI.h>
const char *WIFI_SSID = "Ellot";
const char *WIFI_PASSWORD = "Elliot@1234";

#define DEVICE_NAME "washinsaschine"

#define AWS_IOT_ENDPOINT "********.us-east-1.amazonaws.com"


#define AWS_IOT_TOPIC "$aws/things/"DEVICE_NAME"/shadow/update"

#define AWS_MAX_RECONNECT_TRIES 50

WiFiClientSecure net = WiFiClientSecure();
//WiFiClient net;
MQTTClient client = MQTTClient(256);

char ssid[] = "****";
char pass[] = "*****";
int keyIndex = 0;

int status = WL_IDLE_STATUS;
WiFiServer server(80);

void setup() {
  Serial.begin(115200);      
  pinMode(9, OUTPUT);      
  // check for the presence of the shield:
  if (WiFi.status() == WL_NO_SHIELD) {
    Serial.println("WiFi shield not present");
    while (true);       // don't continue
  }

  String fv = WiFi.firmwareVersion();
  if ( fv != "1.1.0" )
    Serial.println("Please upgrade the firmware");

  // attempt to connect to Wifi network:
  while ( status != WL_CONNECTED) {
    Serial.print("Attempting to connect to Network named: ");
    Serial.println(ssid);                   // print the network name (SSID);

    // Connect to WPA/WPA2 network. Change this line if using open or WEP network:
    status = WiFi.begin(ssid, pass);
    // wait 10 seconds for connection:
    delay(10000);
  }
  server.begin();                           // start the web server on port 80
  connectToAWS();
}
void connectToAWS()
{
  net.setCACert(AWS_CERT_CA);
  net.setCertificate(AWS_CERT_CRT);
  net.setPrivateKey(AWS_CERT_PRIVATE);

  client.begin(AWS_IOT_ENDPOINT, 8883, net);

  int retries = 0;
  Serial.print("Connecting to AWS IOT");

  while (!client.connect(DEVICE_NAME) && retries < AWS_MAX_RECONNECT_TRIES) {
    Serial.print(".");
    delay(100);
    retries++;
  }

Я получаю сообщение об ошибке для библиотеки WiFiClientSecure. "WiFiClientSecure.h: нет такого файла или каталога", не получая эту библиотеку для intel edison wide, есть идеи, какую библиотеку я могу использовать для этого.

...