SlideShare ist ein Scribd-Unternehmen logo
1 von 20
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Webinars
Anton Shmagin, Partner SA
Gavin Adams, SA
Wednesday, July 12th, 2017
AWS IoT with ESP32 and
Mongoose OS
AWS IoT
Espressif
Company behind popular ESP8266 and ESP32 modules
• ESP32:
• 240 MHz dual core Tensilica LX6 MCU (600 DMIPS)
• Integrated 520 KB SRAM
• Integrated 802.11BGN HT40 Wi-Fi transceiver
• Integrated dual mode Bluetooth (classic and BLE)
• 16 MByte flash
Find out more at https://www.espressif.com
Espressif and AWS are co-sponsoring this workshop
Cesanta Mongoose OS (mongoose-os.com)
• Hardware agnostic: ESP32, ESP8266, TI CC3200, STM32 and others
• Secure: SSL/TLS, Microchip ATECC508A crypto-chip support, ESP32
encrypted flash support
• Develop in C or JavaScript, or both
• Networking: MQTT, WebSocket, COAP, HTTP/ HTTPS and other
• Mongoose Embedded Web Server and Networking Library
The power of the ESP32
with AWS IoT
X.509
Certificate
Private
Key
Follow along (for a limited time only)...
http://cowbelle.xyz/iotloftguide
Prerequisites
• AWS CLI configured with valid credentials in the AWS account that
you intend to use
http://docs.aws.amazon.com/cli/latest/userguide/installing.html
• ESP32 Dev board
• A (good!) USB cable to connect the ESP32 board to your computer
• mos – The Mongoose OS flashing tool. Download at
http://www.mongoose-os.com
• git clone of the Mongoose OS repository from GitHub:
Ø git clone https://github.com/cesanta/mongoose-os
Let’ Get Started
• Plugin in the USB cable to your laptop and the ESP32
• The LED module will blink
Start Mos Console:
Ø mos console
You should see:
Using port /dev/cu.SLAB_USBtoUART
Tock uptime: 8.25607 RAM: 166700
Tick uptime: 9.25616 RAM: 166700
Exercise #1 (publish button presses to AWS IoT)
Once you clone git repo, change directory to:
Ø cd mongoose-os/fw/examples/mjs_base
Then execute:
Ø mos build --arch esp32
Ø mos flash
Ø mos wifi SSID PASSWORD
Ø mos aws-iot-setup --aws-region REGION --aws-iot-policy
mos-default *
* mos-default is demo quite permissive policy. Please use more restrictive policies in production!
Change the value of highlighted values to reflect your setup
LED will stop blinking
Exercise #1 (publish button presses to AWS IoT)
Start mos console:
Ø mos console
You should see:
Using port /dev/cu.SLAB_USBtoUART
Tock uptime: 8.25607 RAM: 166700
Tick uptime: 9.25616 RAM: 166700
Tock uptime: 10.2566 RAM: 166700
Published: yes topic: /devices/esp32_xxx/events message:
{"free_ram":166632,"total_ram":0}
I (13755) wifi: pm start, type:0
Exercise #1 (publish button presses to AWS IoT)
• Log in to your AWS IoT account and go to AWS IoT service page
• Click on Test
Exercise #1 (publish button presses to AWS IoT)
• Subscribe to topic /devices/#
Exercise #1 (publish button presses to AWS IoT)
• Pressing button on your ESP32 will publish free RAM to the MQTT topic
/devices/esp_XXX
/devices/esp_XXX
Exercise #2 (Shadow State sets LED)
In the mjs_base directory, copy over the Shadow code:
Ø cp ../mjs_aws_shadow/init.js fs/init.js
Ø edit fw/init.js and change GPIO to:
Ø // TODO: support other platforms
Ø let LED_GPIO = 5;
From mjs_base directory execute:
Ø mos build --arch esp32
Ø mos flash
Ø mos wifi SSID PASSWORD
Ø mos aws-iot-setup --aws-region REGION --aws-iot-policy
mos-default
Exercise #2 (Shadow State sets LED)
Start mos console:
Ø mos console
You should see when you press the button:
[Jul 11 18:05:18.108] Click! Updated: true
[Jul 11 18:05:18.120] mgos_aws_shadow_ev Update: {"state":
{"desired":{"ledOn":false,"foo":2}}, "clientToken": "d7d06332"}
[Jul 11 18:05:18.213] mgos_aws_shadow_ev Version: 5 -> 6 (5)
[Jul 11 18:05:18.225] Event: 3 (UPDATE_ACCEPTED)[Jul 11 18:05:18.235]
mgos_aws_shadow_ev Version: 6 -> 6 (7)
[Jul 11 18:05:18.246] Event: 5 (UPDATE_DELTA)
[Jul 11 18:05:18.252] Reported state: {}
Exercise #2 (Shadow State sets LED)
• Log in to your AWS IoT account and go to AWS IoT service page
• Click on Registry
• Select device
Exercise #2 (Shadow State sets LED)
• View the current shadow state
Exercise #2 (Shadow State sets LED)
• Pressing button on your ESP32 will toggle the LED and the Shadow state
Follow up steps
Go to https://mongoose-os.com/#videos
Follow the examples:
• Internet button
• Smart heater
• ECC508A crypto-element
Cesanta is running a Give Away
https://mongoose-os.com/awsloft
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Webinars
Thank you!
@awscloud
@EspressifSystem
@MongooseOS

Weitere ähnliche Inhalte

Was ist angesagt?

green house monitoring system based arduino uno
green house monitoring system based arduino unogreen house monitoring system based arduino uno
green house monitoring system based arduino unoradenluqmannul
 
Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applicationsNiyas Nazar
 
Iot based smart irrigation system
Iot based smart irrigation systemIot based smart irrigation system
Iot based smart irrigation systemKrishna Vala
 
APIsecure 2023 - Android Applications and API Hacking, Gabrielle Botbol
APIsecure 2023 - Android Applications and API Hacking, Gabrielle BotbolAPIsecure 2023 - Android Applications and API Hacking, Gabrielle Botbol
APIsecure 2023 - Android Applications and API Hacking, Gabrielle Botbolapidays
 
Attribute Based Encryption with Privacy Preserving In Clouds
Attribute Based Encryption with Privacy Preserving In Clouds Attribute Based Encryption with Privacy Preserving In Clouds
Attribute Based Encryption with Privacy Preserving In Clouds Swathi Rampur
 
AppSec EU 2016: Automated Mobile Application Security Assessment with MobSF
AppSec EU 2016: Automated Mobile Application Security Assessment with MobSFAppSec EU 2016: Automated Mobile Application Security Assessment with MobSF
AppSec EU 2016: Automated Mobile Application Security Assessment with MobSFAjin Abraham
 
KazHackStan Doing The IoT Penetration Testing - Yogesh Ojha
KazHackStan Doing The IoT Penetration Testing - Yogesh OjhaKazHackStan Doing The IoT Penetration Testing - Yogesh Ojha
KazHackStan Doing The IoT Penetration Testing - Yogesh OjhaYogesh Ojha
 
High sensitive lpg sensor with gas leakage alert buzzer
High sensitive lpg sensor with gas leakage alert buzzerHigh sensitive lpg sensor with gas leakage alert buzzer
High sensitive lpg sensor with gas leakage alert buzzerJagadeesh Yadav
 
IoT Based Weather Monitoring System for Effective Analytics
IoT Based Weather Monitoring System for Effective AnalyticsIoT Based Weather Monitoring System for Effective Analytics
IoT Based Weather Monitoring System for Effective AnalyticsFerdin Joe John Joseph PhD
 
IoT home automation project
IoT home automation projectIoT home automation project
IoT home automation projectShohin Aheleroff
 

Was ist angesagt? (20)

green house monitoring system based arduino uno
green house monitoring system based arduino unogreen house monitoring system based arduino uno
green house monitoring system based arduino uno
 
Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applications
 
Iot based smart irrigation system
Iot based smart irrigation systemIot based smart irrigation system
Iot based smart irrigation system
 
APIsecure 2023 - Android Applications and API Hacking, Gabrielle Botbol
APIsecure 2023 - Android Applications and API Hacking, Gabrielle BotbolAPIsecure 2023 - Android Applications and API Hacking, Gabrielle Botbol
APIsecure 2023 - Android Applications and API Hacking, Gabrielle Botbol
 
Attribute Based Encryption with Privacy Preserving In Clouds
Attribute Based Encryption with Privacy Preserving In Clouds Attribute Based Encryption with Privacy Preserving In Clouds
Attribute Based Encryption with Privacy Preserving In Clouds
 
AppSec EU 2016: Automated Mobile Application Security Assessment with MobSF
AppSec EU 2016: Automated Mobile Application Security Assessment with MobSFAppSec EU 2016: Automated Mobile Application Security Assessment with MobSF
AppSec EU 2016: Automated Mobile Application Security Assessment with MobSF
 
KazHackStan Doing The IoT Penetration Testing - Yogesh Ojha
KazHackStan Doing The IoT Penetration Testing - Yogesh OjhaKazHackStan Doing The IoT Penetration Testing - Yogesh Ojha
KazHackStan Doing The IoT Penetration Testing - Yogesh Ojha
 
GREEN HOUSE MONITORING SYSTEM BASED ON ARDUINO UNO
GREEN HOUSE MONITORING SYSTEM BASED ON ARDUINO UNOGREEN HOUSE MONITORING SYSTEM BASED ON ARDUINO UNO
GREEN HOUSE MONITORING SYSTEM BASED ON ARDUINO UNO
 
High sensitive lpg sensor with gas leakage alert buzzer
High sensitive lpg sensor with gas leakage alert buzzerHigh sensitive lpg sensor with gas leakage alert buzzer
High sensitive lpg sensor with gas leakage alert buzzer
 
Introduction to Node MCU
Introduction to Node MCUIntroduction to Node MCU
Introduction to Node MCU
 
iCloud keychain
iCloud keychainiCloud keychain
iCloud keychain
 
Smart Lighting Using IOT
Smart Lighting Using IOTSmart Lighting Using IOT
Smart Lighting Using IOT
 
IoT Based Weather Monitoring System for Effective Analytics
IoT Based Weather Monitoring System for Effective AnalyticsIoT Based Weather Monitoring System for Effective Analytics
IoT Based Weather Monitoring System for Effective Analytics
 
Smart home automation system
Smart home automation systemSmart home automation system
Smart home automation system
 
Raspberry Pi
Raspberry Pi Raspberry Pi
Raspberry Pi
 
IoT home automation project
IoT home automation projectIoT home automation project
IoT home automation project
 
Esp8266 basics
Esp8266 basicsEsp8266 basics
Esp8266 basics
 
OpenSSL
OpenSSLOpenSSL
OpenSSL
 
Home automation using blynk
Home automation using blynkHome automation using blynk
Home automation using blynk
 
Raspberry Pi
Raspberry PiRaspberry Pi
Raspberry Pi
 

Ähnlich wie Rapid Prototyping with AWS IoT and Mongoose OS on ESP32 Platform

Rapid Prototyping with AWS IoT and Mongoose OS on ESP8266, ESP32, and CC3200 ...
Rapid Prototyping with AWS IoT and Mongoose OS on ESP8266, ESP32, and CC3200 ...Rapid Prototyping with AWS IoT and Mongoose OS on ESP8266, ESP32, and CC3200 ...
Rapid Prototyping with AWS IoT and Mongoose OS on ESP8266, ESP32, and CC3200 ...Amazon Web Services
 
Starting Raspberry Pi
Starting Raspberry PiStarting Raspberry Pi
Starting Raspberry PiLloydMoore
 
IoT: Internet of Things with Python
IoT: Internet of Things with PythonIoT: Internet of Things with Python
IoT: Internet of Things with PythonLelio Campanile
 
Qiscus bot esp8266
Qiscus bot esp8266Qiscus bot esp8266
Qiscus bot esp8266Ashari Juang
 
Moksha - HTML5/CSS with Qt5+Snowshoe on AM335x
Moksha - HTML5/CSS with Qt5+Snowshoe on AM335xMoksha - HTML5/CSS with Qt5+Snowshoe on AM335x
Moksha - HTML5/CSS with Qt5+Snowshoe on AM335xPrabindh Sundareson
 
NodeMCU ESP8266 workshop 1
NodeMCU ESP8266 workshop 1NodeMCU ESP8266 workshop 1
NodeMCU ESP8266 workshop 1Andy Gelme
 
Cloud Storage Introduction ( CEPH )
Cloud Storage Introduction ( CEPH )  Cloud Storage Introduction ( CEPH )
Cloud Storage Introduction ( CEPH ) Alex Lau
 
Hardwear.io 2018 BLE Security Essentials workshop
Hardwear.io 2018 BLE Security Essentials workshopHardwear.io 2018 BLE Security Essentials workshop
Hardwear.io 2018 BLE Security Essentials workshopSlawomir Jasek
 
Build WiFi gadgets using esp8266
Build WiFi gadgets using esp8266Build WiFi gadgets using esp8266
Build WiFi gadgets using esp8266Baoshi Zhu
 
Tesla Hacking to FreedomEV
Tesla Hacking to FreedomEVTesla Hacking to FreedomEV
Tesla Hacking to FreedomEVJasper Nuyens
 
the NML project
the NML projectthe NML project
the NML projectLei Yang
 
MIKE BY DHI SAAS - New features as of October 2014
MIKE BY DHI SAAS - New features as of October 2014MIKE BY DHI SAAS - New features as of October 2014
MIKE BY DHI SAAS - New features as of October 2014Stephen Flood
 
ChromePad - Chromium OS for ThinkPad
ChromePad - Chromium OS for ThinkPadChromePad - Chromium OS for ThinkPad
ChromePad - Chromium OS for ThinkPadAndrewWright224
 
Spectre meltdown performance_tests - v0.3
Spectre meltdown performance_tests - v0.3Spectre meltdown performance_tests - v0.3
Spectre meltdown performance_tests - v0.3David Pasek
 
LT04 IDNOG04 - Affan Basalamah (ITB) - Documenting your network
LT04 IDNOG04 - Affan Basalamah (ITB) - Documenting your networkLT04 IDNOG04 - Affan Basalamah (ITB) - Documenting your network
LT04 IDNOG04 - Affan Basalamah (ITB) - Documenting your networkIndonesia Network Operators Group
 
IDNOG 4 Lightning Talks - Documenting your Network in 3 Simple Steps
IDNOG 4 Lightning Talks - Documenting your Network in 3 Simple StepsIDNOG 4 Lightning Talks - Documenting your Network in 3 Simple Steps
IDNOG 4 Lightning Talks - Documenting your Network in 3 Simple StepsAffan Basalamah
 
ChromePad - Chromium OS ThinkPad X220
ChromePad - Chromium OS ThinkPad X220ChromePad - Chromium OS ThinkPad X220
ChromePad - Chromium OS ThinkPad X220AndrewWright224
 

Ähnlich wie Rapid Prototyping with AWS IoT and Mongoose OS on ESP32 Platform (20)

Rapid Prototyping with AWS IoT and Mongoose OS on ESP8266, ESP32, and CC3200 ...
Rapid Prototyping with AWS IoT and Mongoose OS on ESP8266, ESP32, and CC3200 ...Rapid Prototyping with AWS IoT and Mongoose OS on ESP8266, ESP32, and CC3200 ...
Rapid Prototyping with AWS IoT and Mongoose OS on ESP8266, ESP32, and CC3200 ...
 
Starting Raspberry Pi
Starting Raspberry PiStarting Raspberry Pi
Starting Raspberry Pi
 
IoT: Internet of Things with Python
IoT: Internet of Things with PythonIoT: Internet of Things with Python
IoT: Internet of Things with Python
 
Qiscus bot esp8266
Qiscus bot esp8266Qiscus bot esp8266
Qiscus bot esp8266
 
Moksha - HTML5/CSS with Qt5+Snowshoe on AM335x
Moksha - HTML5/CSS with Qt5+Snowshoe on AM335xMoksha - HTML5/CSS with Qt5+Snowshoe on AM335x
Moksha - HTML5/CSS with Qt5+Snowshoe on AM335x
 
NodeMCU ESP8266 workshop 1
NodeMCU ESP8266 workshop 1NodeMCU ESP8266 workshop 1
NodeMCU ESP8266 workshop 1
 
Cloud Storage Introduction ( CEPH )
Cloud Storage Introduction ( CEPH )  Cloud Storage Introduction ( CEPH )
Cloud Storage Introduction ( CEPH )
 
WiFi SoC ESP8266
WiFi SoC ESP8266WiFi SoC ESP8266
WiFi SoC ESP8266
 
Hardwear.io 2018 BLE Security Essentials workshop
Hardwear.io 2018 BLE Security Essentials workshopHardwear.io 2018 BLE Security Essentials workshop
Hardwear.io 2018 BLE Security Essentials workshop
 
Build WiFi gadgets using esp8266
Build WiFi gadgets using esp8266Build WiFi gadgets using esp8266
Build WiFi gadgets using esp8266
 
Gns3
Gns3Gns3
Gns3
 
Tesla Hacking to FreedomEV
Tesla Hacking to FreedomEVTesla Hacking to FreedomEV
Tesla Hacking to FreedomEV
 
One-Man Ops
One-Man OpsOne-Man Ops
One-Man Ops
 
the NML project
the NML projectthe NML project
the NML project
 
MIKE BY DHI SAAS - New features as of October 2014
MIKE BY DHI SAAS - New features as of October 2014MIKE BY DHI SAAS - New features as of October 2014
MIKE BY DHI SAAS - New features as of October 2014
 
ChromePad - Chromium OS for ThinkPad
ChromePad - Chromium OS for ThinkPadChromePad - Chromium OS for ThinkPad
ChromePad - Chromium OS for ThinkPad
 
Spectre meltdown performance_tests - v0.3
Spectre meltdown performance_tests - v0.3Spectre meltdown performance_tests - v0.3
Spectre meltdown performance_tests - v0.3
 
LT04 IDNOG04 - Affan Basalamah (ITB) - Documenting your network
LT04 IDNOG04 - Affan Basalamah (ITB) - Documenting your networkLT04 IDNOG04 - Affan Basalamah (ITB) - Documenting your network
LT04 IDNOG04 - Affan Basalamah (ITB) - Documenting your network
 
IDNOG 4 Lightning Talks - Documenting your Network in 3 Simple Steps
IDNOG 4 Lightning Talks - Documenting your Network in 3 Simple StepsIDNOG 4 Lightning Talks - Documenting your Network in 3 Simple Steps
IDNOG 4 Lightning Talks - Documenting your Network in 3 Simple Steps
 
ChromePad - Chromium OS ThinkPad X220
ChromePad - Chromium OS ThinkPad X220ChromePad - Chromium OS ThinkPad X220
ChromePad - Chromium OS ThinkPad X220
 

Mehr von Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

Mehr von Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Rapid Prototyping with AWS IoT and Mongoose OS on ESP32 Platform

  • 1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Webinars Anton Shmagin, Partner SA Gavin Adams, SA Wednesday, July 12th, 2017 AWS IoT with ESP32 and Mongoose OS
  • 3. Espressif Company behind popular ESP8266 and ESP32 modules • ESP32: • 240 MHz dual core Tensilica LX6 MCU (600 DMIPS) • Integrated 520 KB SRAM • Integrated 802.11BGN HT40 Wi-Fi transceiver • Integrated dual mode Bluetooth (classic and BLE) • 16 MByte flash Find out more at https://www.espressif.com Espressif and AWS are co-sponsoring this workshop
  • 4. Cesanta Mongoose OS (mongoose-os.com) • Hardware agnostic: ESP32, ESP8266, TI CC3200, STM32 and others • Secure: SSL/TLS, Microchip ATECC508A crypto-chip support, ESP32 encrypted flash support • Develop in C or JavaScript, or both • Networking: MQTT, WebSocket, COAP, HTTP/ HTTPS and other • Mongoose Embedded Web Server and Networking Library
  • 5. The power of the ESP32 with AWS IoT X.509 Certificate Private Key
  • 6. Follow along (for a limited time only)... http://cowbelle.xyz/iotloftguide
  • 7. Prerequisites • AWS CLI configured with valid credentials in the AWS account that you intend to use http://docs.aws.amazon.com/cli/latest/userguide/installing.html • ESP32 Dev board • A (good!) USB cable to connect the ESP32 board to your computer • mos – The Mongoose OS flashing tool. Download at http://www.mongoose-os.com • git clone of the Mongoose OS repository from GitHub: Ø git clone https://github.com/cesanta/mongoose-os
  • 8. Let’ Get Started • Plugin in the USB cable to your laptop and the ESP32 • The LED module will blink Start Mos Console: Ø mos console You should see: Using port /dev/cu.SLAB_USBtoUART Tock uptime: 8.25607 RAM: 166700 Tick uptime: 9.25616 RAM: 166700
  • 9. Exercise #1 (publish button presses to AWS IoT) Once you clone git repo, change directory to: Ø cd mongoose-os/fw/examples/mjs_base Then execute: Ø mos build --arch esp32 Ø mos flash Ø mos wifi SSID PASSWORD Ø mos aws-iot-setup --aws-region REGION --aws-iot-policy mos-default * * mos-default is demo quite permissive policy. Please use more restrictive policies in production! Change the value of highlighted values to reflect your setup LED will stop blinking
  • 10. Exercise #1 (publish button presses to AWS IoT) Start mos console: Ø mos console You should see: Using port /dev/cu.SLAB_USBtoUART Tock uptime: 8.25607 RAM: 166700 Tick uptime: 9.25616 RAM: 166700 Tock uptime: 10.2566 RAM: 166700 Published: yes topic: /devices/esp32_xxx/events message: {"free_ram":166632,"total_ram":0} I (13755) wifi: pm start, type:0
  • 11. Exercise #1 (publish button presses to AWS IoT) • Log in to your AWS IoT account and go to AWS IoT service page • Click on Test
  • 12. Exercise #1 (publish button presses to AWS IoT) • Subscribe to topic /devices/#
  • 13. Exercise #1 (publish button presses to AWS IoT) • Pressing button on your ESP32 will publish free RAM to the MQTT topic /devices/esp_XXX /devices/esp_XXX
  • 14. Exercise #2 (Shadow State sets LED) In the mjs_base directory, copy over the Shadow code: Ø cp ../mjs_aws_shadow/init.js fs/init.js Ø edit fw/init.js and change GPIO to: Ø // TODO: support other platforms Ø let LED_GPIO = 5; From mjs_base directory execute: Ø mos build --arch esp32 Ø mos flash Ø mos wifi SSID PASSWORD Ø mos aws-iot-setup --aws-region REGION --aws-iot-policy mos-default
  • 15. Exercise #2 (Shadow State sets LED) Start mos console: Ø mos console You should see when you press the button: [Jul 11 18:05:18.108] Click! Updated: true [Jul 11 18:05:18.120] mgos_aws_shadow_ev Update: {"state": {"desired":{"ledOn":false,"foo":2}}, "clientToken": "d7d06332"} [Jul 11 18:05:18.213] mgos_aws_shadow_ev Version: 5 -> 6 (5) [Jul 11 18:05:18.225] Event: 3 (UPDATE_ACCEPTED)[Jul 11 18:05:18.235] mgos_aws_shadow_ev Version: 6 -> 6 (7) [Jul 11 18:05:18.246] Event: 5 (UPDATE_DELTA) [Jul 11 18:05:18.252] Reported state: {}
  • 16. Exercise #2 (Shadow State sets LED) • Log in to your AWS IoT account and go to AWS IoT service page • Click on Registry • Select device
  • 17. Exercise #2 (Shadow State sets LED) • View the current shadow state
  • 18. Exercise #2 (Shadow State sets LED) • Pressing button on your ESP32 will toggle the LED and the Shadow state
  • 19. Follow up steps Go to https://mongoose-os.com/#videos Follow the examples: • Internet button • Smart heater • ECC508A crypto-element Cesanta is running a Give Away https://mongoose-os.com/awsloft
  • 20. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Webinars Thank you! @awscloud @EspressifSystem @MongooseOS