forked from ai4ce/insta360_ros_driver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·29 lines (25 loc) · 888 Bytes
/
setup.sh
File metadata and controls
executable file
·29 lines (25 loc) · 888 Bytes
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
#!/bin/bash
#For WSL, uncomment if unnecessary
# sudo usbip attach -r 127.0.0.1 -b 4-1
#Add permissions for USB port
# udevadm info --name /dev/bus/usb/003/026 --attribute-walk
echo SUBSYSTEM=='"usb"', ATTR{idVendor}=='"2e1a"', SYMLINK+='"insta"', MODE='"0777"' | sudo tee /etc/udev/rules.d/99-insta.rules
#Reload and trigger udev rules
sudo udevadm control --reload-rules
sudo udevadm trigger
#Grant permission for camera port
# Wait for the symlink to be created
for i in {1..5}; do
if [ -e /dev/insta ]; then
sudo chmod 777 /dev/insta
echo "Successfully set permissions for /dev/insta"
break
else
echo "Waiting for /dev/insta to be created... (attempt $i/5)"
sleep 1
fi
done
if [ ! -e /dev/insta ]; then
echo "Error: /dev/insta was not created. Please check if the camera is connected and in the correct mode."
exit 1
fi