forked from befinitiv/wifibroadcast_fpv_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
osd.sh
executable file
·39 lines (28 loc) · 953 Bytes
/
osd.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
#!/bin/bash
#if we detect the camera, we fall asleep
if vcgencmd get_camera | grep -q detected=1; then
echo "osd.sh: Falling asleep because a camera has been detected"
sleep 365d
fi
#adapt these to your needs
NIC="wlan0"
PORT=1
SAVE_PATH="/media/usb0/telemetry"
BLOCK_SIZE=8
FECS=4
PACKET_LENGTH=1024
WBC_PATH="/home/pi/wifibroadcast"
FRSKY_OMX_OSD_PATH="/home/pi/frsky_omx_osd"
sleep 10
# Make sure only root can run our script
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
if [ -d "$SAVE_PATH" ]; then
echo "Starting osd with recording"
$WBC_PATH/rx -b $BLOCK_SIZE -r $FECS -f $PACKET_LENGTH -p $PORT $NIC | tee $SAVE_PATH/`ls $SAVE_PATH | wc -l`.frsky | $FRSKY_OMX_OSD_PATH/frsky_omx_osd /opt/vc/src/hello_pi/hello_font/
else
echo "Starting osd without recording"
$WBC_PATH/rx -b $BLOCK_SIZE -r $FECS -f $PACKET_LENGTH -p $PORT $NIC | $FRSKY_OMX_OSD_PATH/frsky_omx_osd $FRSKY_OMX_OSD_PATH
fi