You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Start services individually
make run-catalog # Resource Catalog (8081)
make run-broker # Message Broker
make run-timeseries # TimeSeries DB (8082)
make run-analytics # Analytics (8083)
make run-account # Account Manager (8084)
make run-control # Control Center (8085)
make run-raspberry-north # Pi North (8086)
make run-raspberry-south # Pi South (8088)
make run-telegram # Telegram Bot (8087)
make run-dashboard # Web Dashboard (5000)
Configuration
Global Thresholds
# Temperature (Celsius)TEMP_MIN_NORMAL=20.0TEMP_MAX_NORMAL=40.0TEMP_ALERT=45.0TEMP_CRITICAL=60.0# Pressure (PSI)PRESSURE_MIN_NORMAL=90.0PRESSURE_MAX_NORMAL=110.0PRESSURE_ALERT=120.0PRESSURE_CRITICAL=150.0
Control Rules (Priority Order)
Priority
Rule
Condition
Action
100
Critical Risk
risk_score >= 90
EMERGENCY_SHUTDOWN
95
High Pressure Relief
pressure > 115 PSI
OPEN_VALVE
90
High Temperature
temperature > 48°C
CLOSE_VALVE
88
Leak Detected
leak_probability > 0.8
CLOSE_VALVE
85
Sensor Failure
sensor_status == "failed"
CLOSE_VALVE
80
Prediction Breach
predicted_temp > 45°C
ALERT_OPERATOR
75
Multiple Anomalies
anomaly_count >= 3
ALERT_OPERATOR
70
Combined High
temp > 42°C AND pressure > 105
CLOSE_VALVE
60
Rapid Change
temp_delta > 10°C/min
ALERT_OPERATOR
50
Low Health Score
health_score < 30
CLOSE_VALVE
40
Moderate Risk
50 <= risk_score < 70
ALERT_OPERATOR
30
System Recovery
all_normal AND health > 80
OPEN_VALVE
API Reference
Resource Catalog (8081)
Method
Endpoint
Description
GET
/catalog
Full catalog snapshot
GET
/services
List registered services
GET
/services/health
All services health status
POST
/services
Register new service
GET
/devices/pipelines
List all pipelines
GET
/devices/bolts
List all bolts
GET
/devices/valves
List all valves
GET
/config/thresholds
Alert thresholds
GET
/config/rules
Control rules
Account Manager (8084)
Method
Endpoint
Description
POST
/login
Authenticate user
POST
/logout
Invalidate session
GET
/validate
Validate JWT token
POST
/register
Register new user (admin)
GET
/users
List all users (admin)
PUT
/users/{id}
Update user
DELETE
/users/{id}
Delete user (admin)
TimeSeries DB Connector (8082)
Method
Endpoint
Description
GET
/all_sensor_data
All sensor data
GET
/sensor_data
Specific sensor data
GET
/valve_states
Valve state history
GET
/devices
Registered devices
Query Parameters:
hours: Last N hours of data
start / end: ISO datetime range
device_id: Filter by device
sensor_type: Filter by type (temperature, pressure)
Control Center (8085)
Method
Endpoint
Description
GET
/status
Control center status
GET
/rules
List control rules
POST
/manual
Manual valve command
POST
/rules
Add new rule
DELETE
/rules/{id}
Remove rule
Analytics (8083)
Method
Endpoint
Description
GET
/health
Service health
GET
/forecast
Latest forecast data
POST
/run_analysis
Trigger analysis
MQTT Topics
Topic Hierarchy
sectors/
├── sector-north/pipelines/{N1,N2,N3}/
│ ├── measurements # Sensor data from Pi
│ ├── commands/valves # Valve commands to Pi
│ └── alerts/{type} # Alert notifications
└── sector-south/pipelines/{S1,S2,S3}/
└── ...
sensors/{pipeline_id} # Routed sensor data
temperature/{pipeline_id} # Temperature readings
pressure/{pipeline_id} # Pressure readings
valves/{pipeline_id} # Valve status
alerts/anomalies/{pipeline_id} # Anomaly alerts
commands/valves/{pipeline_id} # Control commands
Session Management: Database-backed with hourly cleanup
Authorization (RBAC)
Role
Permissions
Admin
Full access: view, control, configure, manage users/pipelines
Operator
View, manual control, emergency shutdown
Viewer
Read-only access to dashboards and data
Data Isolation
Sector-based filtering: Users only see assigned sector data
API queries automatically filtered by user's sector assignments
Security Recommendations
Change default admin password immediately
Enable HTTPS in production
Configure MQTT authentication
Restrict CORS origins
Implement API rate limiting
Use environment variables for all secrets
Makefile Commands
make setup # Create venv and install dependencies
make run-all # Start all services in tmux
make stop-all # Stop all services
make run-catalog # Start Resource Catalog
make run-broker # Start Message Broker
make run-timeseries # Start TimeSeries DB
make run-analytics # Start Analytics
make run-account # Start Account Manager
make run-control # Start Control Center
make run-raspberry-north # Start Pi North simulator
make run-raspberry-south # Start Pi South simulator
make run-telegram # Start Telegram Bot
make run-dashboard # Start Web Dashboard
make test# Run tests
make lint # Run linter
make clean # Clean temporary files
Push to branch (git push origin feature/amazing-feature)
Open a Pull Request
Development Guidelines
Follow PEP 8 style guide
Write unit tests for new features
Update documentation for API changes
Use meaningful commit messages
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
Eclipse Mosquitto for MQTT broker
InfluxData for time-series database
Supabase for PostgreSQL hosting
Plotly/Dash for visualization components
SmartBolt IoT Platform
Industrial Pipeline Monitoring System
About
SmartBolt_IOT_Platform is a modular IoT system designed for real-time monitoring and control of industrial pipelines using Smart IoT Bolts. The platform integrates sensor data acquisition, real-time analytics, actuator control, and web-based monitoring to enhance predictive maintenance and operational efficiency.