Introduction
Have you ever wanted to be able to quickly prototype an ESP32 project using Python from your laptop or PC? Or, you need to control and monitor an ESP32 remotely but do not wish to give up the performance of a C++-based ESP32 sketch. Would you like to be informed of any GPIO data changes without constantly polling to determine if any changes occurred? Would having a timestamp for each data change be a valuable addition to your project? You can enjoy these features with the telemetrix library for the ESP32!
How Does It Work?
A Telemetrix application consists of a client written in Python using the Telemetrix API and a server, a fixed ESP32 resident sketch written in C/C++ for the ESP32. For the client, you may choose between a threaded API (telemetrix_esp32) or, if you wish, an asyncio API (telemetrix_aio_esp32).
Once you select an API, either telemetrix_esp32 or telemetrix_aio_esp32, you may pair it with any of the servers.
The client and server communicate over WIFI or Bluetooth.
NOTE: The threaded BLE API is not incompatible with Windows or Raspberry Pi OS. However, the asyncio API is compatible with both.
Callbacks Are Cool
Telemetrix utilizes the concept of a callback function to report the data changes to your application. You register your callback function with Telemetrix when you set the mode of operation for the pin. Once you establish a callback for an input pin, your application is automatically notified of the data change. There is no need for polling.
Features
Both APIs share a common set of features:
- Analog Input
- Analog (PWM) Output
- Analog (DAC) Output
- Digital Input
- Digital Input with Pull Up
- Digital Input with Pull Down
- Digital Output
- Touch Pin Input
- I2C Communications Protocol Primitives
- SPI Communications Protocol Primitives
- OneWire Communications Protocol Primitives
- Support For HC-SR04 Type Distance Sensors
- Support For DHT Temperature/Humidity Sensors
- Servo Motors
- Stepper Motors
- All Data change events are reported asynchronously via user-registered callback functions and are timestamped.
- Integrated server debugging facilities are included.
API Documentation
Online API documentation is available for the WI-FI And BLE Threaded Model API and a separate API for the WI-FI And BLE Asyncio Model.
Examples
An extensive set of examples is provided for each of the APIs. Links to all the examples are in the table below. You may need to use the horizontal scroll bar at the bottom of the table to see the examples' links.