Device Docs

Connect Hardware Cleanly

The device side should be simple: subscribe to commands, execute them safely, and report back what happened. These docs cover the current proven firmware paths.

Two Current Paths

Today there is a direct builder path and a prebuilt-oriented path.

🤖

ESP32 Direct

Best for builders bringing their own rig online now. You register the device in the dashboard, get MQTT credentials, and wire the firmware directly to your hardware.

📦

ESP32 Prebuilt

Best for future productized hardware. It uses a setup AP, claim-code provisioning flow, and stored config so the hardware can feel like a product instead of a dev kit.

Direct ESP32 Path

This is the simplest real builder path today.

device/esp32_direct/config.example.h
#define YM_MQTT_HOST "yourmove.live"
#define YM_MQTT_PORT 1883
#define YM_MQTT_USERNAME "node_xxx"
#define YM_MQTT_PASSWORD "replace-me"
#define YM_NODE_ID 1

#define YM_PAN_SERVO_PIN 4
#define YM_TILT_SERVO_PIN 5
#define YM_RELAY_PIN 6

The dashboard registration flow gives you the node id and MQTT credentials. You fill those into the direct firmware config and tune the rest of the hardware settings locally.

What the Direct Firmware Already Covers

Current direct-firmware capabilities
- commands subscribe
- ack and result publish
- retained presence
- retained capabilities
- retained state/reported
- telemetry and heartbeat
- local pan/tilt limits
- relay cooldown enforcement

This is enough to get a real turret-style rig online today without inventing the protocol from scratch.

Prebuilt Provisioning Path

This is the product-oriented path when hardware should feel like something a non-developer can claim and set up.

1

Factory Flash

Flash the setup-mode firmware with a factory serial and product provisioning URL.

2

Reserve Claim Code

Reserve a claim code in the dashboard so the hardware can be paired later without exposing raw MQTT details.

3

Setup AP

The device exposes a local setup Wi-Fi and provisioning page so the customer can join their own network and complete the claim flow.

4

Normal Runtime

Once provisioned, the hardware reboots into the normal runtime path and joins the platform using the issued credentials.

Reference Wiring and Pinouts

Current rig patterns should be visible, not hidden in firmware files and old notes.

🔌

Current ESP32 Prebuilt Pinout

Pan servo on GPIO4, tilt servo on GPIO5, relay on GPIO3 in the current prebuilt config path.

🔌

Current ESP32 Direct Pinout

Pan servo on GPIO4, tilt servo on GPIO5, relay on GPIO6 in the current direct firmware reference.

Power Discipline

Do not power servos from the ESP32 logic rail. Use separate regulated power where needed and tie grounds together cleanly.

🛠

Calibrate Early

Confirm direction, center points, limits, and relay behavior before connecting the final load or trusting live users with the rig.