-
Notifications
You must be signed in to change notification settings - Fork 0
/
rpi_config.cfg
executable file
·109 lines (93 loc) · 3.21 KB
/
rpi_config.cfg
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
#Config file for installing and running RPi
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
echo "configfile is in: $SCRIPT_DIR"
#Pi PW
PI_USER="pi"
PI_PW="pipi1234"
#WLAN
IPADDRESS="192.168.111.3"
NETMASK="255.255.255.0"
WLAN_USER="fast-wlan-0001"
WLAN_PWD="tiz_R9h("
WLAN_SSID="wkit-802.1x"
##################NEVER CHANGE COMMENTS START###############
####################GIT_DATA--start--#######################
#Git
OAUTH_TOKEN="hrjVkGTfk4cqBgyDuj"
OAUTH_SECRET="YNZqKfSUrEA8XRMNuYqpka543WUPSfAa"
OAUTH_ID="sven_RPI"
GIT_REPO_OWNER="joma15"
GIT_SERVER="bitbucket.org"
GIT_REPO="raspberrypi"
GIT_MAIN_BRANCH="jessie"
#for installing only
#could only use variables between "GIT_DATA" Comment
GIT_DIR="/home/pi/git"
# Helper Functions
get_access_token() {
JSON_STRING=$(( curl https://${GIT_SERVER}/site/oauth2/access_token \
-d grant_type=client_credentials \
-u ${OAUTH_TOKEN}:${OAUTH_SECRET} ) 2>/dev/null)
#echo ${JSON_STRING}
OAUTH_ACCESS_KEY="$(python - <<EOC
import json
input = '${JSON_STRING}'
output = json.loads(input)
print(output["access_token"])
EOC
)"
echo ${OAUTH_ACCESS_KEY}
}
GET_GIT_HTTPS_STRING() {
echo "https://x-token-auth:{$(get_access_token)}@${GIT_SERVER}/${GIT_REPO_OWNER}/${GIT_REPO}.git"
}
#####################GIT_DATA--end--########################
####################NEVER CHANGE COMMENTS END###############
#Samba
SAMBA_MOUNT_DIR="/media/remotedata"
SAMBA_REMOTE="//fast-lff-vm05.fast.kit.edu/jh_ma_data/"
SAMBA_USER="fast-fast-jma-0001" # TODO escaping
SAMBA_PWD="=eELx(5r"
SAMBA_DOMAIN="kit"
#Dirs
USER_DIR="/home/${PI_USER}"
#GIT_DIR="${USER_DIR}/git"
SUSV_DIR="/opt/susvd"
REPO_DIR=${SCRIPT_DIR}
LOGGINGDIRECTORY="${USER_DIR}/logging_data"
# Programs
PROGRAM_DIR="${REPO_DIR}/Programs"
INSTALL_DIR="${REPO_DIR}/install"
WIFIBASHSCRIPT="${PROGRAM_DIR}/wificronjob.sh"
SHUTDOWN_SCRIPT="${PROGRAM_DIR}/wificronjob.sh"
LOGGING_STARTER_SCRIPT="${PROGRAM_DIR}/starter_SensorRecorder.sh"
SET_COLOR_SCRIPT="${PROGRAM_DIR}/set_sensehatcolor.py"
LOGGER_SCRIPT="${PROGRAM_DIR}/SensorRecorder.py"
SAVEAUDIO_SCRIPT="${PROGRAM_DIR}/bt_audo_recorder.py"
INSTALL_SCRIPT="${INSTALL_DIR}/raspberry_InCarSensors_and_bt_installer.sh"
INSTALL_BT_SCRIPT="${INSTALL_DIR}/bt_pair_BC127.exp"
BT_SPP_SCRIPT="${PROGRAM_DIR}/bc127_status.exp"
GPS_CONFIG_SCRIPT="${PROGRAM_DIR}/gpsconfig.py"
NTP_HWCLK_SCRIPT="${PROGRAM_DIR}/ntp_to_hwclk.sh"
UPDATE_GIT_SCRIPT="bash ${REPO_DIR}/update/update.sh" # will be executed , when git is updated
UDEV_BLUETOOTH_STARTER="${REPO_DIR}/systemfiles/bluetooth_recorder_starter.sh"
#LOG Files
LOGFILE_WIFICRONJOB="/var/log/wificronjob.log"
LOGFILE_start_recorder="/var/log/startrecorder.log"
LOGFILE_BLUETOOTH_UDEV="/var/log/bluetooth_dev"
#USV
MIN_PERCENTAGES_BATTERY=25 # min 10, max 99
#Hardware Clock
maxDiffSec="2"
#Bluetooth Audio
SERIAL_AUDIO_CONSOLE='/dev/ttyUSB0'
BT_SYSTEMD_SERVICE="save-bt-audio.service"
SENSORRECORDER_SYSTEMD_SERVICE="sensorrecorder.service"
# config files
LSM9DS1_CONFIG_FILE="${REPO_DIR}/../LSM9DS1.ini"
USER_CONFIG_FILE="${REPO_DIR}/../configfile.cfg"
# source config file
# settings in there will overwrite git settings
if [ -e ${USER_CONFIG_FILE} ]; then
source ${USER_CONFIG_FILE} # for Hostname
fi