Giter Site home page Giter Site logo

esp-idf-aws-iot's Introduction

ESP-IDF AWS IoT

Steps

  • Install PlatformIO Core

  • Create a device and export the three certificates to:

    • src/aws-root-ca.pem: Retrieve from HERE
    • src/private.pem.key: Private Key Certificate
    • src/certificate.pem.crt: Device Certificate
  • Update #define CONFIG_AWS_IOT_MQTT_HOST "xxxxxxxxxxxxx-ats.iot.us-east-1.amazonaws.com" in sdkconfig.h

    • Run aws iot describe-endpoint --endpoint-type iot:Data-ATS to get address
  • Update build_flags in platformio.ini

    • -DCONFIG_WIFI_SSID=\"wifissid\"
    • -DCONFIG_WIFI_PASSWORD=\"wifipass\"
    • -DCONFIG_AWS_IOT_TOPIC=\"test_topic/esp32\"
  • Run these commands:

    # Build project
    platformio run
    
    # If you get an error `Kconfig.projbuild' not found (in 'source "$COMPONENT_KCONFIGS_PROJBUILD"').`, run this command
    pip3 uninstall kconfiglib
    
    # Upload firmware
    platformio run --target upload

Attribution

esp-idf-aws-iot's People

Contributors

t04glovern avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

esp-idf-aws-iot's Issues

Issues when building

Hi mate,

To start with, I just want to say great article and example code so I want to give some feedback for others that will try it out. I noticed that the link in the article https://devopstar.com/2020/03/14/easy-aws-iot-with-esp-idf for AWS IoT documentation page is pointing to the github repo and not to the aws docs.

Another thing I bumped into was when building, it looks like its not possible to build due to the headers / lib it tries to fetch. Attaching the output from the build bellow

> Executing task: platformio run --environment esp32dev <

Processing esp32dev (platform: espressif32; framework: espidf; board: esp32dev)
------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (1.12.4) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-espidf 3.40001.200521 (4.0.1) 
 - tool-cmake 3.16.4 
 - tool-esptoolpy 1.20600.0 (2.6.0) 
 - tool-ninja 1.7.1 
 - toolchain-esp32ulp 1.22851.191205 (2.28.51) 
 - toolchain-xtensa32 2.80200.200827 (8.2.0)
Warning! Starting with ESP-IDF v4.0, new project structure is required: 
https://docs.platformio.org/en/latest/frameworks/espidf.html#project-structure
Reading CMake configuration...
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio/build/esp32dev/esp-idf/src/subscribe_publish_sample.c.o
Generating partitions .pio/build/esp32dev/partitions.bin
Archiving .pio/build/esp32dev/esp-idf/app_trace/libapp_trace.a
Indexing .pio/build/esp32dev/esp-idf/app_trace/libapp_trace.a
Archiving .pio/build/esp32dev/esp-idf/app_update/libapp_update.a
Indexing .pio/build/esp32dev/esp-idf/app_update/libapp_update.a
src/subscribe_publish_sample.c:46:10: fatal error: aws_iot_config.h: No such file or directory

************************************************************************
* Looking for aws_iot_config.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:aws_iot_config.h"
* Web  > https://platformio.org/lib/search?query=header:aws_iot_config.h
*
************************************************************************

 #include "aws_iot_config.h"
          ^~~~~~~~~~~~~~~~~~
compilation terminated.
Archiving .pio/build/esp32dev/esp-idf/asio/libasio.a
Indexing .pio/build/esp32dev/esp-idf/asio/libasio.a
Compiling .pio/build/esp32dev/esp-idf/bootloader_support/src/bootloader_clock.c.o
Compiling .pio/build/esp32dev/esp-idf/bootloader_support/src/bootloader_common.c.o
Compiling .pio/build/esp32dev/esp-idf/bootloader_support/src/bootloader_flash.c.o
*** [.pio/build/esp32dev/esp-idf/src/subscribe_publish_sample.c.o] Error 1
============================================== [FAILED] Took 2.10 seconds ==============================================
The terminal process "platformio 'run', '--environment', 'esp32dev'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

Btw, I did test https://github.com/platformio/platform-espressif32/tree/master/examples/espidf-aws-iot and that one works

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.