System Architecture
High-level design of the CyberRod IoT pipeline — from ultrasonic sensing to cloud dashboard.
System Block Diagram
End-to-end data flow from sensors to cloud dashboard.
Architecture Layers
Four-layer architecture from physical sensing to cloud application.
Sensing Layer
Ultrasonic distance sensor (UART, 9600 baud) detects fish proximity with 4-byte frame protocol. SHT4x temperature/humidity sensor (I2C, addr 0x70) provides environmental data with CRC-8 validation. IMU sensor (I2C, shared bus) measures 3-axis acceleration and angular velocity for rod motion and bite detection.
Processing Layer
Si917 ARM Cortex-M4F runs FreeRTOS with concurrent tasks: fish detection (20ms), IMU sensing (100ms), temperature upload (300ms), MQTT connection (100ms), OTA updates (200ms), and watchdog (1s). Hardware watchdog ensures system reliability.
Communication Layer
Si917 integrated Wi-Fi (802.11 b/g/n, WPA2) connects to local network. Custom MQTT 3.1.1 client over BSD sockets publishes to 7 topics with 16-deep queue and auto-reconnect. HTTP OTAF v2 for firmware updates.
Application Layer
Azure VM hosts MQTT broker (port 1883) and HTTP server (port 80). Node-RED v4.1.8 with FlowFuse Dashboard 2.0 provides real-time sensor visualization with custom nautical-themed CSS. OTA triggered by MQTT message.
Data Flow
How sensor data travels from the fishing rod to the cloud dashboard.
1. Sensor Sampling
Ultrasonic sensor sends 4-byte distance frames (header 0xFF + 2-byte distance + checksum) via UART at 9600 baud. SHT4x sensor reads temperature and humidity via I2C with high repeatability command (0x7866). IMU sensor reads 3-axis acceleration and angular velocity over the shared I2C0 bus for rod motion analysis.
2. Data Processing
Fish detection task classifies distance into states (0=none, 1=near <1.2m, 2=very near <100mm). Temperature task converts raw readings: T = -45 + 175*(raw/65536), H = -6 + 125*(raw/65536). IMU task computes acceleration magnitude and detects sudden rod jerks indicating potential fish bites.
3. MQTT Publishing
Processed data queued in 16-deep MQTT publish queue. MQTT task drains one message per loop (100ms period) to Azure VM broker at 20.230.132.231:1883. Client ID: si917-devboard-cyberrod, Keepalive: 60s.
4. Dashboard Visualization
Node-RED subscribes to all CyberRod/* topics. FlowFuse Dashboard 2.0 renders real-time gauges, charts, and status indicators with custom nautical-themed CSS design.
5. Remote Updates
Send "1" to CyberRod/Update MQTT topic to trigger OTA. Firmware downloaded via HTTP from Azure VM (wifi_http_otaf_soc.rps) using Si917's built-in OTAF v2 API.