-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·82 lines (68 loc) · 2.32 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·82 lines (68 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
# Installation script for thermal camera Python bindings
set -e # Exit on error
echo "========================================="
echo "Thermal Camera Python Bindings Installer"
echo "========================================="
# Check if running as root (not recommended for pip install)
if [ "$EUID" -eq 0 ]; then
echo "Warning: Running as root. Consider running as regular user."
echo "Press Ctrl+C to cancel, or wait 5 seconds to continue..."
sleep 5
fi
# Install system dependencies
echo ""
echo "Installing system dependencies..."
echo "This may require sudo password."
# Update package list
sudo apt update
# Install build essentials
echo "Installing build tools..."
sudo apt install -y build-essential pkg-config cmake
# Install OpenCV
echo "Installing OpenCV..."
sudo apt install -y libopencv-dev
# Install Python development headers
echo "Installing Python development headers..."
sudo apt install -y python3-dev python3-pip
# Install Python dependencies
echo ""
echo "Installing Python dependencies..."
pip3 install --user --upgrade pip
pip3 install --user pybind11 numpy opencv-python matplotlib
# Create udev rule for USB permissions
echo ""
echo "Setting up USB permissions..."
UDEV_RULE="/etc/udev/rules.d/99-thermal-camera.rules"
echo "Creating udev rule: $UDEV_RULE"
sudo tee $UDEV_RULE > /dev/null <<EOF
# Thermal Camera USB permissions
# P2/Tiny1C thermal camera (Realtek)
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="5840", MODE="0666", GROUP="video"
EOF
# Reload udev rules
sudo udevadm control --reload-rules
sudo udevadm trigger
# Add user to video group
echo ""
echo "Adding user to video group..."
sudo usermod -a -G video $USER
echo ""
echo "========================================="
echo "Installation completed!"
echo "========================================="
echo ""
echo "IMPORTANT:"
echo "1. Log out and log back in for group changes to take effect"
echo " Or run: newgrp video"
echo ""
echo "2. Build the Python bindings:"
echo " ./build.sh"
echo ""
echo "3. Test the installation:"
echo " python3 test_simple.py"
echo ""
echo "If you still get permission errors, you may need to:"
echo " sudo chmod 666 /dev/bus/usb/*/[device]"
echo "Or unplug and replug the camera after logging back in."
echo ""