π Deploy to Devices
The DEJA deploy wizard reads your device's configuration from the Cloud app, generates the right config files for the device type, and (optionally) flashes the firmware. The same wizard handles all four IO device types β deja-arduino, deja-esp32, deja-esp32-wifi, and deja-mqtt.
π¬ Running the Deploy Wizard
deja deploy
The interactive wizard walks you through:
- πΊοΈ Layout selection β pick the layout from your DEJA Cloud account
- π Device selection β pick a registered device (auto-filtered to flashable types)
- π WiFi/MQTT credentials β only for
deja-esp32-wifianddeja-mqtt: enter SSID, password, broker IP, optional username/password - π¦ Config generation β pulls in the device's configuration along with any effects, turnouts, sensors, and signals assigned to it in the Cloud app, and writes platform-specific config files
- β¬οΈ Build & flash β compiles the firmware (or copies CircuitPython files) and uploads to the connected board
π οΈ
arduino-cliand theesp32:esp32core are auto-installed if not found on your system. Required Arduino libraries (Adafruit PWM Servo Driver Library,ArduinoJson,TurnoutPulser, and β fordeja-esp32-wifiβPubSubClient) are also auto-installed.
π¦ What Gets Deployed
π’ deja-arduino (Arduino Mega over USB)
Generates config.h with:
DEVICE_IDfrom your Cloud device entry- Feature flags based on what's configured (effects β
ENABLE_OUTPUTS, turnouts βENABLE_TURNOUTS, etc.) OUTPINS,SIGNALPINS,SENSORPINSarrays from your device's pin mappingTurnoutPulserdefinitions from your configured turnouts
Then compiles + uploads via arduino-cli against the Mega FQBN.
π deja-esp32 (ESP32 over USB)
Same config.h shape as deja-arduino (the sketch is shared) β only the build target changes. Compiles + uploads via arduino-cli against the ESP32 FQBN at 460800 baud upload speed.
π deja-esp32-wifi (ESP32 over WiFi/MQTT)
Generates config.h with everything deja-arduino ships plus the WiFi/MQTT credentials baked in at build time:
WIFI_SSID,WIFI_PASSWORDβ entered during the wizardMQTT_BROKER,MQTT_PORT,MQTT_USERNAME,MQTT_PASSWORDβ entered during the wizardLAYOUT_ID,DEVICE_ID,TOPIC_IDβ sourced from your Cloud config
Then compiles + uploads against the ESP32 FQBN. After flashing, the device connects to WiFi, subscribes to {TOPIC_ID}/{LAYOUT_ID}/{DEVICE_ID}, and starts processing commands.
π deja-mqtt (Raspberry Pi Pico W)
Generates:
settings.tomlwith WiFi credentials, MQTT broker address, layout ID, and device IDconfig.jsonwith the pin mapping from your device configuration
Then copies code.py, lib/, settings.toml, and config.json to the mounted CIRCUITPY drive β no compilation required.
π οΈ Flashing By Hand
If you'd rather flash an Arduino-family board yourself instead of letting the wizard do it, deja deploy also drops a self-contained bundle you can open in PlatformIO, Arduino CLI, or the Arduino IDE. The exact commands for your board are shown on the Cloud app's device details page and in the bundle's own DEPLOYMENT.md β copy them from there rather than guessing, since they're generated per device type.
deja-mqtt (Pico W) doesn't have a manual build step β it's just CircuitPython files copied to the CIRCUITPY drive, which the wizard does for you.
Your device must be registered in the Cloud app before deploying. See Cloud β Devices.
π Next Steps
- π§ Arduino & ESP32 Setup β hardware setup and
config.hreference - π Pico W Setup β CircuitPython setup and
settings.tomlreference - βοΈ Configuration Reference β all generated file formats per device type