mirror of https://github.com/OpenIPC/firmware.git
Merge branch 'OpenIPC:master' into master
commit
7d3dccd98b
|
@ -153,7 +153,6 @@ jobs:
|
|||
- hi3516av200_ultimate
|
||||
- gk7205v200_ultimate
|
||||
- gk7205v300_ultimate
|
||||
- gk7205v500_ultimate
|
||||
|
||||
steps:
|
||||
- name: Checkout source
|
||||
|
|
|
@ -989,7 +989,7 @@ CONFIG_MTD_UBI=y
|
|||
CONFIG_MTD_UBI_WL_THRESHOLD=4096
|
||||
CONFIG_MTD_UBI_BEB_LIMIT=20
|
||||
# CONFIG_MTD_UBI_FASTMAP is not set
|
||||
# CONFIG_MTD_UBI_GLUEBI is not set
|
||||
CONFIG_MTD_UBI_GLUEBI=y
|
||||
CONFIG_MTD_UBI_BLOCK=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_OF=y
|
||||
|
|
|
@ -985,7 +985,7 @@ CONFIG_MTD_UBI=y
|
|||
CONFIG_MTD_UBI_WL_THRESHOLD=4096
|
||||
CONFIG_MTD_UBI_BEB_LIMIT=20
|
||||
# CONFIG_MTD_UBI_FASTMAP is not set
|
||||
# CONFIG_MTD_UBI_GLUEBI is not set
|
||||
CONFIG_MTD_UBI_GLUEBI=y
|
||||
CONFIG_MTD_UBI_BLOCK=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_OF=y
|
||||
|
|
|
@ -987,7 +987,7 @@ CONFIG_MTD_UBI=y
|
|||
CONFIG_MTD_UBI_WL_THRESHOLD=4096
|
||||
CONFIG_MTD_UBI_BEB_LIMIT=20
|
||||
# CONFIG_MTD_UBI_FASTMAP is not set
|
||||
# CONFIG_MTD_UBI_GLUEBI is not set
|
||||
CONFIG_MTD_UBI_GLUEBI=y
|
||||
CONFIG_MTD_UBI_BLOCK=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_OF=y
|
||||
|
|
|
@ -881,7 +881,7 @@ CONFIG_MTD_UBI=y
|
|||
CONFIG_MTD_UBI_WL_THRESHOLD=4096
|
||||
CONFIG_MTD_UBI_BEB_LIMIT=20
|
||||
# CONFIG_MTD_UBI_FASTMAP is not set
|
||||
# CONFIG_MTD_UBI_GLUEBI is not set
|
||||
CONFIG_MTD_UBI_GLUEBI=y
|
||||
CONFIG_MTD_UBI_BLOCK=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_OF=y
|
||||
|
|
|
@ -968,7 +968,7 @@ CONFIG_MTD_UBI=y
|
|||
CONFIG_MTD_UBI_WL_THRESHOLD=4096
|
||||
CONFIG_MTD_UBI_BEB_LIMIT=20
|
||||
# CONFIG_MTD_UBI_FASTMAP is not set
|
||||
# CONFIG_MTD_UBI_GLUEBI is not set
|
||||
CONFIG_MTD_UBI_GLUEBI=y
|
||||
CONFIG_MTD_UBI_BLOCK=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_OF=y
|
||||
|
|
|
@ -969,7 +969,7 @@ CONFIG_MTD_UBI=y
|
|||
CONFIG_MTD_UBI_WL_THRESHOLD=4096
|
||||
CONFIG_MTD_UBI_BEB_LIMIT=20
|
||||
# CONFIG_MTD_UBI_FASTMAP is not set
|
||||
# CONFIG_MTD_UBI_GLUEBI is not set
|
||||
CONFIG_MTD_UBI_GLUEBI=y
|
||||
CONFIG_MTD_UBI_BLOCK=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_OF=y
|
||||
|
|
|
@ -1027,7 +1027,7 @@ CONFIG_MTD_UBI=y
|
|||
CONFIG_MTD_UBI_WL_THRESHOLD=4096
|
||||
CONFIG_MTD_UBI_BEB_LIMIT=20
|
||||
# CONFIG_MTD_UBI_FASTMAP is not set
|
||||
# CONFIG_MTD_UBI_GLUEBI is not set
|
||||
CONFIG_MTD_UBI_GLUEBI=y
|
||||
CONFIG_MTD_UBI_BLOCK=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_OF=y
|
||||
|
|
|
@ -1012,7 +1012,7 @@ CONFIG_MTD_UBI=y
|
|||
CONFIG_MTD_UBI_WL_THRESHOLD=4096
|
||||
CONFIG_MTD_UBI_BEB_LIMIT=20
|
||||
# CONFIG_MTD_UBI_FASTMAP is not set
|
||||
# CONFIG_MTD_UBI_GLUEBI is not set
|
||||
CONFIG_MTD_UBI_GLUEBI=y
|
||||
CONFIG_MTD_UBI_BLOCK=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_OF=y
|
||||
|
|
|
@ -921,7 +921,7 @@ CONFIG_MTD_UBI=y
|
|||
CONFIG_MTD_UBI_WL_THRESHOLD=4096
|
||||
CONFIG_MTD_UBI_BEB_LIMIT=20
|
||||
# CONFIG_MTD_UBI_FASTMAP is not set
|
||||
# CONFIG_MTD_UBI_GLUEBI is not set
|
||||
CONFIG_MTD_UBI_GLUEBI=y
|
||||
CONFIG_MTD_UBI_BLOCK=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_OF=y
|
||||
|
|
|
@ -871,7 +871,7 @@ CONFIG_MTD_UBI=y
|
|||
CONFIG_MTD_UBI_WL_THRESHOLD=4096
|
||||
CONFIG_MTD_UBI_BEB_LIMIT=20
|
||||
# CONFIG_MTD_UBI_FASTMAP is not set
|
||||
# CONFIG_MTD_UBI_GLUEBI is not set
|
||||
CONFIG_MTD_UBI_GLUEBI=y
|
||||
CONFIG_MTD_UBI_BLOCK=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_OF=y
|
||||
|
|
|
@ -881,7 +881,7 @@ CONFIG_MTD_UBI=y
|
|||
CONFIG_MTD_UBI_WL_THRESHOLD=4096
|
||||
CONFIG_MTD_UBI_BEB_LIMIT=20
|
||||
# CONFIG_MTD_UBI_FASTMAP is not set
|
||||
# CONFIG_MTD_UBI_GLUEBI is not set
|
||||
CONFIG_MTD_UBI_GLUEBI=y
|
||||
CONFIG_MTD_UBI_BLOCK=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_OF=y
|
||||
|
|
|
@ -985,7 +985,7 @@ CONFIG_MTD_UBI=y
|
|||
CONFIG_MTD_UBI_WL_THRESHOLD=4096
|
||||
CONFIG_MTD_UBI_BEB_LIMIT=20
|
||||
# CONFIG_MTD_UBI_FASTMAP is not set
|
||||
# CONFIG_MTD_UBI_GLUEBI is not set
|
||||
CONFIG_MTD_UBI_GLUEBI=y
|
||||
CONFIG_MTD_UBI_BLOCK=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_OF=y
|
||||
|
|
|
@ -987,7 +987,7 @@ CONFIG_MTD_UBI=y
|
|||
CONFIG_MTD_UBI_WL_THRESHOLD=4096
|
||||
CONFIG_MTD_UBI_BEB_LIMIT=20
|
||||
# CONFIG_MTD_UBI_FASTMAP is not set
|
||||
# CONFIG_MTD_UBI_GLUEBI is not set
|
||||
CONFIG_MTD_UBI_GLUEBI=y
|
||||
CONFIG_MTD_UBI_BLOCK=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_OF=y
|
||||
|
|
|
@ -989,7 +989,7 @@ CONFIG_MTD_UBI=y
|
|||
CONFIG_MTD_UBI_WL_THRESHOLD=4096
|
||||
CONFIG_MTD_UBI_BEB_LIMIT=20
|
||||
# CONFIG_MTD_UBI_FASTMAP is not set
|
||||
# CONFIG_MTD_UBI_GLUEBI is not set
|
||||
CONFIG_MTD_UBI_GLUEBI=y
|
||||
CONFIG_MTD_UBI_BLOCK=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_OF=y
|
||||
|
|
|
@ -1025,7 +1025,7 @@ CONFIG_MTD_UBI=y
|
|||
CONFIG_MTD_UBI_WL_THRESHOLD=4096
|
||||
CONFIG_MTD_UBI_BEB_LIMIT=20
|
||||
# CONFIG_MTD_UBI_FASTMAP is not set
|
||||
# CONFIG_MTD_UBI_GLUEBI is not set
|
||||
CONFIG_MTD_UBI_GLUEBI=y
|
||||
CONFIG_MTD_UBI_BLOCK=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_OF=y
|
||||
|
|
|
@ -64,6 +64,5 @@ BR2_PACKAGE_MAJESTIC=y
|
|||
BR2_PACKAGE_MBEDTLS_OPENIPC=y
|
||||
BR2_PACKAGE_OPUS_OPENIPC=y
|
||||
BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y
|
||||
BR2_PACKAGE_QUIRC_OPENIPC=y
|
||||
BR2_PACKAGE_VTUND_OPENIPC=y
|
||||
BR2_PACKAGE_YAML_CLI=y
|
||||
|
|
|
@ -65,6 +65,5 @@ BR2_PACKAGE_MBEDTLS_OPENIPC=y
|
|||
BR2_PACKAGE_MOTORS=y
|
||||
BR2_PACKAGE_OPUS_OPENIPC=y
|
||||
BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y
|
||||
BR2_PACKAGE_QUIRC_OPENIPC=y
|
||||
BR2_PACKAGE_VTUND_OPENIPC=y
|
||||
BR2_PACKAGE_YAML_CLI=y
|
||||
|
|
|
@ -65,6 +65,5 @@ BR2_PACKAGE_MBEDTLS_OPENIPC=y
|
|||
BR2_PACKAGE_MOTORS=y
|
||||
BR2_PACKAGE_OPUS_OPENIPC=y
|
||||
BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y
|
||||
BR2_PACKAGE_QUIRC_OPENIPC=y
|
||||
BR2_PACKAGE_VTUND_OPENIPC=y
|
||||
BR2_PACKAGE_YAML_CLI=y
|
||||
|
|
|
@ -65,6 +65,5 @@ BR2_PACKAGE_MBEDTLS_OPENIPC=y
|
|||
BR2_PACKAGE_MOTORS=y
|
||||
BR2_PACKAGE_OPUS_OPENIPC=y
|
||||
BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y
|
||||
BR2_PACKAGE_QUIRC_OPENIPC=y
|
||||
BR2_PACKAGE_VTUND_OPENIPC=y
|
||||
BR2_PACKAGE_YAML_CLI=y
|
||||
|
|
|
@ -65,6 +65,5 @@ BR2_PACKAGE_MBEDTLS_OPENIPC=y
|
|||
BR2_PACKAGE_MOTORS=y
|
||||
BR2_PACKAGE_OPUS_OPENIPC=y
|
||||
BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y
|
||||
BR2_PACKAGE_QUIRC_OPENIPC=y
|
||||
BR2_PACKAGE_VTUND_OPENIPC=y
|
||||
BR2_PACKAGE_YAML_CLI=y
|
||||
|
|
|
@ -66,6 +66,5 @@ BR2_PACKAGE_MBEDTLS_OPENIPC=y
|
|||
BR2_PACKAGE_MOTORS=y
|
||||
BR2_PACKAGE_OPUS_OPENIPC=y
|
||||
BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y
|
||||
BR2_PACKAGE_QUIRC_OPENIPC=y
|
||||
BR2_PACKAGE_VTUND_OPENIPC=y
|
||||
BR2_PACKAGE_YAML_CLI=y
|
||||
|
|
|
@ -64,6 +64,5 @@ BR2_PACKAGE_MBEDTLS_OPENIPC=y
|
|||
BR2_PACKAGE_MOTORS=y
|
||||
BR2_PACKAGE_OPUS_OPENIPC=y
|
||||
BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y
|
||||
BR2_PACKAGE_QUIRC_OPENIPC=y
|
||||
BR2_PACKAGE_VTUND_OPENIPC=y
|
||||
BR2_PACKAGE_YAML_CLI=y
|
||||
|
|
|
@ -59,6 +59,5 @@ BR2_PACKAGE_LINUX_FIRMWARE_OPENIPC_MEDIATEK_MT7601U=y
|
|||
BR2_PACKAGE_MAJESTIC_WEBUI=y
|
||||
BR2_PACKAGE_MBEDTLS_OPENIPC=y
|
||||
BR2_PACKAGE_MOTORS=y
|
||||
BR2_PACKAGE_QUIRC_OPENIPC=y
|
||||
BR2_PACKAGE_VTUND_OPENIPC=y
|
||||
BR2_PACKAGE_YAML_CLI=y
|
||||
|
|
|
@ -19,6 +19,11 @@ case "$1" in
|
|||
touch /etc/network.ok
|
||||
fi
|
||||
|
||||
if [ -e /usr/share/openipc/muxes.sh ]; then
|
||||
echo "Run custom muxes & gpios preset script..."
|
||||
sh /usr/share/openipc/muxes.sh
|
||||
fi
|
||||
|
||||
check_mac
|
||||
;;
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ case "$CMD" in
|
|||
echo -e " $(lsusb | awk '{print $6}' | sort | tr '\n' ' ')\n"
|
||||
echo "Memory:"
|
||||
echo -e " totalmem - $(fw_printenv -n totalmem)"
|
||||
echo -e " osmem - $(fw_printenv -n osmem)\n"
|
||||
echo -e " osmem - $(fw_printenv -n osmem || echo 'not set')\n"
|
||||
echo "Processor:"
|
||||
echo -e " detected - $(ipcinfo -ci | tr '\n' '\t')"
|
||||
echo -e " recorded - $(fw_printenv -n soc)\n"
|
||||
|
|
|
@ -54,13 +54,13 @@ insert_detect() {
|
|||
insert_osal
|
||||
insmod xm_base.ko
|
||||
modprobe xm_isp
|
||||
modprobe xm_sensor_i2c
|
||||
modprobe xm_sensor_spi
|
||||
modprobe xm_isp_sensor_i2c
|
||||
modprobe xm_isp_sensor_spi
|
||||
}
|
||||
|
||||
remove_detect() {
|
||||
rmmod -w xm_sensor_spi
|
||||
rmmod -w xm_sensor_i2c
|
||||
rmmod -w xm_isp_sensor_spi
|
||||
rmmod -w xm_isp_sensor_i2c
|
||||
rmmod -w xm_isp
|
||||
rmmod -w xm_base
|
||||
rmmod -w xm_osal >/dev/null 2>&1
|
||||
|
@ -93,7 +93,7 @@ insert_isp() {
|
|||
|
||||
insert_isp_piris() {
|
||||
if [ "${chipid}" == "gk7605v100" -a "${board}" == "demo" ]; then
|
||||
modprobe xm_piris
|
||||
modprobe xm_isp_piris
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -111,8 +111,8 @@ insert_ko() {
|
|||
insmod xm_vi.ko
|
||||
insert_isp
|
||||
insmod xm_vpss.ko
|
||||
# insmod xm_vo.ko # unused on XmIPC
|
||||
# insmod gfbg.ko video="gfbg:vram0_size:1620" # unused on XmIPC # default fb0:D1
|
||||
# insmod xm_vo.ko # unused on XmIPC
|
||||
# insmod gfbg.ko video="gfbg:vram0_size:1620" # unused on XmIPC # default fb0:D1
|
||||
insmod xm_chnl.ko
|
||||
insmod xm_vedu.ko
|
||||
insmod xm_rc.ko
|
||||
|
@ -121,24 +121,24 @@ insert_ko() {
|
|||
insmod xm_h265e.ko
|
||||
insmod xm_jpege.ko
|
||||
insmod xm_ive.ko save_power=0
|
||||
modprobe xm_pwm
|
||||
modprobe xm_sensor_i2c
|
||||
modprobe xm_sensor_spi
|
||||
# insert_isp_piris # unused on XmIPC
|
||||
# insert_sil9024; # unused on XmIPC # BT1120
|
||||
modprobe xm_isp_pwm
|
||||
modprobe xm_isp_sensor_i2c
|
||||
modprobe xm_isp_sensor_spi
|
||||
# insert_isp_piris # unused on XmIPC
|
||||
# insert_sil9024; # unused on XmIPC # BT1120
|
||||
insert_audio
|
||||
modprobe xm_mipi_rx
|
||||
# insmod xm_pm.ko # unused on XmIPC
|
||||
modprobe xm_wdt
|
||||
# insmod xm_pm.ko # unused on XmIPC
|
||||
# modprobe xm_wdt # temporarily disabled
|
||||
}
|
||||
|
||||
remove_ko() {
|
||||
rmmod -w xm_wdt
|
||||
# rmmod -w xm_pm # unused on XmIPC
|
||||
# rmmod -w xm_wdt
|
||||
# rmmod -w xm_pm
|
||||
remove_audio
|
||||
rmmod -w xm_mipi_rx
|
||||
# rmmod -w xm_piris # unused on XmIPC
|
||||
# rmmod -w sil9024 &> /dev/null # unused on XmIPC
|
||||
# rmmod -w xm_isp_piris
|
||||
# rmmod -w sil9024 &> /dev/null
|
||||
rmmod -w xm_ive
|
||||
rmmod -w xm_rc
|
||||
rmmod -w xm_jpege
|
||||
|
@ -147,17 +147,17 @@ remove_ko() {
|
|||
rmmod -w xm_venc
|
||||
rmmod -w xm_vedu
|
||||
rmmod -w xm_chnl
|
||||
# rmmod -w gfbg # unused on XmIPC
|
||||
# rmmod -w xm_vo # unused on XmIPC
|
||||
# rmmod -w gfbg
|
||||
# rmmod -w xm_vo
|
||||
rmmod -w xm_vpss
|
||||
rmmod -w xm_isp
|
||||
rmmod -w xm_vi
|
||||
rmmod -w xm_vgs
|
||||
rmmod -w xm_rgn
|
||||
# rmmod -w xm_tde
|
||||
rmmod -w xm_sensor_i2c &>/dev/null
|
||||
rmmod -w xm_sensor_spi &>/dev/null
|
||||
rmmod -w xm_pwm
|
||||
rmmod -w xm_isp_sensor_i2c &>/dev/null
|
||||
rmmod -w xm_isp_sensor_spi &>/dev/null
|
||||
rmmod -w xm_isp_pwm
|
||||
rmmod -w xm_sys
|
||||
rmmod -w xm_base
|
||||
rmmod -w xm_osal
|
||||
|
|
|
@ -115,7 +115,7 @@ define GOKE_OSDRV_GK7205V500_INSTALL_TARGET_CMDS
|
|||
# $(INSTALL) -m 644 -t $(TARGET_DIR)/usr/lib/sensors $(GOKE_OSDRV_GK7205V500_PKGDIR)/files/sensor/libsns_sp2305.so
|
||||
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/usr/lib
|
||||
## $(INSTALL) -m 644 -t $(TARGET_DIR)/usr/lib $(GOKE_OSDRV_GK7205V500_PKGDIR)/files/lib/*
|
||||
# $(INSTALL) -m 644 -t $(TARGET_DIR)/usr/lib $(GOKE_OSDRV_GK7205V500_PKGDIR)/files/lib/*
|
||||
# $(INSTALL) -m 644 -t $(TARGET_DIR)/usr/lib $(GOKE_OSDRV_GK7205V500_PKGDIR)/files/lib/libaac_comm.so
|
||||
# $(INSTALL) -m 644 -t $(TARGET_DIR)/usr/lib $(GOKE_OSDRV_GK7205V500_PKGDIR)/files/lib/libaac_dec.so
|
||||
# $(INSTALL) -m 644 -t $(TARGET_DIR)/usr/lib $(GOKE_OSDRV_GK7205V500_PKGDIR)/files/lib/libaac_enc.so
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
if [ $(fw_printenv -n wlandev) ]; then
|
||||
qrscan.sh >/dev/null 2>&1 &
|
||||
fi
|
||||
;;
|
||||
esac
|
|
@ -0,0 +1,31 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ -e /usr/share/openipc/gpio.conf ]; then
|
||||
. /usr/share/openipc/gpio.conf
|
||||
fi
|
||||
|
||||
gpio=${led1}
|
||||
|
||||
n=0
|
||||
|
||||
gpio toggle ${gpio} | logger -t gpio
|
||||
|
||||
while true ; do
|
||||
if [ "$n" -ge 30 ]; then
|
||||
logger -t qrscan "Recognition timeout exceeded, reboot camera and try again..."
|
||||
gpio toggle ${gpio} | logger -t gpio
|
||||
exit 1
|
||||
fi
|
||||
timeout 1 wget -q -O /tmp/image.jpg http://127.0.0.1/image.jpg
|
||||
data=$(qrscan -p /tmp/image.jpg)
|
||||
if [[ -n "$data" ]] && $(echo "$data" | grep -q wlan); then
|
||||
fw_setenv $(echo $data | cut -d " " -f 1 | sed 's/=/ /')
|
||||
fw_setenv $(echo $data | cut -d " " -f 2 | sed 's/=/ /')
|
||||
logger -t qrscan "Recognition successfully, wlanssid and wlanpass is writed to env. Reboot required."
|
||||
curl --data-binary @/usr/share/openipc/sounds/ready_48k.pcm http://localhost/play_audio
|
||||
for a in $(seq 10) ; do (gpio toggle ${gpio} ; sleep 0.3 ; gpio toggle ${gpio} ; sleep 0.3) ; done >/dev/null 2>&1
|
||||
reboot -f
|
||||
fi
|
||||
sleep 1
|
||||
n=$((n + 1))
|
||||
done
|
Binary file not shown.
|
@ -19,6 +19,15 @@ endef
|
|||
define QUIRC_OPENIPC_INSTALL_TARGET_CMDS
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/usr/bin
|
||||
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/bin $(@D)/qrscan
|
||||
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/usr/sbin
|
||||
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/sbin $(QUIRC_OPENIPC_PKGDIR)/files/qrscan.sh
|
||||
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/etc/init.d
|
||||
$(INSTALL) -m 755 -t $(TARGET_DIR)/etc/init.d $(QUIRC_OPENIPC_PKGDIR)/files/S97qrscan
|
||||
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/usr/share/openipc/sounds
|
||||
$(INSTALL) -m 644 -t $(TARGET_DIR)/usr/share/openipc/sounds $(QUIRC_OPENIPC_PKGDIR)/files/ready_48k.pcm
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
|
|
|
@ -10,5 +10,5 @@ broadcast:
|
|||
link_id: 7669206
|
||||
telemetry:
|
||||
router: msposd
|
||||
serial: /dev/ttyS2
|
||||
serial: ttyS2
|
||||
osd_fps: 20
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
wfb_key=/etc/drone.key
|
||||
wfb_dev=wlan0
|
||||
|
||||
echo_log() {
|
||||
echo "$1" | logger -s -t wifibroadcast
|
||||
}
|
||||
|
||||
wfb_yaml() {
|
||||
if [ -e "$1" ]; then
|
||||
while IFS=: read -r key value; do
|
||||
|
@ -13,7 +17,6 @@ wfb_yaml() {
|
|||
}
|
||||
|
||||
load_config() {
|
||||
wfb_yaml /rom/etc/wfb.yaml
|
||||
wfb_yaml /etc/wfb.yaml
|
||||
[ ! -e "$wfb_key" ] && wfb_key=/rom/etc/drone.key
|
||||
}
|
||||
|
@ -39,14 +42,13 @@ load_modules() {
|
|||
done
|
||||
|
||||
if [ -z "$driver" ]; then
|
||||
echo "- Wireless module not detected!"
|
||||
echo_log "Wireless module not detected!"
|
||||
exit 1
|
||||
else
|
||||
echo "- Detected driver: $driver"
|
||||
fi
|
||||
|
||||
echo_log "Detected driver: $driver"
|
||||
if ! ifconfig "$wfb_dev" up; then
|
||||
echo "- Wireless driver not found!"
|
||||
echo_log "Wireless driver not found!"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
@ -62,13 +64,13 @@ load_interface() {
|
|||
}
|
||||
|
||||
start_broadcast() {
|
||||
echo "- Starting wfb_tx"
|
||||
echo_log "Starting wfb_tx"
|
||||
wfb_tx -K "$wfb_key" -M "$wfb_index" -B "$bandwidth" -C 8000 -G short \
|
||||
-k "$fec_k" -n "$fec_n" -i "$link_id" "$wfb_dev" &> /dev/null &
|
||||
}
|
||||
|
||||
start_tunnel() {
|
||||
echo "- Starting wfb_tun"
|
||||
echo_log "Starting wfb_tun"
|
||||
wfb_rx -p 160 -u 5800 -K "$wfb_key" -i "$link_id" "$wfb_dev" &> /dev/null &
|
||||
wfb_tx -p 32 -u 5801 -K "$wfb_key" -M "$tun_index" \
|
||||
-k "$fec_k" -n "$fec_n" -i "$link_id" "$wfb_dev" &> /dev/null &
|
||||
|
@ -79,15 +81,15 @@ start_telemetry() {
|
|||
chipset=$(ipcinfo -c)
|
||||
[ "$chipset" = "ssc33x" ] && devmem 0x1F207890 16 0x8
|
||||
|
||||
echo "- Starting $router"
|
||||
echo_log "Starting $router"
|
||||
if [ "$router" = "msposd" ]; then
|
||||
config=$(curl -s localhost/api/v1/config.json)
|
||||
[ -n "$config" ] && size=$(echo "$config" | jsonfilter -e "@.video0.size")
|
||||
msposd -b 115200 -c 8 -d -r "$osd_fps" -z "${size:-1280x720}" \
|
||||
-m "$serial" -o 10.5.0.1:14551 > /dev/null &
|
||||
-m /dev/"$serial" -o 10.5.0.1:14551 > /dev/null &
|
||||
elif [ "$router" = "mavfwd" ]; then
|
||||
mavfwd --baudrate 115200 --channels 8 -p 100 -a 15 -t \
|
||||
--master "$serial" --in 0.0.0.0:14550 --out 10.5.0.1:14551 > /dev/null &
|
||||
mavfwd -b 115200 -c 8 -p 100 -a 15 -t \
|
||||
-m /dev/"$serial" -i 0.0.0.0:14550 -o 10.5.0.1:14551 > /dev/null &
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -95,8 +97,8 @@ video_settings() {
|
|||
sensor=$(ipcinfo -s)
|
||||
cli -s .isp.sensorConfig /etc/sensors/"$sensor"_fpv.bin
|
||||
cli -s .isp.exposure 5
|
||||
cli -s .video0.fps 60
|
||||
cli -s .video0.bitrate 10240
|
||||
cli -s .video0.fps 90
|
||||
cli -s .video0.bitrate 8192
|
||||
cli -s .video0.codec h265
|
||||
cli -s .video0.rcMode cbr
|
||||
cli -s .outgoing.enabled true
|
||||
|
@ -126,7 +128,7 @@ start() {
|
|||
stop() {
|
||||
for process in wfb_rx wfb_tx wfb_tun msposd mavfwd; do
|
||||
if [ -n "$(pidof $process)" ]; then
|
||||
echo "- Stopping $process"
|
||||
echo_log "Stopping $process"
|
||||
killall -q "$process"
|
||||
fi
|
||||
done
|
||||
|
@ -137,14 +139,18 @@ case "$1" in
|
|||
$1
|
||||
;;
|
||||
|
||||
reset)
|
||||
resetv)
|
||||
cp -f /rom/etc/majestic.yaml /etc/majestic.yaml
|
||||
cp -f /rom/etc/wfb.yaml /etc/wfb.yaml
|
||||
video_settings
|
||||
;;
|
||||
|
||||
resetw)
|
||||
cp -f /rom/etc/wfb.yaml /etc/wfb.yaml
|
||||
start
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|reset}"
|
||||
echo "Usage: $0 {start|stop|resetv|resetw}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -3,84 +3,8 @@
|
|||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Camera</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Helvetica;
|
||||
background-color: #1e1e1e;
|
||||
color: #dcdcdc;
|
||||
text-align: center;
|
||||
}
|
||||
header {
|
||||
background-color: #252526;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 2px 10px #00000080;
|
||||
color: white;
|
||||
padding: 15px 0;
|
||||
}
|
||||
h3 {
|
||||
font-size: 1.5rem;
|
||||
margin-top: 1rem;
|
||||
color: #dee2e6bf;
|
||||
}
|
||||
.container {
|
||||
padding: 20px;
|
||||
}
|
||||
.form-section {
|
||||
background-color: #2d2d2d;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 2px 10px #00000080;
|
||||
max-width: 40%;
|
||||
padding: 20px;
|
||||
margin: 20px auto;
|
||||
}
|
||||
.form-section label {
|
||||
display: inline-block;
|
||||
font-weight: bold;
|
||||
margin: 10px 0 5px;
|
||||
width: 150px;
|
||||
vertical-align: top;
|
||||
color: #dee2e6;
|
||||
}
|
||||
.form-section select {
|
||||
width: 120px;
|
||||
padding: 10px;
|
||||
margin-bottom: 15px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #555;
|
||||
background-color: #3c3c3c;
|
||||
color: #dcdcdc;
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.form-section input {
|
||||
width: 120px;
|
||||
height: 25px;
|
||||
}
|
||||
.form-section button {
|
||||
background-color: #0d6efd80;
|
||||
box-shadow: 0 2px 10px #00000040;
|
||||
color: white;
|
||||
padding: 10px 60px;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font-size: 1rem;
|
||||
}
|
||||
.form-section button:hover {
|
||||
background-color: #0b5ed7;
|
||||
}
|
||||
#preview {
|
||||
width: 100%;
|
||||
max-width: 1200px;
|
||||
background-color: #000;
|
||||
box-shadow: 0 2px 10px #00000080;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.row {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<title>OpenIPC</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
@ -121,7 +45,10 @@
|
|||
<input type="checkbox" id="records" name="majestic.records.enabled">
|
||||
</div>
|
||||
</form>
|
||||
<button id="apply-majestic-button">Apply</button>
|
||||
<div class="button-container">
|
||||
<button id="apply-video-button">Apply</button>
|
||||
<button id="reset-video-button">Reset</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="form-section">
|
||||
|
@ -197,115 +124,20 @@
|
|||
<div class="row">
|
||||
<label for="serial">Serial:</label>
|
||||
<select id="serial" name="wfb.telemetry.serial">
|
||||
<option value="/dev/ttyS0">/dev/ttyS0</option>
|
||||
<option value="/dev/ttyS2">/dev/ttyS2</option>
|
||||
<option value="ttyS0">ttyS0</option>
|
||||
<option value="ttyS2">ttyS2</option>
|
||||
</select>
|
||||
</div>
|
||||
</form>
|
||||
<button id="apply-wfb-button">Apply</button>
|
||||
</section>
|
||||
|
||||
<section class="form-section">
|
||||
<h3>Configuration</h3>
|
||||
<button id="reset-button">Reset</button>
|
||||
<div class="button-container">
|
||||
<button id="apply-wfb-button">Apply</button>
|
||||
<button id="reset-wfb-button">Reset</button>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script src="js-yaml.min.js"></script>
|
||||
<script>
|
||||
let configData = { majestic: {}, wfb: {} };
|
||||
|
||||
async function loadYAML(url, setter) {
|
||||
const response = await fetch(url);
|
||||
const text = await response.text();
|
||||
setter(jsyaml.load(text));
|
||||
}
|
||||
|
||||
async function uploadYAML(data, location) {
|
||||
const yamlData = jsyaml.dump(data);
|
||||
await fetch('/upload', {
|
||||
method: 'POST',
|
||||
headers: { 'File-Location': location },
|
||||
body: yamlData
|
||||
});
|
||||
}
|
||||
|
||||
async function runCommand(command) {
|
||||
await fetch('/command', {
|
||||
method: 'POST',
|
||||
headers: { 'Run-Command': command }
|
||||
});
|
||||
}
|
||||
|
||||
function syncForm(data, formPrefix, mode) {
|
||||
Object.keys(data).forEach((section) => {
|
||||
Object.keys(data[section]).forEach((key) => {
|
||||
const field = document.getElementsByName(formPrefix + '.' + section + '.' + key)[0];
|
||||
if (field) {
|
||||
if (mode === "setup") {
|
||||
field.value = data[section][key];
|
||||
} else if (mode === "update") {
|
||||
data[section][key] = field.value;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function executeDelay(button, command) {
|
||||
button.disabled = true;
|
||||
runCommand(command);
|
||||
setTimeout(() => {
|
||||
button.disabled = false;
|
||||
location.reload();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
function populateSelect(id, start, end, step) {
|
||||
const select = document.getElementById(id);
|
||||
for (let i = start; i <= end; i += step) {
|
||||
const option = document.createElement('option');
|
||||
option.value = i;
|
||||
option.textContent = i;
|
||||
select.appendChild(option);
|
||||
}
|
||||
}
|
||||
|
||||
populateSelect('bitrate', 1024, 20480, 1024);
|
||||
populateSelect('txpower', 1, 50, 1);
|
||||
populateSelect('wfb_index', 0, 8, 1);
|
||||
populateSelect('tun_index', 0, 8, 1);
|
||||
|
||||
document.getElementById('apply-majestic-button').addEventListener('click', function() {
|
||||
if (configData.majestic) {
|
||||
syncForm(configData.majestic, 'majestic', "update");
|
||||
uploadYAML(configData.majestic, '/etc/majestic.yaml');
|
||||
executeDelay(this, 'killall -1 majestic');
|
||||
}
|
||||
});
|
||||
|
||||
document.getElementById('apply-wfb-button').addEventListener('click', function() {
|
||||
if (configData.wfb) {
|
||||
syncForm(configData.wfb, 'wfb', "update");
|
||||
uploadYAML(configData.wfb, '/etc/wfb.yaml');
|
||||
executeDelay(this, 'wifibroadcast start');
|
||||
}
|
||||
});
|
||||
|
||||
document.getElementById('reset-button').addEventListener('click', function() {
|
||||
executeDelay(this, 'wifibroadcast reset');
|
||||
});
|
||||
|
||||
loadYAML('/etc/majestic.yaml', (data) => {
|
||||
configData.majestic = data;
|
||||
syncForm(configData.majestic, 'majestic', "setup");
|
||||
});
|
||||
|
||||
loadYAML('/etc/wfb.yaml', (data) => {
|
||||
configData.wfb = data;
|
||||
syncForm(configData.wfb, 'wfb', "setup");
|
||||
});
|
||||
</script>
|
||||
<script src="script.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -0,0 +1,101 @@
|
|||
let configData = { majestic: {}, wfb: {} };
|
||||
|
||||
async function loadYAML(url, setter) {
|
||||
const response = await fetch(url);
|
||||
const text = await response.text();
|
||||
setter(jsyaml.load(text));
|
||||
}
|
||||
|
||||
async function uploadYAML(data, location) {
|
||||
const yamlData = jsyaml.dump(data);
|
||||
await fetch('/upload', {
|
||||
method: 'POST',
|
||||
headers: { 'File-Location': location },
|
||||
body: yamlData
|
||||
});
|
||||
}
|
||||
|
||||
async function runCommand(command) {
|
||||
await fetch('/command', {
|
||||
method: 'POST',
|
||||
headers: { 'Run-Command': command }
|
||||
});
|
||||
}
|
||||
|
||||
function syncForm(data, formPrefix, mode) {
|
||||
Object.keys(data).forEach((section) => {
|
||||
Object.keys(data[section]).forEach((key) => {
|
||||
const field = document.getElementsByName(formPrefix + '.' + section + '.' + key)[0];
|
||||
if (!field) {
|
||||
return;
|
||||
}
|
||||
|
||||
const isCheckbox = field.type === "checkbox";
|
||||
const value = data[section][key];
|
||||
|
||||
if (mode === "setup") {
|
||||
if (isCheckbox) {
|
||||
field.checked = value === true;
|
||||
} else {
|
||||
field.value = value;
|
||||
}
|
||||
} else if (mode === "update") {
|
||||
if (isCheckbox) {
|
||||
data[section][key] = field.checked;
|
||||
} else {
|
||||
data[section][key] = field.value;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function executeDelay(button, command) {
|
||||
button.disabled = true;
|
||||
runCommand(command);
|
||||
setTimeout(() => {
|
||||
button.disabled = false;
|
||||
location.reload();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
function addClickListener(buttonId, command, configKey) {
|
||||
document.getElementById(buttonId).addEventListener('click', function () {
|
||||
if (configKey && configData[configKey]) {
|
||||
syncForm(configData[configKey], configKey, "update");
|
||||
var yamlPath = '/etc/' + configKey + '.yaml';
|
||||
uploadYAML(configData[configKey], yamlPath);
|
||||
}
|
||||
executeDelay(this, command);
|
||||
});
|
||||
}
|
||||
|
||||
addClickListener('apply-video-button', 'killall -1 majestic', 'majestic');
|
||||
addClickListener('apply-wfb-button', 'wifibroadcast start', 'wfb');
|
||||
addClickListener('reset-video-button', 'wifibroadcast resetv');
|
||||
addClickListener('reset-wfb-button', 'wifibroadcast resetw');
|
||||
|
||||
function populateSelect(id, start, end, step) {
|
||||
const select = document.getElementById(id);
|
||||
for (let i = start; i <= end; i += step) {
|
||||
const option = document.createElement('option');
|
||||
option.value = i;
|
||||
option.textContent = i;
|
||||
select.appendChild(option);
|
||||
}
|
||||
}
|
||||
|
||||
populateSelect('bitrate', 1024, 20480, 1024);
|
||||
populateSelect('txpower', 1, 58, 1);
|
||||
populateSelect('wfb_index', 0, 8, 1);
|
||||
populateSelect('tun_index', 0, 8, 1);
|
||||
|
||||
loadYAML('/etc/majestic.yaml', (data) => {
|
||||
configData.majestic = data;
|
||||
syncForm(configData.majestic, 'majestic', "setup");
|
||||
});
|
||||
|
||||
loadYAML('/etc/wfb.yaml', (data) => {
|
||||
configData.wfb = data;
|
||||
syncForm(configData.wfb, 'wfb', "setup");
|
||||
});
|
|
@ -0,0 +1,105 @@
|
|||
body {
|
||||
font-family: Helvetica;
|
||||
background-color: #1e1e1e;
|
||||
color: #dcdcdc;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
header {
|
||||
background-color: #252526;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 2px 10px #00000080;
|
||||
color: white;
|
||||
padding: 15px 0;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 1.5rem;
|
||||
margin-top: 1rem;
|
||||
color: #dee2e6bf;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.form-section {
|
||||
background-color: #2d2d2d;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 2px 10px #00000080;
|
||||
max-width: 40%;
|
||||
padding: 20px;
|
||||
margin: 20px auto;
|
||||
}
|
||||
|
||||
.form-section label {
|
||||
display: inline-block;
|
||||
font-weight: bold;
|
||||
margin: 10px 0 5px;
|
||||
width: 150px;
|
||||
vertical-align: top;
|
||||
color: #dee2e6;
|
||||
}
|
||||
|
||||
.form-section select {
|
||||
width: 120px;
|
||||
padding: 10px;
|
||||
margin-bottom: 15px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #555;
|
||||
background-color: #3c3c3c;
|
||||
color: #dcdcdc;
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.form-section input {
|
||||
width: 120px;
|
||||
height: 25px;
|
||||
}
|
||||
|
||||
.button-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.form-section button {
|
||||
width: 160px;
|
||||
padding: 10px;
|
||||
margin: 10px;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font-size: 1rem;
|
||||
color: white;
|
||||
box-shadow: 0 2px 10px #00000040;
|
||||
}
|
||||
|
||||
#apply-video-button, #apply-wfb-button {
|
||||
background-color: #0d4aa5;
|
||||
}
|
||||
|
||||
#apply-video-button:hover, #apply-wfb-button:hover {
|
||||
background-color: #115fd4;
|
||||
}
|
||||
|
||||
#reset-video-button, #reset-wfb-button {
|
||||
background-color: #a11212;
|
||||
}
|
||||
|
||||
#reset-video-button:hover, #reset-wfb-button:hover {
|
||||
background-color: #cf1717;
|
||||
}
|
||||
|
||||
#preview {
|
||||
width: 100%;
|
||||
max-width: 1200px;
|
||||
background-color: #000;
|
||||
box-shadow: 0 2px 10px #00000080;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.row {
|
||||
margin-bottom: 15px;
|
||||
}
|
Loading…
Reference in New Issue