This commit is contained in:
Your Name
2025-06-20 12:16:31 +02:00
parent ee5fa90474
commit 622da5900d
2 changed files with 22 additions and 35 deletions

View File

@@ -14,11 +14,11 @@ Version Pro du ModuleAir avec CM4, SaraR4 et ecran Matrix LED p2 64x64.
## Script ## Script
´´´ ```
wget http://gitea.aircarto.fr/PaulVua/moduleair_pro_4g/raw/branch/main/installation.sh wget http://gitea.aircarto.fr/PaulVua/moduleair_pro_4g/raw/branch/main/installation.sh
chmod +x installation.sh chmod +x installation.sh
./installation.sh ./installation.sh
´´´ ```
## Detailed ## Detailed
``` ```

View File

@@ -291,49 +291,36 @@ set_permissions() {
print_success "Device permissions set" print_success "Device permissions set"
} }
# Compile matrix library # Check matrix binaries
compile_matrix_library() { check_matrix_binaries() {
print_step "Compiling RGB LED matrix library..." print_step "Checking matrix display binaries..."
if [ -d "/var/www/moduleair_pro_4g/matrix/lib" ]; then
cd /var/www/moduleair_pro_4g/matrix/lib
if make; then
print_success "Matrix library compiled successfully"
else
print_error "Failed to compile matrix library"
exit 1
fi
else
print_warning "Matrix library directory not found - skipping compilation"
fi
}
# Compile matrix display programs
compile_matrix_programs() {
print_step "Compiling matrix display programs..."
local programs=( local programs=(
"screenNetwork/network_status" "screenNetwork/network_status"
"screenSensors/displayAll4_v2" "screenSensors/displayAll4_v2"
"screenSensors/displayCO2_PM_Network" "screenSensors/displayCO2_PM_Network"
"screenSensors/blank_screen" "screenSensors/blank_screen"
"welcomeScreen/welcome_screen"
) )
for program in "${programs[@]}"; do for program in "${programs[@]}"; do
local source_file="/var/www/moduleair_pro_4g/matrix/${program}.cc" local binary_file="/var/www/moduleair_pro_4g/matrix/${program}"
local output_file="/var/www/moduleair_pro_4g/matrix/${program}"
if [ -f "$source_file" ]; then if [ -f "$binary_file" ] && [ -x "$binary_file" ]; then
print_status "Compiling $program..." print_success "Matrix binary found: $program"
if g++ -I/var/www/moduleair_pro_4g/matrix/include -L/var/www/moduleair_pro_4g/matrix/lib "$source_file" -o "$output_file" -lrgbmatrix -lsqlite3; then
print_success "$program compiled"
else else
print_warning "Failed to compile $program" print_warning "Matrix binary missing or not executable: $program"
fi
else
print_warning "Source file not found: $source_file"
fi fi
done done
# Check matrix library
if [ -f "/var/www/moduleair_pro_4g/matrix/lib/librgbmatrix.a" ]; then
print_success "Matrix library found: librgbmatrix.a"
else
print_warning "Matrix library missing: librgbmatrix.a"
fi
print_success "Matrix binaries check completed"
} }
# Setup systemd services # Setup systemd services
@@ -419,11 +406,12 @@ final_status() {
print_header "INSTALLATION SUMMARY" print_header "INSTALLATION SUMMARY"
echo -e "${GREEN}${NC} System packages installed" echo -e "${GREEN}${NC} System packages installed"
echo -e "${GREEN}${NC} Python packages installed" echo -e "${GREEN}${NC} Python packages installed"
echo -e "${GREEN}${NC} Repository cloned"
echo -e "${GREEN}${NC} Directory structure created" echo -e "${GREEN}${NC} Directory structure created"
echo -e "${GREEN}${NC} Apache web server configured" echo -e "${GREEN}${NC} Apache web server configured"
echo -e "${GREEN}${NC} Hardware interfaces enabled" echo -e "${GREEN}${NC} Hardware interfaces enabled"
echo -e "${GREEN}${NC} Device permissions set" echo -e "${GREEN}${NC} Device permissions set"
echo -e "${GREEN}${NC} Matrix library compiled" echo -e "${GREEN}${NC} Matrix binaries verified"
echo -e "${GREEN}${NC} Systemd services configured" echo -e "${GREEN}${NC} Systemd services configured"
echo -e "${GREEN}${NC} Boot scripts created" echo -e "${GREEN}${NC} Boot scripts created"
@@ -456,8 +444,7 @@ main() {
configure_apache configure_apache
enable_hardware enable_hardware
set_permissions set_permissions
compile_matrix_library check_matrix_binaries
compile_matrix_programs
setup_services setup_services
create_boot_script create_boot_script
final_status final_status