*Last updated: 2024-07-20
This script automates the setup process for a Raspberry Pi 5 based IoT Control System. It includes the configuration of network, VPN, webserver, database, MQTT, backend, frontend, and ESP32 communication.
[Rest of the README content remains the same]
- Freshly installed Raspberry Pi OS (Bookworm or newer)
- Internet connection
- Sudo privileges for the executing user
- Clone the repository:
git clone https://github.com/yourusername/Raspi_Setup_Scripts.git
- Navigate to the project directory:
cd Raspi_Setup_Scripts
- Make the main script executable:
chmod +x setup_iot_system.sh
- Run the script:
sudo ./setup_iot_system.sh
- GitHub integration (cloning or creating a project)
- Network configuration (Ethernet, WiFi, Access Point)
- VPN setup for secure remote access
- Webserver setup (Nginx)
- Database setup (SQLite)
- MQTT broker configuration
- Backend setup (Flask, Gunicorn)
- Frontend setup (React)
- ESP32 communication setup
- Monitoring setup (Prometheus, Grafana)
- Automated backups
- System check and restart functions
- Code export function
setup_iot_system.sh
: Main scriptmodules/
: Directory for modular script componentsutils/
: Directory for utility scriptscredentials.env
: Environment variables and configuration settingsdocs/
: Documentation and generated reports
- v4.8.0: Current main version
- v4.8.1: Improved error handling and dependency management
- v4.8.2: Enhanced logging and troubleshooting capabilities
- Patric Aeberhard
This project is licensed under the MIT License. See the LICENSE
file for details.
graph TD
A[Raspberry Pi 5: IoT Control System v4.8.0] --> B[Network Setup v1.2.8]
A --> C[Security v1.0.0]
A --> D[Data Management v1.2.4]
A --> E[Application Layer v1.2.3]
A --> F[IoT Communication v1.2.2]
A --> G[Monitoring & Maintenance v1.2.2]
A --> H[System Management v1.1.0]
B --> B1[WiFi Client]
B --> B2[Access Point wlan1]
B --> B3[IP Forwarding]
C --> C1[OpenVPN v2.5.x]
C --> C2[SSL/TLS Let's Encrypt]
C --> C3[Firewall]
D --> D1[SQLite v3.40.1]
D --> D2[Backup System]
E --> E1[Backend]
E --> E2[Frontend]
E1 --> E1a[Flask v2.x.x]
E1 --> E1b[Gunicorn v20.x.x]
E2 --> E2a[React v17.x.x]
F --> F1[MQTT Broker Mosquitto v2.x.x]
F --> F2[MQTT Bridge]
F --> F3[ESP32 Integration]
G --> G1[Prometheus v2.30.x]
G --> G2[Grafana v8.x.x]
G --> G3[Node Exporter v1.2.x]
H --> H1[System Check]
H --> H2[System Restart]
H --> H3[Code Export]
classDef default fill:#f9f,stroke:#333,stroke-width:2px;
classDef module fill:#bbf,stroke:#333,stroke-width:2px;
classDef component fill:#dfd,stroke:#333,stroke-width:2px;
class A default;
class B,C,D,E,F,G,H module;
class B1,B2,B3,C1,C2,C3,D1,D2,E1,E2,F1,F2,F3,G1,G2,G3,H1,H2,H3 component;
-
Dependency Management: The system is experiencing difficulties in correctly identifying and managing module dependencies. This leads to issues where modules may not execute in the correct order or fail to recognize completed dependencies.
-
Module Execution Errors: Some modules, particularly the GitHub setup, are encountering execution errors. This may be due to issues with environment variable loading or script sourcing.
-
Error Handling: The current error handling system needs improvement to provide more detailed and user-friendly error messages, especially for dependency-related issues.
-
Logging Consistency: There are inconsistencies in logging across different modules, making it challenging to debug issues effectively.
-
Refactor Dependency System: Implement a more robust dependency tracking system that can handle complex inter-module dependencies and provide clearer feedback to users.
-
Enhanced Error Reporting: Develop a more comprehensive error reporting system that provides detailed, actionable information to users when issues occur.
-
Modularization Review: Conduct a thorough review of the modular structure to ensure that each module is sufficiently independent and well-encapsulated.
-
Automated Testing: Implement a suite of automated tests to verify the functionality of individual modules and their interactions.
-
User Interface Improvements: Enhance the command-line interface to provide a more intuitive and informative user experience throughout the setup process.
-
Documentation Expansion: Expand the documentation to include troubleshooting guides, detailed module descriptions, and configuration examples.
-
Performance Optimization: Analyze and optimize the performance of resource-intensive modules, particularly for systems with limited hardware capabilities.
-
Security Enhancements: Conduct a security audit and implement additional measures to protect sensitive information and secure system components.
- Complete integration and testing of all modules
- Improve user-friendliness and error handling
- Expand documentation and add configuration examples
- Implement additional security features
- Optimize performance and resource utilization
- Address open issues, particularly focusing on dependency management and module execution reliability
We appreciate your patience as we work to resolve these issues and improve the overall stability and functionality of the IoT Control System setup script.