GroPro_Rich/commands.md
2025-02-10 06:04:18 +00:00

2.5 KiB

🌱 ESP32 Greenhouse Controller - Command Reference

System Commands

Command Description
REBOOT / RESTART Reboots the ESP32 immediately.
SET_DEFAULT Restores all configuration to default and reboots the ESP32.

📡 WiFi Commands

Command Description
SET_WIFI <SSID>,<PASSWORD> Updates WiFi credentials & saves them to EEPROM.
SCAN_WIFI Scans for available WiFi networks (human-readable).
SCAN_WIFI JSON Scans for WiFi networks and returns results in JSON format.

📡 MQTT Commands

Command Description
SET_MQTT_HOST <host> Updates MQTT broker hostname or IP.
SET_MQTT_PORT <port> Updates MQTT broker port.
SET_MQTT_USER <username> Updates MQTT username.
SET_MQTT_PASS <password> Updates MQTT password.
SET_MQTT_TOPIC_ROOT <root> Updates MQTT topic root.
SET_MQTT_CONN <host>,<port>,<user>,<pass>,<root> Sets all MQTT settings in one command.

⚙️ Global Configuration Commands

Command Description
SET <parameter> <value> Updates a global configuration parameter.
Supported Parameters publishInterval, wifiReconnectInterval, mqttReconnectInterval, mixerLevelSetpoint, feederLevelSetpoint, mixerFullLevel, mixerRefillLevel, phSettlingTime, phTargetMax, phPumpDuration, mixingPumpDuration, autoMode, bypassFillInterlock

🌱 Per-Plant Configuration Commands

Command Description
SET PLANT<index> MODE <value> Sets the active watering mode for a plant (index starts at 1).
`SET PLANT SETPOINTS <LOW HIGH> `

🔹 Example Usages:

SET_WIFI MyHomeWiFi,SecurePassword123

Output:

WiFi credentials updated: SSID=MyHomeWiFi
SCAN_WIFI JSON

Output:

{
  "networks": [
    { "ssid": "HomeWiFi", "signal": -67, "security": "Protected" },
    { "ssid": "GuestWiFi", "signal": -72, "security": "Protected" }
  ]
}