IoT Assistant

Open source application designed for quick and easy management of programmable IoT devices

ESP32 Arduino libraries and examples

The provided libraries and examples for the ESP32 cover typical IoT device behaviors, so usually, you only need to copy the example and adjust the settings for your specific project.

A compressed file with all the Arduino libraries needed for the examples is available here

Sensors

When a sensor is integrated into a computer system, its behavior generally falls into one of these categories:

  • Publishing a value periodically over a network interface
  • Publishing a value periodically and also whenever the value changes
  • Any of the above but entering sleep mode in between

Libraries

UML Class Diagram

The main library classes provided are:

  • IoTSensor: Abstract base class that handles periodic publishing of sensor values in collaboration with SensorPublishInterface. It allows registering a callback that will be called to retrieve sensor values periodically.
  • SensorPublishInterface: Abstract class responsible for sending sensor values over a network interface, with derived classes MqttSensorPublishInterface and LoraSensorPublishInterface.
  • ESP32WiFiSTA: Manages WiFi connectivity and provides Client objects needed by some SensorPublishInterface subclasses.
  • ESP32Sensor: Extends IoTSensor with the added capability to optionally enter sleep mode between value publications. Objects can also be configured to automatically get sensor values from GPIOs
  • FireBeetleC6Sensor, M5AtomSensor...: Extends ESP32Sensor with the additional ability to initialize and display information via an LCD or LED, depending on the board.

Examples

Publishing a value periodically over a network interface

Publishing a value periodically and also whenever the value changes

Any of the above but entering sleep mode in between

Actuators

When integrated into a computer system, an actuator receives value updates and periodically publishes its current value, including changes. However, actuators cannot enter sleep mode since they must always be ready to receive a value update (the ESP32 cannot wake up from receiving network frames).

Libraries

The main library classes provided are:

  • IoTActuator: Abstract base class that manages the publication of values in collaboration with ActuatorPublishInterface. It allows registering callbacks to retrieve and update actuator values.
  • ActuatorPublishInterface: Abstract class responsible for sending sensor values over a network interface, with derived classes MqttActuatorPublishInterface. It allows registering a callback that is invoked when an actuator value change command is received.
  • ESP32WiFiSTA: Manages WiFi connectivity and provides Client objects needed by some ActuatorPublishInterface subclasses.
  • ESP32Actuator: Extends IoTSensor with the added capability to automatically get and update GPIOs values
  • M5AtomActuator, M5AtomS3Actuator...: Extends ESP32Actuator with the additional ability to inizialite display information via an LCD or LED, depending on the board.

Examples

GPS

When an GPS is integrated into a computer system, its behavior typically involves publishing the current position periodically or when it changes, and maybe enter sleep mode in between.

Libraries

The main library classes provided are:

  • IoTGPS: Abstract base class that manages periodic value publishing in collaboration with ActuatorPublishInterface. It allows registering callbacks to retrieve and update actuator values.
  • GPSPublishInterface: Abstract class responsible for sending sensor values over a network interface, with derived classes MqttGPSPublishInterface and LoraGPSPublishInterface.
  • ESP32WiFiSTA: Manages WiFi connectivity and provides Client objects needed by some GPSPublishInterface subclasses.
  • ESP32GPS: Extends IoTGPS with the added capability to optionally enter sleep mode between position publications
  • M5AtomGPS, M5AtomS3GPS...: Extends ESP32GPS with the additional ability to initialize and display information via an LCD or LED, depending on the board.

Examples