Firmware for the Altruist environmental sensor station, built on ESP32-C6.
In the Robonomics sensors architecture, the Altruist plays two roles:
- Datalog reporting: Signs and sends measurement datalogs directly to the Robonomics parachain via RPC node (every 10 minutes).
- Connectivity reporting: Signs and sends measurement data to Sensors Connectivity Provider nodes via HTTP POST on port 65 (every 30 seconds).
Altruist (ESP32-C6)
|
|-- Signed extrinsic --> Robonomics Parachain (Polkadot)
| |
| RoSeMAN indexes --> MongoDB --> sensors.social
|
+-- Signed msg HTTP:65 --> Sensors Connectivity Provider
|-- Real-time: IPFS pubsub --> Robonomics dApp
+-- Batch: IPFS pin --> datalog hash --> Parachain
An ED25519 keypair is generated on first boot and stored in SPIFFS (/config.json). This identity is used to sign both datalog extrinsics and connectivity messages.
The connectivity server pool is defined in robonomics_servers.h (currently 3 servers). On startup, the device polls all servers and picks one where it is already registered, or the least loaded one.
Hardware reset (GPIO7) clears WiFi credentials and password but preserves the Robonomics identity.
Outdoor station (ESP32-C6 or ESP32-C3). Provides environmental and air quality measurements. ESP32-C6: discovered by Insight via mDNS (altruist._tcp). ESP32-C3: no mDNS (flash budget) — pair Insight with custom Urban IP in config; open the device by LAN IP in a browser.
Indoor station (ESP32-C6) with display and QR code support. Can aggregate data from nearby Urban devices over the local network.
| Sensor | Measurement |
|---|---|
| SDS011 | PM2.5, PM10 |
| BMx280 (BMP/BME 280) | Temperature, humidity, pressure |
| BME680 | Temperature, humidity, pressure, gas resistance |
| SCD4x (SCD40/SCD41) | CO2, temperature, humidity |
| RadSens | Radiation (counts per minute) |
| I2S microphone | Noise level (dBA) |
| GPS (Neo-6M) | Latitude, longitude |
| HTTP Altruist sensor | Data from linked Urban devices |
The project uses PlatformIO. Build environments are defined in platformio.ini.
Build for a specific target:
pio run -e esp32c6_urban_en
pio run -e esp32c6_inside_enFlash:
pio run -e esp32c6_urban_en --target uploadAvailable environments: esp32c6_urban_en, esp32c6_urban_ru, esp32c6_inside_en, esp32c6_inside_ru (plus _dev variants with debug output).
On first boot (or after reset), the device starts in Access Point mode. Connect to its WiFi network and open the configuration page to set:
- WiFi credentials
- GPS coordinates
- Sensor enable/disable
- API endpoints
After configuration, the device restarts and connects to the specified WiFi network. The web UI remains available on the local network for reconfiguration.
UPshort press - previous screenDOWNshort press - next screenUP/DOWNshort press on Graphs screen - switch graph (at edges switches screen). Long press changes screenSETlong press - sleepSET+DOWNlong press (4s) - reset WiFi configurationSET+DOWNpressed while powering on - reset all configuration
Reset button (GPIO7)
- While powering on (hold before/at power-on) — factory reset: deletes the full
config.jsonincluding the Robonomics identity (same as InsightSET+DOWNat boot). - While running — hold for more than 10 seconds, then release: clears Wi‑Fi credentials and the web UI password only; Robonomics identity is preserved and the device reboots into the setup captive portal. Boot-time and runtime actions do not overlap — a power-on hold is consumed as factory reset only.
- LEDs turn blue briefly while the runtime Wi‑Fi reset is applied.
Status LEDs (NeoPixel ring on ESP32-C6 Urban; both pixels show the same color)
| Color | Meaning |
|---|---|
| Green | Normal operation — Wi‑Fi connected and on-chain Robonomics datalog is healthy. |
| Blue | Setup mode — no saved Wi‑Fi yet, or the captive configuration portal is active. |
| Blue | Also shown while an on-chain datalog transmission is in progress. |
| Green (~3 s) | Last datalog send succeeded (brief flash after transmission). |
| Red (~3 s) | Last datalog send failed (brief flash after transmission). |
| Red (steady) | Wi‑Fi disconnected or datalog unhealthy for more than 10 minutes. |
Map/connectivity HTTP errors do not drive the steady red state — LED status reflects Robonomics datalog health, not the sensors map POST.
LED indication can be disabled in the web configuration.
All development changes should be submitted as pull requests against the beta branch. The master branch reflects the current release firmware.
To add a Connectivity Robonomics Server, fork this repository and edit robonomics_servers.h. Add your server:
{"<server_address>", REGION_XX}Available regions: REGION_GLOBAL, REGION_EU, REGION_AS, REGION_AF, REGION_AU, REGION_NA, REGION_SA.