-
Notifications
You must be signed in to change notification settings - Fork 8
/
install_playerone.sh
executable file
·182 lines (163 loc) · 5.5 KB
/
install_playerone.sh
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
#!/bin/bash
####################################################################
# Script to download and install PlayerOne drivers
# for camera and filterwheel
####################################################################
#** May 26, 2024 <MLS> Major amount of work getting install to work on a fresh system
####################################################################
clear
echo "Installing support for PlayerOne cameras and filterwheels"
PLAYERONE_DRIVER_URL="https://player-one-astronomy.com/download/softwares/"
#https://player-one-astronomy.com/download/softwares/PlayerOne_Camera_SDK_Linux_V3.6.2.tar.gz
PLAYERONE_LATESTVER_CAM="PlayerOne_Camera_SDK_Linux_V3.6.2"
PLAYERONE_LATESTVER_CAM_TAR="PlayerOne_Camera_SDK_Linux_V3.6.2.tar.gz"
#https://player-one-astronomy.com/download/softwares/PlayerOne_FilterWheel_SDK_Linux_V1.2.0.tar.gz
PLAYERONE_LATESTVER_FW="PlayerOne_FilterWheel_SDK_Linux_V1.2.0"
PLAYERONE_LATESTVER_FW_TAR="PlayerOne_FilterWheel_SDK_Linux_V1.2.0.tar.gz"
PLAYERONE_DIR="PlayerOne"
LIB_DIR="/usr/lib"
MACHINE_TYPE=`uname -m`
echo $MACHINE_TYPE
PLATFORM="unknown"
if [ $MACHINE_TYPE == "x86_64" ]
then
PLATFORM="x64"
elif [ $MACHINE_TYPE == "x86" ]
then
PLATFORM="x86"
elif [ $MACHINE_TYPE == "armv7l" ]
then
PLATFORM="arm32"
elif [ $MACHINE_TYPE == "aarch64" ]
then
PLATFORM="arm64"
fi
if [ -d $PLAYERONE_DIR ]
then
echo "$PLAYERONE_DIR already present"
else
mkdir $PLAYERONE_DIR
fi
if [ -d $PLAYERONE_DIR ]
then
###############################################################################################
echo "Deleting old versions"
rm -v $LIB_DIR/libPlayerOneCamera*
rm -v /usr/local/lib/libPlayerOneCamera*
rm -v /usr/lib/libPlayerOneCamera*
rm -v /usr/local/bin/libPlayerOneCamera*
rm -v /usr/bin/libPlayerOneCamera*
echo "Installing support for PlayerOne Camera"
echo "Checking for latest version"
cd $PLAYERONE_DIR
CAMERA_LIB_PATH="$PLAYERONE_DIR/PlayerOne_Camera_SDK_Linux_V3.3.0/lib/$PLATFORM"
if [ -d $PLAYERONE_LATESTVER_CAM ]
then
echo "Latest version found: $PLAYERONE_LATESTVER_CAM"
else
if [ -f $PLAYERONE_LATESTVER_CAM_TAR ]
then
echo "Tar already present: $PLAYERONE_LATESTVER_CAM_TAR"
else
echo "Downloading $PLAYERONE_LATESTVER_CAM_TAR"
wget $PLAYERONE_DRIVER_URL$PLAYERONE_LATESTVER_CAM_TAR
fi
############################################
# we have the file downloaded, uncompress
if [ -f $PLAYERONE_LATESTVER_CAM_TAR ]
then
tar -xvf $PLAYERONE_LATESTVER_CAM_TAR
else
echo "Failed to download $PLAYERONE_LATESTVER_CAM_TAR"
exit
fi
fi
if [ -d $PLAYERONE_LATESTVER_CAM ]
then
echo "Version $PLAYERONE_LATESTVER_CAM is present"
CAMERA_LIB_PATH="$PLAYERONE_DIR/$PLAYERONE_LATESTVER_CAM/lib/$PLATFORM"
else
echo "Something failed along the way"
fi
echo "Creating include_camera link"
rm include_camera
ln -s $PLAYERONE_LATESTVER_CAM/include/ include_camera
cd ..
#~/dev-mark/alpaca/PlayerOne/PlayerOne_Camera_SDK_Linux_V3.3.0/lib
echo "Source path is $CAMERA_LIB_PATH"
if [ -d $CAMERA_LIB_PATH ]
then
echo "Copying files to $LIB_DIR"
sudo cp -p -v $CAMERA_LIB_PATH/* $LIB_DIR
fi
###############################################################################################
# check the rules file
PLAYER_RULES_FILE="99-player_one_astronomy.rules"
RULES_DIR="/lib/udev/rules.d"
if [ -f $RULES_DIR/$PLAYER_RULES_FILE ]
then
echo "PlayerOne rules file already installed"
ls -l $RULES_DIR | grep -i player
else
echo "Looking for rules file"
RULES_PATH="$PLAYERONE_DIR/$PLAYERONE_LATESTVER_CAM/udev/$PLAYER_RULES_FILE"
if [ -f $RULES_PATH ]
then
echo "Installing rules file"
sudo cp -v -p $PLAYERONE_DIR/$PLAYERONE_LATESTVER_CAM/udev/$PLAYER_RULES_FILE /lib/udev/rules.d/
else
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "Can''t find rules file: $PLAYER_RULES_FILE"
echo "$RULES_PATH"
exit
fi
fi
###############################################################################################
###############################################################################################
###############################################################################################
###############################################################################################
###############################################################################################
cd $PLAYERONE_DIR
if [ -d $PLAYERONE_LATESTVER_FW ]
then
echo "Latest version found: $PLAYERONE_LATESTVER_FW"
else
if [ -f $PLAYERONE_LATESTVER_FW_TAR ]
then
echo "Tar already present: $PLAYERONE_LATESTVER_FW_TAR"
else
echo "Downloading $PLAYERONE_LATESTVER_FW_TAR"
wget $PLAYERONE_DRIVER_URL$PLAYERONE_LATESTVER_FW_TAR
fi
############################################
# we have the file downloaded, uncompress
if [ -f $PLAYERONE_LATESTVER_FW_TAR ]
then
tar -xvf $PLAYERONE_LATESTVER_FW_TAR
else
echo "Failed to download $PLAYERONE_LATESTVER_FW_TAR"
exit
fi
fi
if [ -d $PLAYERONE_LATESTVER_FW ]
then
echo "Version $PLAYERONE_LATESTVER_FW is present"
FILTERWHEEL_LIB_PATH="$PLAYERONE_DIR/$PLAYERONE_LATESTVER_FW/lib/$PLATFORM"
else
echo "Something failed along the way"
fi
echo "Creating include_filterwheel link"
rm include_filterwheel
ln -s $PLAYERONE_LATESTVER_FW/include/ include_filterwheel
cd ..
######################
echo "Source path is $FILTERWHEEL_LIB_PATH"
if [ -d $FILTERWHEEL_LIB_PATH ]
then
echo "Copying files to $LIB_DIR"
sudo cp -p -v $FILTERWHEEL_LIB_PATH/* $LIB_DIR
fi
ls -l $PLAYERONE_DIR
else
echo "$PLAYERONE_DIR directory was not found"
fi