The Surqo IoT Simulator is a Python script that generates sensor readings matching the climate patterns of Montería, Córdoba, Colombia and publishes them to the same API endpoints used by a physical ESP32 node. Use it to develop and test the backend, frontend dashboard, and alert thresholds without owning or assembling hardware. In HTTP mode the simulator posts to the same REST endpoint as the firmware; in MQTT mode it publishes to the farm-based topicDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ricardomb-tech/surqo/llms.txt
Use this file to discover all available pages before exploring further.
surqo/farms/{farm_id}/sensors (the firmware uses the device-based topic surqo/devices/{mac}/sensors). The JSON payload structure is identical to real firmware readings, so the backend processes both through the same pipeline.
Installation
Usage
- HTTP Mode
- MQTT Mode
HTTP mode posts readings directly to the Surqo REST API. This is the simplest way to get data flowing into a local development environment or the production backend.
CLI Arguments
| Argument | Default | Description |
|---|---|---|
--device-id | ESP32-SIM-001 | Device identifier sent with each reading |
--farm-id | random UUID | Farm UUID to associate readings with |
--interval | 30 | Seconds between readings |
--mode | http | Transport: http or mqtt |
--api-url | https://surqo-api.fly.dev/api/v1/sensors/reading | HTTP endpoint URL |
--mqtt-host | broker.hivemq.com | MQTT broker hostname |
--mqtt-port | 8883 | MQTT TLS port |
--mqtt-user | (empty) | MQTT username |
--mqtt-pass | (empty) | MQTT password |
Climate Model
The simulator implements a physics-inspired model of Córdoba, Colombia’s tropical climate. Every generated value evolves over time — it is not random noise around a fixed mean.Temperature
Sinusoidal day/night cycle: minimum 22°C at 5 am, maximum 34°C at 2 pm, with ±1°C Gaussian noise added to each reading.
Humidity
Inversely correlated with temperature. Base humidity is
55% + (TEMP_MAX − current_temp) × 2.5, clamped to the range 40–95% RH.Soil Moisture
Starts at 55% and depletes via evapotranspiration (0.3%/30 min during daytime, 0.05%/30 min at night). Rain events replenish it by 5–25 mm × 0.8.
UV Index
Solar arc model: 0 before 7 am and after 6 pm, peaks at 11 around noon. Formula:
11 × sin(π × (hour − 7) / 11).Rain Events
Rain is triggered probabilistically based on relative humidity:- Humidity > 85% → 25% chance of a rain event per reading
- Humidity > 78% → 10% chance of a rain event per reading
- Below 78% → no rain
Example Console Output
❌ prefix indicates a failed HTTP POST or MQTT publish.
Sample Reading Payload
This is the exact JSON structure sent by the simulator — and by the real ESP32 firmware — on every reading cycle.firmware_version field is always "1.0.0-sim" for simulator readings, which lets the backend distinguish simulated traffic from real hardware if needed.