What you need
- An ESP32 board (any variant — ESP32-WROOM, ESP32-S3, etc.)
- A relay module wired to your ESP32 (or just an LED for testing)
- PlatformIO installed in VS Code
- A PumpLink account — sign up free
Step 1 — Register your device
Sign in to the PumpLink dashboard, go to Devices → Add device, give it a name, and click Register. You’ll see a Device ID and a Password shown once. Copy both immediately — the password is never shown again. If you lose it, you’ll need to regenerate credentials and reflash.Step 2 — Create your project
Create a new folder and add the following files:platformio.ini
board to match your specific board if needed (e.g. esp32-s3-devkitc-1).
src/config.h
src/ca_cert.h
This is the Let’s Encrypt root CA certificate. It allows the ESP32 to verify
the TLS connection to mqtt.pumplink.dev without disabling certificate
verification.
The CA certificate above verifies
mqtt.pumplink.dev’s TLS certificate chain.
You do not need to update this when PumpLink renews its broker certificate —
the root CA is valid until 2035.src/main.cpp
Step 3 — Flash
Open the project in VS Code with PlatformIO, then click Upload or run:pio device monitor) and you should see:
Step 4 — Verify
Go to the PumpLink dashboard — your device should appear as Online. To trigger an activation without writing any client code, connect to the broker with MQTT Explorer using your device’s username and password (same host and port as your firmware —mqtt.pumplink.dev:41102, TLS enabled). Then:
- Subscribe to
device/42/#(replace42with your device ID) to watch all traffic for your device. - Publish
ontodevice/42/command.
device/42/ack within 10 seconds. Publish off to the same command topic to turn it back off.
The serial monitor will show:
This manual publish is just for testing. In production, the backend publishes
on/off to the command topic on your behalf when a user triggers an activation from the dashboard or API — see the device contract for the full handshake.Troubleshooting
Device doesn’t appear in dashboard- Check serial monitor for connection errors
- Verify
MQTT_USERNAMEis your numeric device ID (e.g."42"not"device_42") - Verify
MQTT_PASSWORDis correct — regenerate from dashboard if unsure
- Confirm
mqtt.pumplink.devresolves from your network - The CA cert in
ca_cert.hmust be complete and unmodified
- Verify
RELAY_PINmatches your wiring - Most relay modules are active HIGH —
digitalWrite(HIGH)closes the relay
- The backend expects an ack within 10 seconds of sending
"on" - Check that
topicAck()publishes successfully — look for[MQTT] ack sentin serial
Next steps
- Device contract — full MQTT topic and handshake reference
- Dashboard — manage devices, users, and schedules
- Support: hello@pumplink.dev