feat: implement ofxpimapper-full-stack
- Unified setup script with OpenFrameworks and ofxPiMapper installation. - Integrated C++ source modification for 'Highlight Surface' OSC listener. - Full-featured 5-tab React/Tailwind web UI (Dashboard, Mapping, Media, Network, System). - WebSocket-based real-time vertex/surface manipulation and throttled log streaming. - Media Vault with ffprobe validation (H.264) and Mapping Manifest persistence. - Hybrid Networking UI with WiFi scanning, connection, and AP configuration. - System control endpoints for Reboot, Shutdown, and Mapping Save.
This commit is contained in:
@ -52,11 +52,11 @@ done
|
||||
# 2. SYSTEM STAGING PHASE
|
||||
echo "System Staging Phase..."
|
||||
|
||||
# 2.1 Pre-Flight Disk Space Check (2GB Required)
|
||||
# 2.1 Pre-Flight Disk Space Check (4GB Required)
|
||||
FREE_SPACE_KB=$(df / --output=avail | tail -n1)
|
||||
MIN_SPACE_KB=2097152 # 2GB
|
||||
MIN_SPACE_KB=4194304 # 4GB
|
||||
if [ "$FREE_SPACE_KB" -lt "$MIN_SPACE_KB" ]; then
|
||||
whiptail --msgbox "Error: Not enough disk space. At least 2GB of free space is required." 8 45
|
||||
whiptail --msgbox "Error: Not enough disk space. At least 4GB of free space is required for installation and swap scaling." 8 45
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -72,7 +72,7 @@ fi
|
||||
# 2.3 Install Dependencies
|
||||
(
|
||||
echo 20
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y git hostapd dnsmasq avahi-daemon curl > /dev/null 2>&1
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y git hostapd dnsmasq avahi-daemon curl ffmpeg > /dev/null 2>&1
|
||||
echo 60
|
||||
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - > /dev/null 2>&1
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs > /dev/null 2>&1
|
||||
@ -88,11 +88,30 @@ fi
|
||||
|
||||
# 2.5 Swap Increase
|
||||
if [ -f /etc/dphys-swapfile ]; then
|
||||
sed -i "s/CONF_SWAPSIZE=.*/CONF_SWAPSIZE=1024/g" /etc/dphys-swapfile
|
||||
sed -i "s/CONF_SWAPSIZE=.*/CONF_SWAPSIZE=2048/g" /etc/dphys-swapfile
|
||||
dphys-swapfile setup
|
||||
dphys-swapfile swapon
|
||||
fi
|
||||
|
||||
# 2.6 Graphics Driver Configuration (KMS/DRM)
|
||||
echo "Configuring graphics drivers for headless operation..."
|
||||
if [ -f /boot/config.txt ]; then
|
||||
# Increase GPU memory (needed for mapping)
|
||||
if grep -q "gpu_mem=" /boot/config.txt; then
|
||||
sed -i "s/gpu_mem=.*/gpu_mem=256/g" /boot/config.txt
|
||||
else
|
||||
echo "gpu_mem=256" >> /boot/config.txt
|
||||
fi
|
||||
# Enable KMS driver if not present
|
||||
if ! grep -q "dtoverlay=vc4-kms-v3d" /boot/config.txt; then
|
||||
echo "dtoverlay=vc4-kms-v3d" >> /boot/config.txt
|
||||
fi
|
||||
fi
|
||||
# Disable boot to desktop (force console auto-login)
|
||||
if command -v raspi-config > /dev/null; then
|
||||
raspi-config nonint do_boot_behaviour B2 > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
# 3. NETWORKING CONFIGURATION
|
||||
echo "Configuring Networking..."
|
||||
|
||||
@ -196,6 +215,46 @@ EOF
|
||||
chown pi:pi /home/pi/mpvj/backend/.env
|
||||
chmod 600 /home/pi/mpvj/backend/.env
|
||||
|
||||
# 4.5 Install ofxPiMapper Engine
|
||||
echo "Installing OpenFrameworks and ofxPiMapper (This will take ~1 hour)..."
|
||||
cd /home/pi
|
||||
if [ ! -d "openFrameworks" ]; then
|
||||
sudo -u pi git clone --depth 1 --branch master https://github.com/openframeworks/openFrameworks.git
|
||||
cd openFrameworks/scripts/linux/debian
|
||||
./install_dependencies.sh -y > /dev/null 2>&1
|
||||
cd ../../../
|
||||
# Compile OF (this takes a while)
|
||||
cd scripts/linux/debian
|
||||
./install_codecs.sh > /dev/null 2>&1
|
||||
cd ../../../
|
||||
make -j1 -C libs/openFrameworksCompiled/project/linux64 > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
cd /home/pi/openFrameworks/addons
|
||||
if [ ! -d "ofxPiMapper" ]; then
|
||||
sudo -u pi git clone https://github.com/kr15h/ofxPiMapper.git
|
||||
sudo -u pi git clone https://github.com/vanderlin/ofxOfelia.git # dependency often needed
|
||||
fi
|
||||
|
||||
# Build Example
|
||||
cd /home/pi/openFrameworks/addons/ofxPiMapper
|
||||
if [ -f src/Osc/OscControl.cpp ]; then
|
||||
echo "Applying highlight surface OSC listener modification..."
|
||||
# Add highlight listener that selects the surface for 1 second (mock highlight)
|
||||
sed -i '/if (m.getAddress() == "\/ofxPiMapper\/surface\/select"){/i \
|
||||
if (m.getAddress() == "/ofxPiMapper/surface/highlight"){ \
|
||||
int surfaceIndex = m.getArgAsInt32(0); \
|
||||
mapper->getSurfaceManager()->selectSurface(surfaceIndex); \
|
||||
return; \
|
||||
}' src/Osc/OscControl.cpp
|
||||
fi
|
||||
|
||||
# Build Example
|
||||
cd /home/pi/openFrameworks/addons/ofxPiMapper/example-basic
|
||||
sudo -u pi make -j1 > /dev/null 2>&1
|
||||
cp bin/example-basic /usr/local/bin/ofxPiMapper
|
||||
chmod +x /usr/local/bin/ofxPiMapper
|
||||
|
||||
# 5. FINALIZATION
|
||||
echo "Finalizing..."
|
||||
|
||||
|
||||
Reference in New Issue
Block a user