Difference between revisions of "Hornbill ESP32 IO Control"
Line 2: | Line 2: | ||
In the last tutorial we saw how to use the Arduino ESP32 AWS IOT library to configure an AWS client to subscribe/publish to a topic/thing. At the end of the tutorial we logged the temperature and humidity using DTH11 sensor. | In the last tutorial we saw how to use the Arduino ESP32 AWS IOT library to configure an AWS client to subscribe/publish to a topic/thing. At the end of the tutorial we logged the temperature and humidity using DTH11 sensor. | ||
+ | =Hornbill IO operation= | ||
In this tutorial we will see how to control the ESP32 pins using the AWS IOT. For this we will be using the Hornbill_IO library. Hornbill_IO currently supports the below four operation which will be extended in the near future. | In this tutorial we will see how to control the ESP32 pins using the AWS IOT. For this we will be using the Hornbill_IO library. Hornbill_IO currently supports the below four operation which will be extended in the near future. | ||
#digitalRead | #digitalRead | ||
Line 8: | Line 9: | ||
#analogWrite | #analogWrite | ||
− | We have a specific protocol/json format defined for | + | =Hornbill IO JSON Format= |
− | Json format for sending the data from Control Unit to ESP32 | + | We have a specific protocol/json format defined for the IO operation. |
+ | Below is the Json format for sending the data from Control Unit to ESP32 | ||
<html> | <html> | ||
<script src="https://gist.github.com/SaheblalBagwan/586e9192b6401fc7b2aec1a7a8968fc5.js"></script> | <script src="https://gist.github.com/SaheblalBagwan/586e9192b6401fc7b2aec1a7a8968fc5.js"></script> | ||
</html> | </html> | ||
+ | By the above format Control Unit wants to '''write''' a '''logic 1''' to '''pin 13'''. | ||
+ | |||
+ | |||
+ | Below is the Json format for reporting the data from ESP32 to Server. | ||
+ | <html> | ||
+ | <script src="https://gist.github.com/SaheblalBagwan/f0207bf8280ff75994f2744ef1b6af94.js"></script> | ||
+ | </html> | ||
+ | Here the device is reporting the '''analog''' value('''1023''') of '''pin 36''' . | ||
+ | |||
+ | =Hornbill IO Structure= |
Revision as of 18:23, 13 April 2017
In the last tutorial we saw how to use the Arduino ESP32 AWS IOT library to configure an AWS client to subscribe/publish to a topic/thing. At the end of the tutorial we logged the temperature and humidity using DTH11 sensor.
Hornbill IO operation
In this tutorial we will see how to control the ESP32 pins using the AWS IOT. For this we will be using the Hornbill_IO library. Hornbill_IO currently supports the below four operation which will be extended in the near future.
- digitalRead
- digitalWrite
- analogRead
- analogWrite
Hornbill IO JSON Format
We have a specific protocol/json format defined for the IO operation. Below is the Json format for sending the data from Control Unit to ESP32 By the above format Control Unit wants to write a logic 1 to pin 13.
Below is the Json format for reporting the data from ESP32 to Server.
Here the device is reporting the analog value(1023) of pin 36 .