install stuff
This commit is contained in:
39
install.sh
39
install.sh
@@ -117,13 +117,20 @@ install_packages() {
|
||||
install_python_dependencies() {
|
||||
print_status "Installing Python dependencies..."
|
||||
|
||||
# Install pip packages
|
||||
pip3 install --upgrade pip
|
||||
pip3 install \
|
||||
# Create virtual environment
|
||||
python3 -m venv "$INSTALL_DIR/venv"
|
||||
|
||||
# Activate virtual environment and install packages
|
||||
source "$INSTALL_DIR/venv/bin/activate"
|
||||
|
||||
# Upgrade pip in virtual environment
|
||||
pip install --upgrade pip
|
||||
|
||||
# Install packages in virtual environment
|
||||
pip install \
|
||||
python-vlc \
|
||||
python-dotenv \
|
||||
psutil \
|
||||
pathlib \
|
||||
PyYAML \
|
||||
RPi.GPIO \
|
||||
pigpio \
|
||||
@@ -133,7 +140,10 @@ install_python_dependencies() {
|
||||
numpy \
|
||||
opencv-python-headless
|
||||
|
||||
print_success "Python dependencies installed"
|
||||
# Deactivate virtual environment
|
||||
deactivate
|
||||
|
||||
print_success "Python dependencies installed in virtual environment"
|
||||
}
|
||||
|
||||
# Function to create directories
|
||||
@@ -166,6 +176,7 @@ copy_files() {
|
||||
cp video_player.py "$INSTALL_DIR/"
|
||||
cp ir_remote.py "$INSTALL_DIR/"
|
||||
cp config_manager.py "$INSTALL_DIR/"
|
||||
cp test_venv_setup.py "$INSTALL_DIR/"
|
||||
|
||||
# Copy USB auto-mount script
|
||||
cp usb_automount.sh "$INSTALL_DIR/"
|
||||
@@ -472,6 +483,12 @@ EOF
|
||||
cat > /usr/local/bin/video-player-usb << 'EOF'
|
||||
#!/bin/bash
|
||||
/opt/video_player/usb_automount.sh "$@"
|
||||
EOF
|
||||
|
||||
# Create test script
|
||||
cat > /usr/local/bin/video-player-test << 'EOF'
|
||||
#!/bin/bash
|
||||
/opt/video_player/venv/bin/python /opt/video_player/test_venv_setup.py
|
||||
EOF
|
||||
|
||||
# Set permissions
|
||||
@@ -498,15 +515,17 @@ display_summary() {
|
||||
echo "Restart: video-player-restart"
|
||||
echo "Status: video-player-status"
|
||||
echo "Logs: video-player-logs"
|
||||
echo "Test: video-player-test"
|
||||
echo "USB: video-player-usb {scan|mount-all}"
|
||||
echo
|
||||
echo "Next Steps:"
|
||||
echo "==========="
|
||||
echo "1. Add video files to: $VIDEO_FOLDER"
|
||||
echo "2. Insert USB drives - they will auto-mount to: /media/usb/"
|
||||
echo "3. Configure IR remote codes in: $CONFIG_DIR/ir_mapping.json"
|
||||
echo "4. Start the service: video-player-start"
|
||||
echo "5. Check status: video-player-status"
|
||||
echo "1. Test the installation: video-player-test"
|
||||
echo "2. Add video files to: $VIDEO_FOLDER"
|
||||
echo "3. Insert USB drives - they will auto-mount to: /media/usb/"
|
||||
echo "4. Configure IR remote codes in: $CONFIG_DIR/ir_mapping.json"
|
||||
echo "5. Start the service: video-player-start"
|
||||
echo "6. Check status: video-player-status"
|
||||
echo
|
||||
echo "For more information, see the documentation in $INSTALL_DIR"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user