mirror of https://github.com/OpenIPC/wiki.git
Add files via upload
parent
8c2e15b638
commit
5aecf12d9d
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,84 @@
|
|||
#!/bin/sh
|
||||
|
||||
DAEMON="majestic"
|
||||
PIDFILE="/var/run/$DAEMON.pid"
|
||||
|
||||
DAEMON_ARGS="-s"
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
|
||||
|
||||
load_majestic() {
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
[ -f /etc/coredump.conf ] && . /etc/coredump.conf
|
||||
if [ "$coredump_enabled" ]; then
|
||||
[ "$(cli -g .watchdog.timeout)" -lt "30" ] && cli -s .watchdog.timeout 30
|
||||
ulimit -c unlimited && echo "|/usr/sbin/sendcoredump.sh" >/proc/sys/kernel/core_pattern
|
||||
fi
|
||||
|
||||
cli -s .isp.sensorConfig /etc/sensors/imx307_i2c_2l_1080p.ini
|
||||
cli -s .video0.size 1920x1080
|
||||
cli -s .video0.fps 30
|
||||
|
||||
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" -- $DAEMON_ARGS
|
||||
|
||||
sleep .5
|
||||
|
||||
cli -s .isp.sensorConfig /etc/sensors/imx307_i2c_2l_720p_50fps.ini
|
||||
cli -s .video0.size 1280x720
|
||||
cli -s .video0.fps 50
|
||||
|
||||
killall -1 majestic
|
||||
|
||||
sleep 1
|
||||
gkrcparams --MaxQp 30 --MaxI 2
|
||||
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
# The daemon does not create a pidfile, and use "-m" to instruct start-stop-daemon to create one.
|
||||
start() {
|
||||
logger -s -p daemon.info -t $(ipcinfo -v) "Loading video system has started..."
|
||||
export SENSOR=$(fw_printenv -n sensor)
|
||||
load_majestic
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf 'Stopping %s: ' "$DAEMON"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
start-stop-daemon -K -q -p "$PIDFILE"
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
rm -f "$PIDFILE"
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
sleep 1
|
||||
reload
|
||||
}
|
||||
|
||||
reload() {
|
||||
load_majestic
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart|reload)
|
||||
"$1";;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload}"
|
||||
exit 1
|
||||
esac
|
|
@ -0,0 +1,77 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Start fpv datalink
|
||||
#
|
||||
|
||||
. /etc/datalink.conf
|
||||
|
||||
chip=$(ipcinfo -c)
|
||||
fw=$(grep "BUILD_OPTION" "/etc/os-release" | cut -d= -f2)
|
||||
|
||||
start() {
|
||||
if ! [ -f /etc/system.ok ]; then
|
||||
killall majestic
|
||||
tweaksys ${chip}
|
||||
fi
|
||||
|
||||
echo "Starting FPV datalink..."
|
||||
if ! [ -f /etc/servicemode ]; then
|
||||
echo "Start wlan0 in Service Mode (connect to your AP)"
|
||||
rm -f /etc/servicemode
|
||||
wpa_passphrase "ssid" "password" >/tmp/wpa_supplicant.conf
|
||||
sed -i '2i \\tscan_ssid=1' /tmp/wpa_supplicant.conf
|
||||
sleep 3
|
||||
wpa_supplicant -B -D nl80211 -i wlan0 -c /tmp/wpa_supplicant.conf
|
||||
ifconfig wlan0 up
|
||||
udhcpc -x hostname:openipc-servicemode -T 1 -t 5 -R -b -O search -i wlan0
|
||||
else
|
||||
if [ ${fw} = "lte" ]; then
|
||||
if [ ${usb_modem} = "true" ]; then
|
||||
echo "Starting lte modem configuration..."
|
||||
echo "ToDo: Running usb_modeswitch or other shit here..."
|
||||
fi
|
||||
# for the future
|
||||
#cli -s .outgoing.url1 udp://${gs_ipaddr}:${gs_port}
|
||||
if [ ${use_zt} = "true" ]; then
|
||||
echo "Starting ZeroTier-One daemon..."
|
||||
/usr/sbin/zerotier-one -d &
|
||||
if [ ! -f /var/lib/zerotier-one/networks.d/${zt_netid}.conf ]; then
|
||||
sleep 8
|
||||
zerotier-cli join ${zt_netid} &> /dev/null
|
||||
echo "Don't forget authorize in the my.zerotier.com!"
|
||||
fi
|
||||
fi
|
||||
if [ ${telemetry} = "true" ]; then
|
||||
/usr/bin/telemetry start
|
||||
fi
|
||||
else
|
||||
echo "Starting wifibroadcast service..."
|
||||
/usr/bin/wifibroadcast start
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo "Stopping all services..."
|
||||
kill -9 $(pidof wfb_tx)
|
||||
kill -9 $(pidof telemetry_rx)
|
||||
kill -9 $(pidof telemetry_tx)
|
||||
kill -9 $(pidof mavlink-routerd)
|
||||
kill -9 $(pidof mavfwd)
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart)
|
||||
stop
|
||||
start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
|
@ -0,0 +1,65 @@
|
|||
system:
|
||||
webAdmin: disabled
|
||||
buffer: 1024
|
||||
image:
|
||||
mirror: false
|
||||
flip: false
|
||||
rotate: none
|
||||
contrast: 50
|
||||
hue: 50
|
||||
saturation: 50
|
||||
luminance: 50
|
||||
osd:
|
||||
enabled: false
|
||||
template: "%a %e %B %Y %H:%M:%S %Z"
|
||||
nightMode:
|
||||
enabled: false
|
||||
records:
|
||||
enabled: false
|
||||
path: /mnt/mmc/%Y/%m/%d/%H.mp4
|
||||
maxUsage: 95
|
||||
video0:
|
||||
enabled: true
|
||||
bitrate: 6144
|
||||
codec: h265
|
||||
rcMode: cbr
|
||||
gopSize: 1.0
|
||||
size: 1280x720
|
||||
fps: 50
|
||||
video1:
|
||||
enabled: false
|
||||
jpeg:
|
||||
enabled: false
|
||||
mjpeg:
|
||||
size: 640x360
|
||||
fps: 5
|
||||
bitrate: 1024
|
||||
audio:
|
||||
enabled: false
|
||||
volume: auto
|
||||
srate: 8000
|
||||
rtsp:
|
||||
enabled: false
|
||||
port: 554
|
||||
hls:
|
||||
enabled: false
|
||||
youtube:
|
||||
enabled: false
|
||||
motionDetect:
|
||||
enabled: false
|
||||
visualize: true
|
||||
debug: true
|
||||
ipeye:
|
||||
enabled: false
|
||||
watchdog:
|
||||
enabled: true
|
||||
timeout: 10
|
||||
isp:
|
||||
slowShutter: disabled
|
||||
drc: 350
|
||||
lowDelay: true
|
||||
sensorConfig: /etc/sensors/imx307_i2c_2l_720p_50fps.ini
|
||||
netip:
|
||||
enabled: false
|
||||
outgoing:
|
||||
- udp://127.0.0.1:5600
|
|
@ -0,0 +1,131 @@
|
|||
[sensor]
|
||||
Sensor_type =stSnsImx307_2l_Obj ;sensor name
|
||||
Mode =0 ;WDR_MODE_NONE = 0
|
||||
;WDR_MODE_BUILT_IN = 1
|
||||
;WDR_MODE_QUDRA = 2
|
||||
;WDR_MODE_2To1_LINE = 3
|
||||
;WDR_MODE_2To1_FRAME = 4
|
||||
;WDR_MODE_2To1_FRAME_FULL_RATE = 5
|
||||
;WDR_MODE_3To1_LINE = 6
|
||||
;WDR_MODE_3To1_FRAME = 7
|
||||
;WDR_MODE_3To1_FRAME_FULL_RATE = 8
|
||||
;WDR_MODE_4To1_LINE = 9
|
||||
;WDR_MODE_4To1_FRAME = 10
|
||||
;WDR_MODE_4To1_FRAME_FULL_RATE = 11
|
||||
DllFile = /usr/lib/sensors/libsns_imx307_2l_720p_50fps.so ;sensor lib path
|
||||
|
||||
|
||||
[mode]
|
||||
input_mode =0 ;INPUT_MODE_MIPI = 0
|
||||
;INPUT_MODE_SUBLVDS = 1
|
||||
;INPUT_MODE_LVDS = 2 ...etc
|
||||
|
||||
raw_bitness = 10
|
||||
|
||||
[mipi]
|
||||
;----------only for mipi_dev---------
|
||||
data_type = DATA_TYPE_RAW_10BIT
|
||||
lane_id = 0|2|-1|-1|-1|-1|-1|-1| ;lane_id: -1 - disable
|
||||
|
||||
[isp_image]
|
||||
Isp_x =0
|
||||
Isp_y =0
|
||||
Isp_W =1280
|
||||
Isp_H =720
|
||||
Isp_FrameRate=60
|
||||
Isp_Bayer =0 ;BAYER_RGGB=0, BAYER_GRBG=1, BAYER_GBRG=2, BAYER_BGGR=3
|
||||
|
||||
[vi_dev]
|
||||
Input_mod = 6
|
||||
; VI_MODE_BT656 = 0, /* ITU-R BT.656 YUV4:2:2 */
|
||||
; VI_MODE_BT656_PACKED_YUV, /* ITU-R BT.656 packed YUV4:2:2 */
|
||||
; VI_MODE_BT601, /* ITU-R BT.601 YUV4:2:2 */
|
||||
; VI_MODE_DIGITAL_CAMERA, /* digatal camera mode */
|
||||
; VI_MODE_BT1120_STANDARD, /* BT.1120 progressive mode */
|
||||
; VI_MODE_BT1120_INTERLEAVED, /* BT.1120 interstage mode */
|
||||
; VI_MODE_MIPI, /* MIPI RAW mode */
|
||||
; VI_MODE_MIPI_YUV420_NORMAL, /* MIPI YUV420 normal mode */
|
||||
; VI_MODE_MIPI_YUV420_LEGACY, /* MIPI YUV420 legacy mode */
|
||||
; VI_MODE_MIPI_YUV422, /* MIPI YUV422 mode */
|
||||
; VI_MODE_LVDS, /* LVDS mode */
|
||||
; VI_MODE_HISPI, /* HiSPi mode */
|
||||
; VI_MODE_SLVS, /* SLVS mode */
|
||||
Work_mod =0 ;VI_WORK_MODE_1Multiplex = 0
|
||||
;VI_WORK_MODE_2Multiplex,
|
||||
;VI_WORK_MODE_4Multiplex
|
||||
Combine_mode =0 ;Y/C composite or separation mode
|
||||
;VI_COMBINE_COMPOSITE = 0 /*Composite mode */
|
||||
;VI_COMBINE_SEPARATE, /*Separate mode */
|
||||
Comp_mode =0 ;Component mode (single-component or dual-component)
|
||||
;VI_COMP_MODE_SINGLE = 0, /*single component mode */
|
||||
;VI_COMP_MODE_DOUBLE = 1, /*double component mode */
|
||||
Clock_edge =1 ;Clock edge mode (sampling on the rising or falling edge)
|
||||
;VI_CLK_EDGE_SINGLE_UP=0, /*rising edge */
|
||||
;VI_CLK_EDGE_SINGLE_DOWN, /*falling edge */
|
||||
Mask_num =2 ;Component mask
|
||||
Mask_0 =0xFFF00000
|
||||
Mask_1 =0x0
|
||||
Scan_mode = 1;VI_SCAN_INTERLACED = 0
|
||||
;VI_SCAN_PROGRESSIVE,
|
||||
Data_seq =2 ;data sequence (ONLY for YUV format)
|
||||
;----2th component U/V sequence in bt1120
|
||||
; VI_INPUT_DATA_VUVU = 0,
|
||||
; VI_INPUT_DATA_UVUV,
|
||||
;----input sequence for yuv
|
||||
; VI_INPUT_DATA_UYVY = 0,
|
||||
; VI_INPUT_DATA_VYUY,
|
||||
; VI_INPUT_DATA_YUYV,
|
||||
; VI_INPUT_DATA_YVYU
|
||||
|
||||
Vsync =1 ; vertical synchronization signal
|
||||
;VI_VSYNC_FIELD = 0,
|
||||
;VI_VSYNC_PULSE,
|
||||
VsyncNeg=1 ;Polarity of the vertical synchronization signal
|
||||
;VI_VSYNC_NEG_HIGH = 0,
|
||||
;VI_VSYNC_NEG_LOW /*if VIU_VSYNC_E
|
||||
Hsync =0 ;Attribute of the horizontal synchronization signal
|
||||
;VI_HSYNC_VALID_SINGNAL = 0,
|
||||
;VI_HSYNC_PULSE,
|
||||
HsyncNeg =0 ;Polarity of the horizontal synchronization signal
|
||||
;VI_HSYNC_NEG_HIGH = 0,
|
||||
;VI_HSYNC_NEG_LOW
|
||||
VsyncValid =1 ;Attribute of the valid vertical synchronization signal
|
||||
;VI_VSYNC_NORM_PULSE = 0,
|
||||
;VI_VSYNC_VALID_SINGAL,
|
||||
VsyncValidNeg =0;Polarity of the valid vertical synchronization signal
|
||||
;VI_VSYNC_VALID_NEG_HIGH = 0,
|
||||
;VI_VSYNC_VALID_NEG_LOW
|
||||
Timingblank_HsyncHfb =0 ;Horizontal front blanking width
|
||||
Timingblank_HsyncAct =1280 ;Horizontal effetive width
|
||||
Timingblank_HsyncHbb =0 ;Horizontal back blanking width
|
||||
Timingblank_VsyncVfb =0 ;Vertical front blanking height
|
||||
Timingblank_VsyncVact =720 ;Vertical effetive width
|
||||
Timingblank_VsyncVbb=0 ;Vertical back blanking height
|
||||
Timingblank_VsyncVbfb =0 ;Even-field vertical front blanking height(interlace, invalid progressive)
|
||||
Timingblank_VsyncVbact=0 ;Even-field vertical effetive width(interlace, invalid progressive)
|
||||
Timingblank_VsyncVbbb =0 ;Even-field vertical back blanking height(interlace, invalid progressive)
|
||||
|
||||
;----- only for bt656 ----------
|
||||
FixCode =0 ;BT656_FIXCODE_1 = 0,
|
||||
;BT656_FIXCODE_0
|
||||
FieldPolar=0 ;BT656_FIELD_POLAR_STD = 0
|
||||
;BT656_FIELD_POLAR_NSTD
|
||||
DataPath =1 ;ISP enable or bypass
|
||||
;VI_PATH_BYPASS = 0,/* ISP bypass */
|
||||
;VI_PATH_ISP = 1,/* ISP enable */
|
||||
;VI_PATH_RAW = 2,/* Capture raw data, for debug */
|
||||
InputDataType=1 ;VI_DATA_TYPE_YUV = 0,VI_DATA_TYPE_RGB = 1,
|
||||
DataRev =FALSE ;Data reverse. FALSE = 0; TRUE = 1
|
||||
DevRect_x=200 ;
|
||||
DevRect_y=20 ;
|
||||
DevRect_w=1280 ;
|
||||
DevRect_h=720 ;
|
||||
FullLinesStd=750
|
||||
|
||||
[vi_chn]
|
||||
CapRect_X =320
|
||||
CapRect_Y =180
|
||||
CapRect_Width=1280
|
||||
CapRect_Height=720
|
||||
DestSize_Width=1280
|
||||
DestSize_Height=720
|
|
@ -0,0 +1,18 @@
|
|||
wlan=wlan0
|
||||
region=BO
|
||||
# By default used channel number, but, you may set freq instead. For ex: 2387M
|
||||
channel=44
|
||||
#frequency=5220M
|
||||
txpower=20
|
||||
driver_txpower_override=16
|
||||
bandwidth=20
|
||||
stbc=1
|
||||
ldpc=1
|
||||
mcs_index=1
|
||||
stream=0
|
||||
link_id=7669206
|
||||
udp_port=5600
|
||||
fec_k=8
|
||||
fec_n=12
|
||||
fec_timeout=0
|
||||
guard_interval=long
|
|
@ -0,0 +1,8 @@
|
|||
#yaml-cli -s .isp.sensorConfig /etc/sensors/imx307_i2c_2l_1080p.ini #use this for imx307
|
||||
yaml-cli -s .isp.sensorConfig /etc/sensors/imx415.bin
|
||||
yaml-cli -s .isp.exposure 10
|
||||
yaml-cli -s .video0.size 1920x1080
|
||||
yaml-cli -s .video0.fps 30
|
||||
yaml-cli -s .video0.crop 0x0x1920x1080
|
||||
sleep .2
|
||||
/root/kill.sh
|
|
@ -0,0 +1,7 @@
|
|||
yaml-cli -s .video0.size 1920x1080
|
||||
yaml-cli -s .video0.crop 0x0x1920x1080
|
||||
yaml-cli -s .video0.fps 60
|
||||
yaml-cli -s .isp.sensorConfig /etc/sensors/imx415f.bin
|
||||
yaml-cli -s .isp.exposure 20
|
||||
sleep .2
|
||||
/root/kill.sh
|
|
@ -0,0 +1,7 @@
|
|||
yaml-cli -s .video0.size 1920x1080
|
||||
yaml-cli -s .video0.crop 0x0x1920x1080
|
||||
yaml-cli -s .video0.fps 90
|
||||
yaml-cli -s .isp.sensorConfig /etc/sensors/imx415f.bin
|
||||
yaml-cli -s .isp.exposure 30
|
||||
sleep .2
|
||||
/root/kill.sh
|
|
@ -0,0 +1,7 @@
|
|||
yaml-cli -s .video0.size 3200x1800
|
||||
yaml-cli -s .video0.crop 250x150x2560x1440
|
||||
yaml-cli -s .video0.fps 30
|
||||
yaml-cli -s .isp.sensorConfig /etc/sensors/imx415.bin
|
||||
yaml-cli -s .isp.exposure 10
|
||||
sleep .2
|
||||
/root/kill.sh
|
|
@ -0,0 +1,7 @@
|
|||
yaml-cli -s .video0.size 3840x2160
|
||||
yaml-cli -s .video0.crop 575x330x2560x1440
|
||||
yaml-cli -s .video0.fps 20
|
||||
yaml-cli -s .isp.sensorConfig /etc/sensors/imx415.bin
|
||||
yaml-cli -s .isp.exposure 10
|
||||
sleep .2
|
||||
/root/kill.sh
|
|
@ -0,0 +1,9 @@
|
|||
#yaml-cli -s .isp.sensorConfig /etc/sensors/720p30_imx307_50.ini #use this for imx307
|
||||
#yaml-cli -s .video0.fps 50 #use thise for imx307
|
||||
yaml-cli -s .video0.size 1280x720
|
||||
yaml-cli -s .video0.fps 30
|
||||
yaml-cli -s .isp.sensorConfig /etc/sensors/imx415.bin
|
||||
yaml-cli -s .isp.exposure 10
|
||||
yaml-cli -s .video0.crop 0x0x1280x720
|
||||
sleep .2
|
||||
/root/kill.sh
|
|
@ -0,0 +1,7 @@
|
|||
yaml-cli -s .video0.size 1280x720
|
||||
yaml-cli -s .video0.crop 0x0x1280x720
|
||||
yaml-cli -s .video0.fps 60
|
||||
yaml-cli -s .isp.sensorConfig /etc/sensors/imx415f.bin
|
||||
yaml-cli -s .isp.exposure 20
|
||||
sleep .2
|
||||
/root/kill.sh
|
|
@ -0,0 +1,7 @@
|
|||
yaml-cli -s .video0.size 1280x720
|
||||
yaml-cli -s .video0.crop 0x0x1280x720
|
||||
yaml-cli -s .video0.fps 90
|
||||
yaml-cli -s .isp.sensorConfig /etc/sensors/imx415f.bin
|
||||
yaml-cli -s .isp.exposure 30
|
||||
sleep .2
|
||||
/root/kill.sh
|
|
@ -0,0 +1,7 @@
|
|||
yaml-cli -s .video0.size 1280x720
|
||||
yaml-cli -s .video0.crop 0x0x1280x720
|
||||
yaml-cli -s .video0.fps 120
|
||||
yaml-cli -s .isp.sensorConfig /etc/sensors/imx415f.bin
|
||||
yaml-cli -s .isp.exposure 30
|
||||
sleep .2
|
||||
/root/kill.sh
|
|
@ -0,0 +1,92 @@
|
|||
echo $1 $2 >>/tmp/channels.log
|
||||
|
||||
#channel 5
|
||||
if [ $1 -eq 5 ]; then
|
||||
if [ $2 -gt 1600 ]; then
|
||||
CURRENT_SIZE=`yaml-cli -g .video0.size`
|
||||
if [ $CURRENT_SIZE == '1280x720' ]; then
|
||||
/root/1080.sh
|
||||
sleep 3
|
||||
else
|
||||
/root/720.sh
|
||||
sleep 3
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
#channel 6
|
||||
#if [ $1 -eq 6 ]; then
|
||||
# if [ $2 -lt 1600 ]; then
|
||||
# /root/ircut.sh off
|
||||
# else
|
||||
# /root/ircut.sh on
|
||||
# fi
|
||||
#fi
|
||||
|
||||
if [ $1 -eq 6 ]; then
|
||||
if [ $2 -gt 1600 ]; then
|
||||
CURRENT_SIZE=`yaml-cli -g .video0.size`
|
||||
CURRENT_FPS=`yaml-cli -g .video0.fps`
|
||||
if [ $CURRENT_SIZE == '1280x720' ] && [ $CURRENT_FPS == '30' ] ; then
|
||||
/root/720b.sh
|
||||
sleep 3
|
||||
elif [ $CURRENT_SIZE == '1280x720' ] && [ $CURRENT_FPS == '60' ] ; then
|
||||
/root/720c.sh
|
||||
sleep 3
|
||||
elif [ $CURRENT_SIZE == '1280x720' ] && [ $CURRENT_FPS == '90' ] ; then
|
||||
/root/720d.sh
|
||||
sleep 3
|
||||
elif [ $CURRENT_SIZE == '1280x720' ] && [ $CURRENT_FPS == '120' ] ; then
|
||||
/root/1080.sh
|
||||
sleep 3
|
||||
elif [ $CURRENT_SIZE == '1920x1080' ] && [ $CURRENT_FPS == '30' ] ; then
|
||||
/root/1080b.sh
|
||||
sleep 3
|
||||
elif [ $CURRENT_SIZE == '1920x1080' ] && [ $CURRENT_FPS == '60' ] ; then
|
||||
/root/1080c.sh
|
||||
sleep 3
|
||||
elif [ $CURRENT_SIZE == '1920x1080' ] && [ $CURRENT_FPS == '90' ] ; then
|
||||
/root/3K.sh
|
||||
sleep 3
|
||||
elif [ $CURRENT_SIZE == '3200x1800' ]; then
|
||||
/root/4K.sh
|
||||
sleep 3
|
||||
else
|
||||
/root/720.sh
|
||||
sleep 3
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
#channel 7
|
||||
if [ $1 -eq 7 ]; then
|
||||
if [ $2 -lt 1400 ]; then
|
||||
yaml-cli -s .image.luminance 50
|
||||
killall -1 majestic
|
||||
elif [ $2 -gt 1400 ] && [ $2 -lt 1600 ]; then
|
||||
yaml-cli -s .image.luminance 90
|
||||
killall -1 majestic
|
||||
else
|
||||
yaml-cli -s .image.luminance 30
|
||||
killall -1 majestic
|
||||
fi
|
||||
fi
|
||||
|
||||
#channel 8
|
||||
if [ $1 -eq 8 ]; then
|
||||
if [ $2 -gt 1600 ]; then
|
||||
CURRENT_BITRATE=`yaml-cli -g .video0.bitrate`
|
||||
if [ $CURRENT_BITRATE -lt 7168 ]; then
|
||||
NEW_BITRATE="$(($CURRENT_BITRATE+1024))"
|
||||
else
|
||||
NEW_BITRATE="1024"
|
||||
sleep 2
|
||||
fi
|
||||
yaml-cli -s .video0.bitrate $NEW_BITRATE
|
||||
sleep .2
|
||||
/root/kill.sh
|
||||
fi
|
||||
sleep 3
|
||||
fi
|
||||
|
||||
exit 1
|
|
@ -0,0 +1,19 @@
|
|||
if [ $1 -eq 7 ]; then
|
||||
if [ $2 -gt 1600 ]; then
|
||||
/root/ircut.sh on
|
||||
elif [ $2 -gt 1400 ] && [ $2 -lt 1600 ]; then
|
||||
/root/ircut.sh off
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $1 -eq 8 ]; then
|
||||
if [ $2 -gt 1600 ]; then
|
||||
killall venc
|
||||
venc -p 5600 -f 30 -r 12288 -c 265cbr -v 200_imx307F -d frame --low-delay &
|
||||
elif [ $2 -gt 1400 ] && [ $2 -lt 1600 ]; then
|
||||
killall venc
|
||||
venc -p 5600 -f 50 -r 12288 -c 265cbr -v 200_imx307B -d frame &
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 1
|
|
@ -0,0 +1,32 @@
|
|||
#use: ./ircut.sh on | off
|
||||
|
||||
function gpio_setup {
|
||||
if [ ! -e /sys/class/gpio/gpio$1 ]; then
|
||||
echo $1 > /sys/class/gpio/export
|
||||
fi
|
||||
echo $2 > /sys/class/gpio/gpio$1/direction
|
||||
}
|
||||
|
||||
function set_gpio {
|
||||
echo $2 > /sys/class/gpio/gpio$1/value
|
||||
}
|
||||
|
||||
function ircut_on {
|
||||
set_gpio 8 0
|
||||
set_gpio 9 1
|
||||
sleep 0.1
|
||||
set_gpio 8 0
|
||||
}
|
||||
|
||||
function ircut_off {
|
||||
set_gpio 8 1
|
||||
set_gpio 9 0
|
||||
sleep 0.1
|
||||
set_gpio 8 0
|
||||
}
|
||||
|
||||
gpio_setup 8 out
|
||||
gpio_setup 9 out
|
||||
ircut_$1
|
||||
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
killall majestic
|
||||
sleep 1
|
||||
majestic
|
||||
sleep 5
|
||||
gkrcparams --MaxQp 30 --MaxI 2
|
Binary file not shown.
|
@ -0,0 +1,57 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Start telemetry
|
||||
#
|
||||
|
||||
. /etc/datalink.conf
|
||||
. /etc/telemetry.conf
|
||||
|
||||
keydir="/etc"
|
||||
|
||||
fw=$(grep "BUILD_OPTION" "/etc/os-release" | cut -d= -f2)
|
||||
|
||||
start_telemetry() {
|
||||
if [ ! -f /usr/bin/telemetry_rx -a ! -f /usr/bin/telemetry_tx ]; then
|
||||
ln -s /usr/bin/wfb_rx /usr/bin/telemetry_rx ; chmod +x /usr/bin/telemetry_rx
|
||||
ln -s /usr/bin/wfb_tx /usr/bin/telemetry_tx ; chmod +x /usr/bin/telemetry_tx
|
||||
else
|
||||
if [ ${one_way} = "false" ]; then
|
||||
if [ -z "${link_id}" ]; then
|
||||
telemetry2_rx -r ${stream_rx} -u ${port_rx} -K ${keydir}/drone.key ${wlan} >/dev/null &
|
||||
else
|
||||
telemetry_rx -p ${stream_rx} -u ${port_rx} -K ${keydir}/drone.key -i ${link_id} ${wlan} >/dev/null &
|
||||
fi
|
||||
fi
|
||||
if [ -z "${link_id}" ]; then
|
||||
telemetry2_tx -r ${stream_tx} -u ${port_tx} -K ${keydir}/drone.key -B ${bandwidth} -M ${mcs_index} -S ${stbc} -L ${ldpc} -G ${guard_interval} -k ${fec_k} -p ${fec_p} ${wlan} >/dev/null &
|
||||
else
|
||||
telemetry_tx -p ${stream_tx} -u ${port_tx} -K ${keydir}/drone.key -B ${bandwidth} -M ${mcs_index} -S ${stbc} -L ${ldpc} -G ${guard_interval} -k ${fec_k} -n ${fec_n} -T ${fec_timeout} -i ${link_id} ${wlan} >/dev/null &
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo "Loading MAVLink telemetry service..."
|
||||
|
||||
if [ ${router} -eq 1 ] || [ ${fw} = "lte" ]; then
|
||||
/usr/bin/mavlink-routerd &
|
||||
else
|
||||
mavfwd --master ${serial} --baudrate ${baud} --out 127.0.0.1:${port_tx} --in 127.0.0.1:${port_rx} &
|
||||
fi
|
||||
if [ ${fw} = "fpv" ]; then
|
||||
start_telemetry
|
||||
fi
|
||||
echo "Done."
|
||||
;;
|
||||
stop)
|
||||
echo "Stopping telemetry services..."
|
||||
kill -9 $(pidof telemetry_rx)
|
||||
kill -9 $(pidof telemetry_tx)
|
||||
kill -9 $(pidof mavlink-routerd)
|
||||
kill -9 $(pidof mavfwd)
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop}"
|
||||
exit 1
|
||||
esac
|
Binary file not shown.
|
@ -0,0 +1,156 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Start wifibroadcast
|
||||
#
|
||||
|
||||
. /etc/datalink.conf
|
||||
. /etc/wfb.conf
|
||||
|
||||
keydir="/etc"
|
||||
chip=$(ipcinfo -c)
|
||||
vendor=$(ipcinfo -v)
|
||||
|
||||
driver=""
|
||||
|
||||
set_mcs() {
|
||||
if [ ${vendor} = "ingenic" ]; then
|
||||
mcs=$(ls -l /lib/firmware | grep "htc_9271" | awk {'print $11'} | cut -d "." -f3)
|
||||
else
|
||||
mcs=$(ls -l /lib/firmware/ath9k_htc | grep "htc_9271-1.4.0.fw" | cut -d "." -f6)
|
||||
fi
|
||||
if [ -z "${mcs}" ]; then
|
||||
setmcs ${mcs_index}
|
||||
fi
|
||||
if [ ${mcs_index} -eq 1 ] || [ ${mcs_index} -eq 3 ]; then
|
||||
if [ ! ${mcs_index} -eq ${mcs} ]; then
|
||||
setmcs ${mcs_index}
|
||||
sleep 3
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# "0bda:8813" -> (8814) -> 8814au
|
||||
# "0846:9052" -> (8811) -> 8821au
|
||||
|
||||
detect_wifi_card() {
|
||||
echo "Detecting wifi card vendor..."
|
||||
devices=$(lsusb | cut -d ' ' -f6 | sort | uniq)
|
||||
for card in ${devices}
|
||||
do
|
||||
case "${card}" in
|
||||
"0bda:8812" | "0bda:881a" | "0b05:17d2" | "2357:0101")
|
||||
driver="realtek"
|
||||
modprobe 88XXau rtw_tx_pwr_idx_override=${driver_txpower_override}
|
||||
;;
|
||||
"0cf3:9271" | "040d:3801")
|
||||
driver="atheros"
|
||||
set_mcs
|
||||
modprobe mac80211
|
||||
modprobe ath9k_htc
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "${driver}" ]; then
|
||||
echo "No usb wifi card detected. Check wifi stick connection, usb power or possible bad soldering."
|
||||
exit
|
||||
else
|
||||
echo "Detected:" ${driver}
|
||||
fi
|
||||
|
||||
echo "Awaiting interface ${wlan} in system..."
|
||||
|
||||
local n=0
|
||||
while ! $(ifconfig -a | grep -q ${wlan})
|
||||
do
|
||||
if [ ${n} -ge 5 ]; then
|
||||
echo "No interface ${wlan}. Check wifi stick connection, usb power or possible bad soldering."
|
||||
exit
|
||||
fi
|
||||
sleep 0.5
|
||||
n=$(expr ${n} + 1)
|
||||
done
|
||||
}
|
||||
|
||||
load_modules() {
|
||||
modprobe cfg80211
|
||||
detect_wifi_card
|
||||
}
|
||||
|
||||
load_interface() {
|
||||
if [ ${driver} = "realtek" ]; then
|
||||
ifconfig ${wlan} up
|
||||
iwconfig ${wlan} mode monitor
|
||||
elif [ ${driver} = "atheros" ]; then
|
||||
iwconfig ${wlan} mode monitor
|
||||
ifconfig ${wlan} up
|
||||
fi
|
||||
|
||||
iw reg set ${region}
|
||||
|
||||
if [ ! -z "${frequency}" ]; then
|
||||
iwconfig ${wlan} freq ${frequency}
|
||||
else
|
||||
iwconfig ${wlan} channel ${channel}
|
||||
fi
|
||||
# dirty fix crash if txpower set. setting txpower disabled because patched driver always set txpower level 58
|
||||
# iw dev ${wlan} set txpower fixed $((${txpower} * 100))
|
||||
}
|
||||
|
||||
start_wfb() {
|
||||
if [ -z "${link_id}" ]; then
|
||||
wfb2_tx -r ${stream} -u ${udp_port} -K ${keydir}/drone.key -B ${bandwidth} -M ${mcs_index} -S ${stbc} -L ${ldpc} -G ${guard_interval} -k ${fec_k} -p ${fec_p} ${wlan} >/dev/null &
|
||||
else
|
||||
wfb_tx -p ${stream} -u ${udp_port} -K ${keydir}/drone.key -B ${bandwidth} -M ${mcs_index} -S ${stbc} -L ${ldpc} -G ${guard_interval} -k ${fec_k} -n ${fec_n} -T ${fec_timeout} -i ${link_id} ${wlan} &
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
if [ ${daemon} -eq 1 ]; then
|
||||
|
||||
echo "Loading modules and wifi card driver..."
|
||||
|
||||
load_modules
|
||||
|
||||
echo "Preparing interface wlan..."
|
||||
|
||||
load_interface
|
||||
|
||||
if ! cat ${keydir}/drone.key > /dev/null 2>&1; then
|
||||
echo "Generating drone & ground station keys..."
|
||||
cd ${keydir} ; wfb_keygen
|
||||
else
|
||||
echo "Drone key exist..."
|
||||
fi
|
||||
|
||||
echo "Starting Wifibroadcast service..."
|
||||
|
||||
start_wfb
|
||||
|
||||
echo "Done."
|
||||
|
||||
if [ ${telemetry} = "true" ]; then
|
||||
if [ ${chip} = "gk7205v200" ]; then
|
||||
# UART2_RX mux
|
||||
devmem 0x120c0010 32 0x1e04
|
||||
fi
|
||||
/usr/bin/telemetry start
|
||||
fi
|
||||
|
||||
else
|
||||
echo "Wifibroadcast service disabled in wfb.conf..."
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
echo "Stopping all services..."
|
||||
kill -9 $(pidof wfb_tx)
|
||||
kill -9 $(pidof telemetry_rx)
|
||||
kill -9 $(pidof telemetry_tx)
|
||||
kill -9 $(pidof mavlink-routerd)
|
||||
kill -9 $(pidof mavfwd)
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop}"
|
||||
exit 1
|
||||
esac
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue