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

@@ -291,49 +291,36 @@ set_permissions() {
print_success "Device permissions set"
}
# Compile matrix library
compile_matrix_library() {
print_step "Compiling RGB LED matrix library..."
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..."
# Check matrix binaries
check_matrix_binaries() {
print_step "Checking matrix display binaries..."
local programs=(
"screenNetwork/network_status"
"screenSensors/displayAll4_v2"
"screenSensors/displayCO2_PM_Network"
"screenSensors/blank_screen"
"welcomeScreen/welcome_screen"
)
for program in "${programs[@]}"; do
local source_file="/var/www/moduleair_pro_4g/matrix/${program}.cc"
local output_file="/var/www/moduleair_pro_4g/matrix/${program}"
local binary_file="/var/www/moduleair_pro_4g/matrix/${program}"
if [ -f "$source_file" ]; then
print_status "Compiling $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
print_warning "Failed to compile $program"
fi
if [ -f "$binary_file" ] && [ -x "$binary_file" ]; then
print_success "Matrix binary found: $program"
else
print_warning "Source file not found: $source_file"
print_warning "Matrix binary missing or not executable: $program"
fi
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
@@ -419,11 +406,12 @@ final_status() {
print_header "INSTALLATION SUMMARY"
echo -e "${GREEN}${NC} System 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} Apache web server configured"
echo -e "${GREEN}${NC} Hardware interfaces enabled"
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} Boot scripts created"
@@ -456,8 +444,7 @@ main() {
configure_apache
enable_hardware
set_permissions
compile_matrix_library
compile_matrix_programs
check_matrix_binaries
setup_services
create_boot_script
final_status