# hello-t-energy-s3 T-Energy-S3 MQTT battery monitor. Connects to WiFi and publishes battery voltage over MQTT/TLS. ## Setup (one-time) ```bash # Add ESP32 board manager arduino-cli config init arduino-cli config add board_manager.additional_urls https://espressif.github.io/arduino-esp32/package_esp32_index.json # Install ESP32 core arduino-cli core update-index arduino-cli core install esp32:esp32 # Install PubSubClient library arduino-cli lib install "PubSubClient" ``` ## Configuration Copy `config.example.h` to `config.h` and fill in your values: ```bash cp config.example.h config.h ``` Then edit `config.h` with your WiFi and MQTT settings. ## Build & Upload ```bash make compile # compile only make upload # upload only make monitor # serial monitor make flash # compile + upload make all # compile + upload + monitor ``` If your port differs from `/dev/ttyACM0`, override it: ```bash make flash PORT=/dev/ttyUSB0 ``` ## Behavior 1. On boot: connects to WiFi and MQTT, publishes voltage 3 times 2. Enters deep sleep 3. Press BOOT button to wake 4. Repeat ## Expected Output ``` === T-Energy-S3 MQTT Monitor === Initial boot MAC Address: AA:BB:CC:DD:EE:FF Connecting to MyNetwork... Connected! IP: 192.168.1.100 Connecting to MQTT mqtt.example.com:8883... MQTT connected! Battery: 4200 mV Published to my/topic: 4200 Battery: 4200 mV Published to my/topic: 4200 Battery: 4200 mV Published to my/topic: 4200 Entering deep sleep... press button to wake ```