Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/khanguslee/esp32-spike-code
Random ESP32 code to test things out
https://github.com/khanguslee/esp32-spike-code
Last synced: 18 days ago
JSON representation
Random ESP32 code to test things out
- Host: GitHub
- URL: https://github.com/khanguslee/esp32-spike-code
- Owner: khanguslee
- Created: 2020-02-20T03:53:52.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-02-20T04:51:10.000Z (over 4 years ago)
- Last Synced: 2024-10-02T11:41:09.319Z (about 1 month ago)
- Language: C++
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ESP32 Spike Code
Random ESP32 code to test things out.
## Contents
### Last Will and Testament
Tests out how the Last Will and Testament feature works.
On connection to the broker, the ESP32 device will publish to a `sensor/1/status` topic with the message `Online`. If the ESP32 disconnects from the broker, the broker will send a last will message to all subscribers to this topic. This last will message is set so that it updates the `sensor/1/status` topic with an `Offline` message. When the ESP32 client is online, it will send the message `Hello World` every 5 seconds to the topic `sensor/1/data`.
#### Requirements
Needs to have the `PubSubClient` library installed. This can be added using the Arduino Library Manager.