A Flask-based web application for managing IoT devices through PlatformIO.
IoT-Remote-Lab/
├── server/
│ └── src/
│ ├── app.py # Main Flask application
│ ├── config.py # Configuration management
│ ├── exceptions.py # Custom exceptions
│ ├── controllers/
│ │ ├── __init__.py
│ │ └── platformio_helper/
│ │ ├── __init__.py # Module exports
│ │ ├── __main__.py # CLI interface
│ │ ├── devices.py # Device management classes
│ │ └── pio_helper.py # PlatformIO interface
│ └── utils/
│ ├── __init__.py
│ └── logging_config.py # Logging configuration
├── requirements.txt # Python dependencies
└── README.md # This file
- Clone the repository
- Create a virtual environment:
python -m venv .venv .venv\Scripts\activate # On Windows
- Install dependencies:
pip install -r requirements.txt
cd server/src
python app.pyGET /api/devices- Get list of connected devicesGET /api/health- Health check endpoint
cd server/src/controllers
python -m platformio_helperEnvironment variables:
DEBUG: Enable debug mode (default: true)HOST: Server host (default: 127.0.0.1)PORT: Server port (default: 5000)LOG_LEVEL: Logging level (default: INFO)PLATFORMIO_TIMEOUT: PlatformIO command timeout (default: 30)
The application follows a modular architecture with:
- Separation of Concerns: Device management, configuration, and web interface are separate modules
- Error Handling: Custom exceptions with proper error responses
- Logging: Structured logging throughout the application
- Configuration Management: Environment-based configuration
- Type Hints: Full type annotations for better code quality
- Modular Design: Easy to add new device types and controllers
- Configuration Management: Environment-based configuration for different deployments
- Error Handling: Proper exception hierarchy for different error types
- Logging: Structured logging for monitoring and debugging
- API Design: RESTful API design for easy integration
- Extensibility: Easy to add new endpoints and functionality
- Database integration for device persistence
- Real-time device monitoring with WebSockets
- Device control and programming capabilities
- Authentication and authorization
- Docker containerization
- Unit and integration tests