mirror of https://github.com/OpenIPC/firmware.git
Merge branch 'master' of github2:OpenIPC/firmware
commit
60212f0f15
|
|
@ -49,6 +49,7 @@ jobs:
|
|||
- {"platform": "ssc30kq", "release": "lite"}
|
||||
- {"platform": "ssc30kq", "release": "ultimate"}
|
||||
- {"platform": "ssc338q", "release": "fpv"}
|
||||
- {"platform": "ssc338q", "release": "fpvdev"}
|
||||
- {"platform": "ssc338q", "release": "rubyfpv"}
|
||||
- {"platform": "ssc338q", "release": "lite"}
|
||||
- {"platform": "ssc338q", "release": "ultimate"}
|
||||
|
|
|
|||
|
|
@ -2423,7 +2423,7 @@ CONFIG_SQUASHFS_DECOMP_SINGLE=y
|
|||
CONFIG_SQUASHFS_XZ=y
|
||||
# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set
|
||||
# CONFIG_SQUASHFS_EMBEDDED is not set
|
||||
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
|
||||
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=1
|
||||
# CONFIG_VXFS_FS is not set
|
||||
# CONFIG_MINIX_FS is not set
|
||||
# CONFIG_OMFS_FS is not set
|
||||
|
|
|
|||
|
|
@ -2425,7 +2425,7 @@ CONFIG_SQUASHFS_DECOMP_SINGLE=y
|
|||
CONFIG_SQUASHFS_XZ=y
|
||||
# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set
|
||||
# CONFIG_SQUASHFS_EMBEDDED is not set
|
||||
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
|
||||
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=1
|
||||
# CONFIG_VXFS_FS is not set
|
||||
# CONFIG_MINIX_FS is not set
|
||||
# CONFIG_OMFS_FS is not set
|
||||
|
|
|
|||
|
|
@ -0,0 +1,71 @@
|
|||
# Architecture
|
||||
BR2_arm=y
|
||||
BR2_cortex_a7=y
|
||||
BR2_ARM_FPU_NEON_VFPV4=y
|
||||
BR2_ARM_INSTRUCTIONS_THUMB2=y
|
||||
|
||||
# Toolchain
|
||||
BR2_TOOLCHAIN_EXTERNAL=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_URL="https://github.com/openipc/firmware/releases/download/$(OPENIPC_TOOLCHAIN).tgz"
|
||||
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="arm-openipc-linux-gnueabihf"
|
||||
BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_9=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y
|
||||
# BR2_TOOLCHAIN_EXTERNAL_INET_RPC is not set
|
||||
BR2_TOOLCHAIN_EXTERNAL_CXX=y
|
||||
|
||||
# Kernel
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/openipc/linux/archive/$(OPENIPC_KERNEL).tar.gz"
|
||||
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(EXTERNAL_VENDOR)/board/$(OPENIPC_SOC_FAMILY)/infinity6e-ssc012b.config"
|
||||
BR2_LINUX_KERNEL_UIMAGE=y
|
||||
BR2_LINUX_KERNEL_XZ=y
|
||||
|
||||
# Filesystem
|
||||
BR2_PACKAGE_BUSYBOX_CONFIG="$(BR2_EXTERNAL)/package/busybox/busybox.config"
|
||||
BR2_PACKAGE_EXFATPROGS=y
|
||||
BR2_PACKAGE_UBOOT_TOOLS=y
|
||||
BR2_PACKAGE_ZLIB=y
|
||||
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
|
||||
BR2_PACKAGE_WIRELESS_TOOLS=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT=y
|
||||
BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y
|
||||
BR2_TARGET_ROOTFS_CPIO=y
|
||||
BR2_TARGET_ROOTFS_SQUASHFS=y
|
||||
BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y
|
||||
|
||||
# OpenIPC
|
||||
BR2_OPENIPC_SOC_VENDOR="sigmastar"
|
||||
BR2_OPENIPC_SOC_MODEL="ssc338q"
|
||||
BR2_OPENIPC_SOC_FAMILY="infinity6e"
|
||||
BR2_OPENIPC_VARIANT="fpvdev"
|
||||
BR2_OPENIPC_FLASH_SIZE="16"
|
||||
|
||||
# Packages
|
||||
BR2_PACKAGE_DROPBEAR_OPENIPC=y
|
||||
BR2_PACKAGE_EXFAT_OPENIPC=y
|
||||
BR2_PACKAGE_IPCTOOL=y
|
||||
BR2_PACKAGE_JSONFILTER=y
|
||||
BR2_PACKAGE_LIBCURL_OPENIPC=y
|
||||
BR2_PACKAGE_LIBCURL_OPENIPC_CURL=y
|
||||
# BR2_PACKAGE_LIBCURL_OPENIPC_PROXY_SUPPORT is not set
|
||||
# BR2_PACKAGE_LIBCURL_OPENIPC_COOKIES_SUPPORT is not set
|
||||
# BR2_PACKAGE_LIBCURL_OPENIPC_EXTRA_PROTOCOLS_FEATURES is not set
|
||||
BR2_PACKAGE_LIBOGG_OPENIPC=y
|
||||
BR2_PACKAGE_MAJESTIC_FONTS=y
|
||||
BR2_PACKAGE_MAJESTIC_WEBUI=y
|
||||
BR2_PACKAGE_MAJESTIC=y
|
||||
BR2_PACKAGE_MAVFWD=y
|
||||
BR2_PACKAGE_MBEDTLS_OPENIPC=y
|
||||
BR2_PACKAGE_MSPOSD=y
|
||||
BR2_PACKAGE_OPUS_OPENIPC=y
|
||||
BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y
|
||||
BR2_PACKAGE_RTL8733BU_OPENIPC=y
|
||||
BR2_PACKAGE_RTL8812AU_OPENIPC=y
|
||||
BR2_PACKAGE_SIGMASTAR_OSDRV_INFINITY6E=y
|
||||
BR2_PACKAGE_VTUND_OPENIPC=y
|
||||
BR2_PACKAGE_WIFIBROADCAST_NG=y
|
||||
BR2_PACKAGE_YAML_CLI=y
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
# OpenIPC.org | 2024
|
||||
#
|
||||
|
||||
scr_version=1.0.42
|
||||
scr_version=1.0.43
|
||||
|
||||
args=" $@"
|
||||
|
||||
|
|
@ -229,7 +229,7 @@ Where:
|
|||
--force_md5 Do not validate MD5 hash.
|
||||
--force_soc Do not validate processor.
|
||||
--force_ver Do not validate release version.
|
||||
--force_all Do not validate anything.
|
||||
-f, --force_all Do not validate anything.
|
||||
-n, --wipe_overlay Wipe overlay partition.
|
||||
-x, --no_reboot Do not reboot after updating.
|
||||
-z, --no_update Do not update self.
|
||||
|
|
@ -252,7 +252,7 @@ reboot_system() {
|
|||
|
||||
for i in "$@"; do
|
||||
case $i in
|
||||
--force_all)
|
||||
-f | --force_all)
|
||||
skip_md5=1
|
||||
skip_soc=1
|
||||
skip_ver=1
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ insert_ko() {
|
|||
insmod gk7205v200_sys.ko
|
||||
# insmod gk7205v200_tde.ko
|
||||
insmod gk7205v200_rgn.ko
|
||||
insmod gk7205v200_vgs.ko
|
||||
insmod gk7205v200_vgs.ko max_vgs_job=20 max_vgs_node=20 max_vgs_task=20
|
||||
insmod gk7205v200_vi.ko
|
||||
insert_isp
|
||||
insmod gk7205v200_vpss.ko
|
||||
|
|
@ -179,7 +179,7 @@ insert_ko() {
|
|||
insmod gk7205v200_chnl.ko
|
||||
insmod gk7205v200_vedu.ko
|
||||
insmod gk7205v200_rc.ko
|
||||
insmod gk7205v200_venc.ko
|
||||
insmod gk7205v200_venc.ko VencMaxChnNum=3
|
||||
insmod gk7205v200_h264e.ko
|
||||
insmod gk7205v200_h265e.ko
|
||||
insmod gk7205v200_jpege.ko
|
||||
|
|
|
|||
|
|
@ -0,0 +1,71 @@
|
|||
[sensor]
|
||||
Sensor_type=stSnsGc4023Obj
|
||||
Mode=WDR_MODE_NONE
|
||||
DllFile=libsns_gc4023.so
|
||||
|
||||
[mode]
|
||||
input_mode=INPUT_MODE_MIPI
|
||||
raw_bitness=10
|
||||
|
||||
[mipi]
|
||||
lane_id = 0|2|-1|-1|-1|-1|-1|-1| ;lane_id: -1 - disable
|
||||
|
||||
[isp_image]
|
||||
Isp_FrameRate=25
|
||||
Isp_Bayer=BAYER_RGGB
|
||||
|
||||
[vi_dev]
|
||||
Input_mod=VI_MODE_MIPI
|
||||
Work_mod = VI_WORK_MODE_1Multiplex
|
||||
Mask_num = 2
|
||||
Mask_0 = 0xFFC00000
|
||||
Mask_1 = 0x0
|
||||
Scan_mode = VI_SCAN_PROGRESSIVE
|
||||
Data_seq = VI_DATA_SEQ_YUYV
|
||||
Vsync =1 ; vertical synchronization signal
|
||||
;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 =2560 ;Horizontal effetive width
|
||||
Timingblank_HsyncHbb =0 ;Horizontal back blanking width
|
||||
Timingblank_VsyncVfb =0 ;Vertical front blanking height
|
||||
Timingblank_VsyncVact =1440 ;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)
|
||||
InputDataType=1 ;VI_DATA_TYPE_YUV = 0,VI_DATA_TYPE_RGB = 1,
|
||||
DataRev =FALSE ;Data reverse. FALSE = 0; TRUE = 1
|
||||
DevRect_w=2560
|
||||
DevRect_h=1440
|
||||
DevRect_x=0
|
||||
DevRect_y=0
|
||||
|
||||
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 */
|
||||
[vi_chn]
|
||||
int_type=FRAME_INTERRUPT_EARLY_END_ONE_BUF
|
||||
early_line=1080
|
||||
vpss_lowdelay=true
|
||||
line_cnt=128
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
[sensor]
|
||||
Sensor_type=stSnsGc5603Obj
|
||||
Mode=WDR_MODE_NONE
|
||||
DllFile=libsns_gc5603.so
|
||||
|
||||
[mode]
|
||||
input_mode=INPUT_MODE_MIPI
|
||||
raw_bitness=10
|
||||
clock=27MHz
|
||||
|
||||
[mipi]
|
||||
lane_id = 0|1|-1|-1|-1|-1|-1|-1| ;lane_id: -1 - disable
|
||||
|
||||
[isp_image]
|
||||
Isp_FrameRate=25
|
||||
Isp_Bayer=BAYER_RGGB
|
||||
|
||||
[vi_dev]
|
||||
Input_mod=VI_MODE_MIPI
|
||||
Work_mod = VI_WORK_MODE_1Multiplex
|
||||
Mask_num = 2
|
||||
Mask_0 = 0xFFC00000
|
||||
Mask_1 = 0x0
|
||||
Scan_mode = VI_SCAN_PROGRESSIVE
|
||||
Data_seq = VI_DATA_SEQ_YUYV
|
||||
Vsync =1 ; vertical synchronization signal
|
||||
;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 =2880 ;Horizontal effetive width
|
||||
Timingblank_HsyncHbb =0 ;Horizontal back blanking width
|
||||
Timingblank_VsyncVfb =0 ;Vertical front blanking height
|
||||
Timingblank_VsyncVact =1620 ;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)
|
||||
InputDataType=1 ;VI_DATA_TYPE_YUV = 0,VI_DATA_TYPE_RGB = 1,
|
||||
DataRev =FALSE ;Data reverse. FALSE = 0; TRUE = 1
|
||||
DevRect_w=2880
|
||||
DevRect_h=1620
|
||||
DevRect_x=0
|
||||
DevRect_y=0
|
||||
|
||||
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 */
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
[sensor]
|
||||
Sensor_type=stSnsOs02g10Obj
|
||||
Mode=WDR_MODE_NONE
|
||||
DllFile=libsns_os02g10.so
|
||||
|
||||
[mode]
|
||||
input_mode=INPUT_MODE_MIPI
|
||||
raw_bitness=10
|
||||
|
||||
[mipi]
|
||||
lane_id = 0|2|-1|-1|-1|-1|-1|-1| ;lane_id: -1 - disable
|
||||
|
||||
[isp_image]
|
||||
Isp_FrameRate=25
|
||||
Isp_Bayer=BAYER_BGGR
|
||||
|
||||
[vi_dev]
|
||||
Input_mod=VI_MODE_MIPI
|
||||
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 =1920 ;Horizontal effetive width
|
||||
Timingblank_HsyncHbb =0 ;Horizontal back blanking width
|
||||
Timingblank_VsyncVfb =0 ;Vertical front blanking height
|
||||
Timingblank_VsyncVact =1080 ;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)
|
||||
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=1920
|
||||
DevRect_h=1080
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -173,7 +173,7 @@ insert_ko() {
|
|||
modprobe open_sys
|
||||
# modprobe open_tde
|
||||
modprobe open_rgn
|
||||
modprobe open_vgs
|
||||
modprobe open_vgs max_vgs_job=20 max_vgs_node=20 max_vgs_task=20
|
||||
modprobe open_vi
|
||||
insert_isp
|
||||
modprobe open_vpss
|
||||
|
|
@ -182,7 +182,7 @@ insert_ko() {
|
|||
modprobe open_chnl
|
||||
modprobe open_vedu
|
||||
modprobe open_rc
|
||||
modprobe open_venc
|
||||
modprobe open_venc VencMaxChnNum=3
|
||||
modprobe open_h264e
|
||||
modprobe open_h265e
|
||||
modprobe open_jpege
|
||||
|
|
|
|||
|
|
@ -4,9 +4,12 @@
|
|||
#
|
||||
################################################################################
|
||||
|
||||
MAJESTIC_PLUGINS_SITE = $(call github,openipc,majestic-plugins,$(MAJESTIC_PLUGINS_VERSION))
|
||||
MAJESTIC_PLUGINS_SITE_METHOD = git
|
||||
MAJESTIC_PLUGINS_SITE = https://github.com/openipc/majestic-plugins
|
||||
MAJESTIC_PLUGINS_VERSION = HEAD
|
||||
|
||||
MAJESTIC_PLUGINS_GIT_SUBMODULES = YES
|
||||
|
||||
define MAJESTIC_PLUGINS_BUILD_CMDS
|
||||
$(MAKE) CC=$(TARGET_CC) TARGET=$(OPENIPC_SOC_VENDOR) -C $(@D) -B
|
||||
endef
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
config BR2_PACKAGE_MAJESTIC
|
||||
bool "Majestic streamer"
|
||||
default n
|
||||
help
|
||||
Tiny but powerful IPC streaming software
|
||||
(non-commercial version for personal use only)
|
||||
|
|
|
|||
|
|
@ -5,9 +5,6 @@ PIDFILE="/var/run/$DAEMON.pid"
|
|||
DAEMON_ARGS="-s"
|
||||
|
||||
start() {
|
||||
ulimit -c unlimited
|
||||
echo "/tmp/core.majestic" > /proc/sys/kernel/core_pattern
|
||||
|
||||
echo -n "Starting $DAEMON: "
|
||||
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "$DAEMON" -- $DAEMON_ARGS
|
||||
if [ $? -eq 0 ]; then
|
||||
|
|
|
|||
|
|
@ -19,11 +19,6 @@ MAJESTIC_DEPENDENCIES += \
|
|||
opus-openipc \
|
||||
json-c
|
||||
|
||||
MAJESTIC_FILTER = hi3516ev200 gk7205v200 infinity6b0 infinity6e t31
|
||||
ifneq ($(filter $(MAJESTIC_FILTER),$(MAJESTIC_FAMILY)),)
|
||||
MAJESTIC_DEPENDENCIES += majestic-plugins
|
||||
endif
|
||||
|
||||
define MAJESTIC_INSTALL_TARGET_CMDS
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/etc
|
||||
$(INSTALL) -m 644 -t $(TARGET_DIR)/etc $(@D)/majestic.yaml
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
config BR2_PACKAGE_MAVFWD
|
||||
bool "mavfwd"
|
||||
default n
|
||||
select BR2_PACKAGE_LIBEVENT_OPENIPC
|
||||
select BR2_PACKAGE_DATALINK
|
||||
help
|
||||
mavfwd - Cool and awesome mavlink forwader for FPV
|
||||
Simple mavlink forwarder.
|
||||
|
||||
https://github.com/OpenIPC/mavfwd
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
config BR2_PACKAGE_MAVLINK_ROUTER
|
||||
bool "mavlink-router"
|
||||
select BR2_PACKAGE_DATALINK
|
||||
help
|
||||
MAVLink Router is an application to distribute MAVLink messages between multiple endpoints (connections). It distributes packets to a single port or multiple endpoints depending on the target address. Connections can be made via UART, UDP or TCP.
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
################################################################################
|
||||
|
||||
RTL8733BU_OPENIPC_SITE = $(call github,openipc,realtek-wlan,$(RTL8733BU_OPENIPC_VERSION))
|
||||
ifeq ($(OPENIPC_VARIANT),fpv)
|
||||
ifneq ($(findstring fpv,$(OPENIPC_VARIANT)),)
|
||||
RTL8733BU_OPENIPC_VERSION = rtl8733bu_fpv
|
||||
else
|
||||
RTL8733BU_OPENIPC_VERSION = rtl8733bu
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
config BR2_PACKAGE_RUBYFPV
|
||||
bool "rubyfpv"
|
||||
select BR2_PACKAGE_IW
|
||||
default n
|
||||
select BR2_PACKAGE_IW
|
||||
help
|
||||
Ruby package
|
||||
|
||||
|
|
|
|||
|
|
@ -6,24 +6,27 @@
|
|||
chip=$(ipcinfo -c)
|
||||
fw=$(grep "BUILD_OPTION" "/etc/os-release" | cut -d= -f2)
|
||||
echo "Chip: " > /tmp/ruby_boot.log
|
||||
echo ${chip} >> /tmp/ruby_boot.log
|
||||
echo "$chip" >> /tmp/ruby_boot.log
|
||||
echo "Firmware: " >> /tmp/ruby_boot.log
|
||||
echo ${fw} >> /tmp/ruby_boot.log
|
||||
echo "$fw" >> /tmp/ruby_boot.log
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
if ! [ -f /etc/system.ok ]; then
|
||||
tweaksys ${chip}
|
||||
fi
|
||||
start)
|
||||
if [ ! -f /etc/system.ok ]; then
|
||||
tweaksys "$chip"
|
||||
exit 0
|
||||
fi
|
||||
echo "Starting Ruby..." >> /tmp/ruby_boot.log
|
||||
/usr/sbin/ruby_start &
|
||||
;;
|
||||
|
||||
echo "Starting Ruby..." >> /tmp/ruby_boot.log
|
||||
/usr/sbin/ruby_start &
|
||||
;;
|
||||
stop)
|
||||
echo "Stopping Ruby..." >> /tmp/ruby_boot.log
|
||||
/usr/sbin/ruby_stop.sh
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop}"
|
||||
exit 1
|
||||
stop)
|
||||
echo "Stopping Ruby..." >> /tmp/ruby_boot.log
|
||||
/usr/sbin/ruby_stop.sh
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: $0 {start|stop}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
|
|
|||
|
|
@ -0,0 +1,187 @@
|
|||
#!/bin/sh
|
||||
chip=$(ipcinfo -c)
|
||||
family=$(ipcinfo -f)
|
||||
vendor=$(ipcinfo -v)
|
||||
|
||||
if [ ! "$chip" = "hi3536dv100" ]; then
|
||||
sensor=$(ipcinfo -s)
|
||||
fi
|
||||
|
||||
basic() {
|
||||
# set boot delay
|
||||
fw_setenv bootdelay 0
|
||||
|
||||
# free uart for telemetry
|
||||
sed -i "s!console::respawn:/sbin/getty -L console 0 vt100 # GENERIC_SERIAL!#console::respawn:/sbin/getty -L console 0 vt100 # GENERIC_SERIAL!g" /etc/inittab
|
||||
|
||||
# tune socket buffer
|
||||
echo "net.core.rmem_default=512000" >> /etc/sysctl.conf
|
||||
}
|
||||
|
||||
prefix=${family}
|
||||
|
||||
hisi_goke() {
|
||||
if [ "$vendor" = "hisilicon" ]; then
|
||||
prefix="open"
|
||||
fi
|
||||
|
||||
# remove unneeded modules
|
||||
sed -i "s!insmod ${prefix}_rgn.ko!#insmod ${prefix}_rgn.ko!g" "/usr/bin/load_${vendor}"
|
||||
sed -i "s!insmod ${prefix}_jpege.ko!#insmod ${prefix}_jpege.ko!g" "/usr/bin/load_${vendor}"
|
||||
sed -i "s!insmod ${prefix}_ive.ko save_power=0!#insmod ${prefix}_ive.ko save_power=0!g" "/usr/bin/load_${vendor}"
|
||||
sed -i "s!insmod ${prefix}_aio.ko!#insmod ${prefix}_aio.ko!g" "/usr/bin/load_${vendor}"
|
||||
sed -i "s!insmod ${prefix}_ai.ko!#insmod ${prefix}_ai.ko!g" "/usr/bin/load_${vendor}"
|
||||
sed -i "s!insmod ${prefix}_ao.ko!#insmod ${prefix}_ao.ko!g" "/usr/bin/load_${vendor}"
|
||||
sed -i "s!insmod ${prefix}_aenc.ko!#insmod ${prefix}_aenc.ko!g" "/usr/bin/load_${vendor}"
|
||||
sed -i "s!insmod ${prefix}_adec.ko!#insmod ${prefix}_adec.ko!g" "/usr/bin/load_${vendor}"
|
||||
sed -i "s!insmod ${prefix}_acodec.ko!#insmod ${prefix}_acodec.ko!g" "/usr/bin/load_${vendor}"
|
||||
|
||||
# change fps 25 -> 30
|
||||
sed -i "s!Isp_FrameRate=25!Isp_FrameRate=30!g" /etc/sensors/imx307_i2c_2l_1080p.ini
|
||||
sed -i "s!Isp_FrameRate=25!Isp_FrameRate=30!g" /etc/sensors/smtsec_imx307_i2c_4l_1080p.ini
|
||||
sed -i "s!Isp_FrameRate=25!Isp_FrameRate=30!g" /etc/sensors/imx335_i2c_4M.ini
|
||||
}
|
||||
|
||||
sigmastar() {
|
||||
sed -i "s!serial=/dev/ttyAMA0!serial=/dev/ttyS0!g" /etc/telemetry.conf
|
||||
sed -i "s!Device = /dev/ttyAMA0!Device = /dev/ttyS0!g" /etc/mavlink.conf
|
||||
}
|
||||
|
||||
majestic_generic() {
|
||||
# digital image stabilization
|
||||
#cli -s .isp.dis true
|
||||
|
||||
cli -s .isp.slowShutter disabled
|
||||
cli -s .image.contrast 50
|
||||
cli -s .image.luminance 50
|
||||
cli -s .video0.size 1920x1080
|
||||
cli -s .video0.fps 30
|
||||
cli -s .video0.bitrate 5120
|
||||
cli -s .video0.codec h264
|
||||
cli -s .video0.rcMode cbr
|
||||
cli -s .video0.gopSize 1.5
|
||||
|
||||
# lowdelay support only imx307 sensor
|
||||
if [ "$sensor" = "imx307" ]; then
|
||||
cli -s .isp.lowDelay true
|
||||
#cli -s .video0.sliceUnits 4
|
||||
fi
|
||||
|
||||
if [ "$sensor" = "imx335" ]; then
|
||||
cli -s .isp.drc 350
|
||||
cli -s .isp.sensorConfig /etc/sensors/imx335_i2c_4M.ini
|
||||
fi
|
||||
|
||||
cli -s .hls.enabled false
|
||||
cli -s .netip.enabled false
|
||||
cli -s .jpeg.enabled false
|
||||
}
|
||||
|
||||
majestic_sigmastar() {
|
||||
cli -s .isp.sensorConfig /etc/sensors/imx415_fpv.bin
|
||||
cli -s .isp.exposure 10
|
||||
cli -s .video0.codec h265
|
||||
cli -s .video0.size 1920x1080
|
||||
cli -s .video0.fps 60
|
||||
cli -s .video0.rcMode cbr
|
||||
cli -s .jpeg.enabled false
|
||||
}
|
||||
|
||||
streamer() {
|
||||
if [ -f /usr/bin/majestic ]; then
|
||||
if [ "$vendor" = "sigmastar" ]; then
|
||||
majestic_sigmastar
|
||||
else
|
||||
majestic_generic
|
||||
fi
|
||||
|
||||
# outgoing rtp stream
|
||||
cli -s .outgoing.enabled true
|
||||
cli -s .outgoing.server udp://127.0.0.1:5600
|
||||
fi
|
||||
|
||||
if [ -f /usr/bin/venc ]; then
|
||||
if [ "$sensor" = "imx335" ]; then
|
||||
sed -i "s!version=200_imx307B!version=300_imx335B!g" /etc/venc.conf
|
||||
sed -i "s!size=720p!size=1292x972!g" /etc/venc.conf
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
finish() {
|
||||
# complete tweaks and add flag
|
||||
fw_setenv wlandev
|
||||
touch /etc/system.ok
|
||||
echo "Restart system to apply fpv changes..."
|
||||
reboot
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
gk7205v200 | gk7205v210 | hi3516ev200)
|
||||
echo "Preparing system tweaks for ${chip}..."
|
||||
|
||||
# set custom config
|
||||
if [ "$chip" = "gk7205v200" ] && [ "$sensor" = "imx307" ]; then
|
||||
echo "switch to custom sensor config"
|
||||
#cli -s .isp.sensorConfig /etc/sensors/60fps/720p_imx307_i2c_2l.ini
|
||||
fi
|
||||
|
||||
# fix osmem in bootargs
|
||||
bootargs=$(fw_printenv -n bootargs)
|
||||
if echo "$bootargs" | grep -q "32M"; then
|
||||
newbootargs="mem=\${osmem} "$(echo "$bootargs" | cut -d " " -f2-)
|
||||
fw_setenv bootargs "$newbootargs"
|
||||
fw_setenv osmem 40M
|
||||
fi
|
||||
|
||||
# remove unneeded scripts
|
||||
rm -f /etc/init.d/S60crond /etc/init.d/S49ntpd /etc/init.d/S02klogd
|
||||
|
||||
basic
|
||||
hisi_goke
|
||||
streamer
|
||||
finish
|
||||
;;
|
||||
|
||||
gk7205v300 | hi3516ev300)
|
||||
echo "Preparing system tweaks for $chip..."
|
||||
|
||||
# increase osmem
|
||||
mem=$(fw_printenv -n osmem) && [ "$mem" = "32M" ] && fw_setenv osmem 64M && set_allocator cma || echo "Memory allocated for the system:" "$mem"
|
||||
|
||||
# set sensor config for smtsec board
|
||||
if [ "$chip" = "gk7205v300" ] && [ "$sensor" = "imx307" ]; then
|
||||
cli -s .isp.sensorConfig /etc/sensors/smtsec_imx307_i2c_4l_1080p.ini
|
||||
fi
|
||||
|
||||
basic
|
||||
hisi_goke
|
||||
streamer
|
||||
finish
|
||||
;;
|
||||
|
||||
t31l | t31n | t31x | t31zx)
|
||||
echo "Preparing system tweaks for $chip..."
|
||||
basic
|
||||
streamer
|
||||
finish
|
||||
;;
|
||||
|
||||
hi3536dv100)
|
||||
echo "Preparing system tweaks for $chip..."
|
||||
finish
|
||||
;;
|
||||
|
||||
ssc33x)
|
||||
echo "Preparing system tweaks for $chip..."
|
||||
basic
|
||||
sigmastar
|
||||
streamer
|
||||
finish
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: $0 {gk7205v200|gk7205v210|gk7205v300|hi3516ev200|hi3516ev300|t31l|t31n|t31x|t31zx|hi3536dv100|ssc33x}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
|
@ -1 +1 @@
|
|||
10.0
|
||||
10.2
|
||||
|
|
|
|||
|
|
@ -1,12 +1,18 @@
|
|||
################################################################################
|
||||
#
|
||||
# rubyfpv
|
||||
#
|
||||
################################################################################
|
||||
|
||||
RUBYFPV_SITE_METHOD = git
|
||||
RUBYFPV_SITE = https://github.com/PetruSoroaga/RubyFPV
|
||||
RUBYFPV_VERSION = 5ec137401ec338c9273e48a7cb9402d96010b9dd
|
||||
RUBYFPV_VERSION = f6bbc7725e0d635f993948c2888bbe0ce84f0e60
|
||||
|
||||
RUBYFPV_DEPENDENCIES += libpcap iw
|
||||
|
||||
RUBYFPV_MAKE_OPTS = \
|
||||
CC="$(TARGET_CC)" \
|
||||
CXX="$(TARGET_CXX)"
|
||||
CC="$(TARGET_CC)" \
|
||||
CXX="$(TARGET_CXX)"
|
||||
|
||||
define RUBYFPV_BUILD_CMDS
|
||||
$(MAKE) $(RUBYFPV_MAKE_OPTS) -C $(@D) vehicle RUBY_BUILD_ENV=openipc
|
||||
|
|
@ -16,6 +22,15 @@ define RUBYFPV_INSTALL_TARGET_CMDS
|
|||
$(INSTALL) -m 755 -d $(TARGET_DIR)/etc/init.d
|
||||
$(INSTALL) -m 755 -t $(TARGET_DIR)/etc/init.d $(RUBYFPV_PKGDIR)/files/S73ruby
|
||||
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/root/ruby/licenses
|
||||
$(INSTALL) -m 644 -t $(TARGET_DIR)/root/ruby/licenses $(@D)/licenses/*
|
||||
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/lib/firmware/ath9k_htc
|
||||
$(INSTALL) -m 644 -t $(TARGET_DIR)/lib/firmware/ath9k_htc $(RUBYFPV_PKGDIR)/files/htc_9271.fw.3
|
||||
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/usr/bin
|
||||
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/bin $(RUBYFPV_PKGDIR)/files/tweaksys
|
||||
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/usr/sbin
|
||||
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/sbin $(@D)/ruby_start
|
||||
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/sbin $(@D)/ruby_logger
|
||||
|
|
@ -23,14 +38,6 @@ define RUBYFPV_INSTALL_TARGET_CMDS
|
|||
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/sbin $(@D)/ruby_tx_telemetry
|
||||
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/sbin $(RUBYFPV_PKGDIR)/files/ruby_stop.sh
|
||||
$(INSTALL) -m 644 -t $(TARGET_DIR)/usr/sbin $(RUBYFPV_PKGDIR)/files/version_ruby_base.txt
|
||||
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/usr/bin
|
||||
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/bin $(DATALINK_PKGDIR)/files/tweaksys
|
||||
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/root/ruby/licenses
|
||||
$(INSTALL) -m 644 -t $(TARGET_DIR)/root/ruby/licenses $(@D)/licenses/*
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/lib/firmware/ath9k_htc
|
||||
cp $(RUBYFPV_PKGDIR)/files/htc_9271.fw.3 $(TARGET_DIR)/lib/firmware/ath9k_htc
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
|
|
|
|||
|
|
@ -0,0 +1,4 @@
|
|||
config BR2_PACKAGE_W1-DS18B20
|
||||
bool "w1-ds18b20"
|
||||
help
|
||||
OneWire DS18B20 GPIO bitbang app
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
# w1-ds18b20
|
||||
|
||||
This app allows reading ds18b20 sensors in bitbang mode using direct GPIO memory access.
|
||||
Currently supports only HiSilicon-style GPIO offsets. Pull-up resistor is required.
|
||||
|
||||
## Usage
|
||||
|
||||
Example: reading temperature using GPIO8_2 on Gk7205V300 (consult datasheet or ipctool output)
|
||||
|
||||
```
|
||||
# ./w1-ds18b20 -base 0x120B8000 -gpio 2
|
||||
28-4A4E3C1E64FF : 22.44 C
|
||||
```
|
||||
|
|
@ -0,0 +1,631 @@
|
|||
// Based on https://github.com/danjperron/BitBangingDS18B20.git
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <sched.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/mman.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int mem_fd;
|
||||
void *gpio_map;
|
||||
|
||||
unsigned short DS_PIN = 7;
|
||||
unsigned int GPIO_BASE = 0x120b6000;
|
||||
unsigned short ArgResolution = 0;
|
||||
unsigned short ArgScan = 0;
|
||||
unsigned short ArgWaitTime = 750;
|
||||
|
||||
// I/O access
|
||||
volatile unsigned *gpio;
|
||||
|
||||
|
||||
#define BLOCK_SIZE (4 * 1024)
|
||||
|
||||
#define OUT_GPIO(g) *(gpio + 0x400 / sizeof(*gpio)) |= (1 << g)
|
||||
#define INP_GPIO(g) *(gpio + 0x400 / sizeof(*gpio)) &= ~(1 << g)
|
||||
|
||||
#define GPIO_SET(n) (*(gpio + 0x3FC / sizeof(*gpio)) |= (1 << (n)))
|
||||
#define GPIO_CLR(n) (*(gpio + 0x3FC / sizeof(*gpio)) &= ~(1 << (n)))
|
||||
#define GPIO_READ(g) (((*(gpio + 0x3FC / sizeof(*gpio))) & (1 << (g))) >> (g))
|
||||
|
||||
#define DS18B20_SKIP_ROM 0xCC
|
||||
#define DS18B20_CONVERT_T 0x44
|
||||
#define DS18B20_MATCH_ROM 0x55
|
||||
#define DS18B20_SEARCH_ROM 0XF0
|
||||
#define DS18B20_READ_SCRATCHPAD 0xBE
|
||||
#define DS18B20_WRITE_SCRATCHPAD 0x4E
|
||||
#define DS18B20_COPY_SCRATCHPAD 0x48
|
||||
|
||||
unsigned char ScratchPad[9];
|
||||
double temperature;
|
||||
int resolution;
|
||||
|
||||
void setup_io();
|
||||
#define DELAY1US DelayMicrosecondsNoSleep(1);
|
||||
|
||||
void DelayMicrosecondsNoSleep(int delay_us) {
|
||||
long int start_time;
|
||||
long int time_difference;
|
||||
struct timespec gettime_now;
|
||||
|
||||
clock_gettime(CLOCK_REALTIME, &gettime_now);
|
||||
start_time = gettime_now.tv_nsec; // Get nS value
|
||||
while (1) {
|
||||
clock_gettime(CLOCK_REALTIME, &gettime_now);
|
||||
time_difference = gettime_now.tv_nsec - start_time;
|
||||
if (time_difference < 0)
|
||||
time_difference += 1000000000; //(Rolls over every 1 second)
|
||||
if (time_difference > (delay_us * 1000)) // Delay for # nS
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int DoReset(void) {
|
||||
INP_GPIO(DS_PIN);
|
||||
|
||||
DelayMicrosecondsNoSleep(10);
|
||||
|
||||
INP_GPIO(DS_PIN);
|
||||
OUT_GPIO(DS_PIN);
|
||||
|
||||
// pin low for 480 us
|
||||
GPIO_CLR(DS_PIN);
|
||||
usleep(480);
|
||||
INP_GPIO(DS_PIN);
|
||||
DelayMicrosecondsNoSleep(60);
|
||||
if (GPIO_READ(DS_PIN) == 0) {
|
||||
DelayMicrosecondsNoSleep(420);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void WriteByte(unsigned char value) {
|
||||
unsigned char Mask = 1;
|
||||
int loop;
|
||||
|
||||
for (loop = 0; loop < 8; loop++) {
|
||||
INP_GPIO(DS_PIN);
|
||||
OUT_GPIO(DS_PIN);
|
||||
GPIO_CLR(DS_PIN);
|
||||
|
||||
if ((value & Mask) != 0) {
|
||||
DELAY1US
|
||||
INP_GPIO(DS_PIN);
|
||||
DelayMicrosecondsNoSleep(60);
|
||||
|
||||
} else {
|
||||
DelayMicrosecondsNoSleep(60);
|
||||
INP_GPIO(DS_PIN);
|
||||
DelayMicrosecondsNoSleep(1);
|
||||
}
|
||||
Mask *= 2;
|
||||
DelayMicrosecondsNoSleep(60);
|
||||
}
|
||||
|
||||
usleep(100);
|
||||
}
|
||||
|
||||
void WriteBit(unsigned char value) {
|
||||
INP_GPIO(DS_PIN);
|
||||
OUT_GPIO(DS_PIN);
|
||||
GPIO_CLR(DS_PIN);
|
||||
if (value) {
|
||||
DELAY1US
|
||||
INP_GPIO(DS_PIN);
|
||||
DelayMicrosecondsNoSleep(60);
|
||||
} else {
|
||||
DelayMicrosecondsNoSleep(60);
|
||||
INP_GPIO(DS_PIN);
|
||||
DelayMicrosecondsNoSleep(1);
|
||||
}
|
||||
DelayMicrosecondsNoSleep(60);
|
||||
}
|
||||
|
||||
unsigned char ReadBit(void) {
|
||||
unsigned char rvalue = 0;
|
||||
INP_GPIO(DS_PIN);
|
||||
OUT_GPIO(DS_PIN);
|
||||
GPIO_CLR(DS_PIN);
|
||||
DELAY1US
|
||||
INP_GPIO(DS_PIN);
|
||||
DelayMicrosecondsNoSleep(2);
|
||||
if (GPIO_READ(DS_PIN) != 0)
|
||||
rvalue = 1;
|
||||
DelayMicrosecondsNoSleep(60);
|
||||
return rvalue;
|
||||
}
|
||||
|
||||
unsigned char ReadByte(void) {
|
||||
|
||||
unsigned char Mask = 1;
|
||||
int loop;
|
||||
unsigned char data = 0;
|
||||
|
||||
for (loop = 0; loop < 8; loop++) {
|
||||
INP_GPIO(DS_PIN);
|
||||
OUT_GPIO(DS_PIN);
|
||||
GPIO_CLR(DS_PIN);
|
||||
DELAY1US
|
||||
INP_GPIO(DS_PIN);
|
||||
// Wait 2 us
|
||||
DelayMicrosecondsNoSleep(2);
|
||||
if (GPIO_READ(DS_PIN) != 0)
|
||||
data |= Mask;
|
||||
Mask *= 2;
|
||||
DelayMicrosecondsNoSleep(60);
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
int ReadScratchPad(void) {
|
||||
int loop;
|
||||
|
||||
WriteByte(DS18B20_READ_SCRATCHPAD);
|
||||
for (loop = 0; loop < 9; loop++) {
|
||||
ScratchPad[loop] = ReadByte();
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
unsigned char CalcCRC(unsigned char *data, unsigned char byteSize) {
|
||||
unsigned char shift_register = 0;
|
||||
unsigned char loop, loop2;
|
||||
char DataByte;
|
||||
|
||||
for (loop = 0; loop < byteSize; loop++) {
|
||||
DataByte = *(data + loop);
|
||||
for (loop2 = 0; loop2 < 8; loop2++) {
|
||||
if ((shift_register ^ DataByte) & 1) {
|
||||
shift_register = shift_register >> 1;
|
||||
shift_register ^= 0x8C;
|
||||
} else
|
||||
shift_register = shift_register >> 1;
|
||||
DataByte = DataByte >> 1;
|
||||
}
|
||||
}
|
||||
return shift_register;
|
||||
}
|
||||
|
||||
char IDGetBit(unsigned long long *llvalue, char bit) {
|
||||
unsigned long long Mask = 1ULL << bit;
|
||||
|
||||
return ((*llvalue & Mask) ? 1 : 0);
|
||||
}
|
||||
|
||||
unsigned long long IDSetBit(unsigned long long *llvalue, char bit,
|
||||
unsigned char newValue) {
|
||||
unsigned long long Mask = 1ULL << bit;
|
||||
|
||||
if ((bit >= 0) && (bit < 64)) {
|
||||
if (newValue == 0)
|
||||
*llvalue &= ~Mask;
|
||||
else
|
||||
*llvalue |= Mask;
|
||||
}
|
||||
return *llvalue;
|
||||
}
|
||||
|
||||
void SelectSensor(unsigned long long ID) {
|
||||
int BitIndex;
|
||||
|
||||
WriteByte(DS18B20_MATCH_ROM);
|
||||
|
||||
for (BitIndex = 0; BitIndex < 64; BitIndex++)
|
||||
WriteBit(IDGetBit(&ID, BitIndex));
|
||||
}
|
||||
|
||||
int SearchSensor(unsigned long long *ID, int *LastBitChange) {
|
||||
int BitIndex;
|
||||
char Bit, NoBit;
|
||||
|
||||
if (*LastBitChange < 0)
|
||||
return 0;
|
||||
|
||||
// Set bit at LastBitChange Position to 1
|
||||
// Every bit after LastbitChange will be 0
|
||||
|
||||
if (*LastBitChange < 64) {
|
||||
|
||||
IDSetBit(ID, *LastBitChange, 1);
|
||||
for (BitIndex = *LastBitChange + 1; BitIndex < 64; BitIndex++)
|
||||
IDSetBit(ID, BitIndex, 0);
|
||||
}
|
||||
|
||||
*LastBitChange = -1;
|
||||
|
||||
if (!DoReset())
|
||||
return -1;
|
||||
|
||||
WriteByte(DS18B20_SEARCH_ROM);
|
||||
|
||||
for (BitIndex = 0; BitIndex < 64; BitIndex++) {
|
||||
|
||||
NoBit = ReadBit();
|
||||
Bit = ReadBit();
|
||||
|
||||
if (Bit && NoBit)
|
||||
return -2;
|
||||
|
||||
if (!Bit && !NoBit) {
|
||||
// ok 2 possibilities
|
||||
if (IDGetBit(ID, BitIndex)) {
|
||||
// Bit High already set
|
||||
WriteBit(1);
|
||||
} else {
|
||||
// ok let's try LOW value first
|
||||
*LastBitChange = BitIndex;
|
||||
WriteBit(0);
|
||||
}
|
||||
} else if (!Bit) {
|
||||
WriteBit(1);
|
||||
IDSetBit(ID, BitIndex, 1);
|
||||
} else {
|
||||
WriteBit(0);
|
||||
IDSetBit(ID, BitIndex, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int ReadSensor(unsigned long long ID) {
|
||||
int RetryCount;
|
||||
unsigned char CRCByte;
|
||||
union {
|
||||
short SHORT;
|
||||
unsigned char CHAR[2];
|
||||
} IntTemp;
|
||||
|
||||
temperature = -9999.9;
|
||||
|
||||
for (RetryCount = 0; RetryCount < 10; RetryCount++) {
|
||||
|
||||
if (!DoReset())
|
||||
continue;
|
||||
|
||||
// start a conversion
|
||||
SelectSensor(ID);
|
||||
|
||||
if (!ReadScratchPad())
|
||||
continue;
|
||||
|
||||
// OK Check sum Check;
|
||||
CRCByte = CalcCRC(ScratchPad, 8);
|
||||
|
||||
if (CRCByte != ScratchPad[8])
|
||||
continue;
|
||||
|
||||
// Check Resolution
|
||||
resolution = 0;
|
||||
switch (ScratchPad[4]) {
|
||||
|
||||
case 0x1f:
|
||||
resolution = 9;
|
||||
break;
|
||||
case 0x3f:
|
||||
resolution = 10;
|
||||
break;
|
||||
case 0x5f:
|
||||
resolution = 11;
|
||||
break;
|
||||
case 0x7f:
|
||||
resolution = 12;
|
||||
break;
|
||||
}
|
||||
|
||||
if (resolution == 0)
|
||||
continue;
|
||||
// Read Temperature
|
||||
IntTemp.CHAR[0] = ScratchPad[0];
|
||||
IntTemp.CHAR[1] = ScratchPad[1];
|
||||
|
||||
temperature = 0.0625 * (double)IntTemp.SHORT;
|
||||
|
||||
ID &= 0x00FFFFFFFFFFFFFFULL;
|
||||
printf("%02llX-%012llX : ", ID & 0xFFULL, ID >> 8);
|
||||
|
||||
// printf("%02d bits Temperature: %6.2f +/- %4.2f C\n", resolution,
|
||||
// temperature, 0.0625 * (double)(1 << (12 - resolution)));
|
||||
printf("%6.2f C\n", temperature);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int GlobalStartConversion(void) {
|
||||
int retry = 0;
|
||||
int maxloop;
|
||||
|
||||
while (retry < 10) {
|
||||
if (!DoReset())
|
||||
usleep(10000);
|
||||
else {
|
||||
WriteByte(DS18B20_SKIP_ROM);
|
||||
WriteByte(DS18B20_CONVERT_T);
|
||||
maxloop = 0;
|
||||
|
||||
#define USE_CONSTANT_DELAY
|
||||
#ifdef USE_CONSTANT_DELAY
|
||||
usleep(ArgWaitTime * 1000);
|
||||
return 1;
|
||||
#else
|
||||
// wait until ready
|
||||
while (!ReadBit()) {
|
||||
maxloop++;
|
||||
if (maxloop > 100000)
|
||||
break;
|
||||
}
|
||||
|
||||
if (maxloop <= 100000)
|
||||
return 1;
|
||||
#endif
|
||||
}
|
||||
retry++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void WriteScratchPad(unsigned char TH, unsigned char TL, unsigned char config) {
|
||||
|
||||
// First reset device
|
||||
DoReset();
|
||||
|
||||
usleep(10);
|
||||
// Skip ROM command
|
||||
WriteByte(DS18B20_SKIP_ROM);
|
||||
|
||||
// Write Scratch pad
|
||||
WriteByte(DS18B20_WRITE_SCRATCHPAD);
|
||||
|
||||
// Write TH
|
||||
WriteByte(TH);
|
||||
|
||||
// Write TL
|
||||
WriteByte(TL);
|
||||
|
||||
// Write config
|
||||
WriteByte(config);
|
||||
}
|
||||
|
||||
void CopyScratchPad(void) {
|
||||
|
||||
// Reset device
|
||||
DoReset();
|
||||
usleep(1000);
|
||||
|
||||
// Skip ROM Command
|
||||
WriteByte(DS18B20_SKIP_ROM);
|
||||
|
||||
// copy scratch pad
|
||||
WriteByte(DS18B20_COPY_SCRATCHPAD);
|
||||
usleep(100000);
|
||||
}
|
||||
|
||||
void ChangeSensorsResolution(int resolution) {
|
||||
int config = 0;
|
||||
|
||||
switch (resolution) {
|
||||
case 9:
|
||||
config = 0x1f;
|
||||
break;
|
||||
case 10:
|
||||
config = 0x3f;
|
||||
break;
|
||||
case 11:
|
||||
config = 0x5f;
|
||||
break;
|
||||
default:
|
||||
config = 0x7f;
|
||||
break;
|
||||
}
|
||||
WriteScratchPad(0xff, 0xff, config);
|
||||
usleep(1000);
|
||||
CopyScratchPad();
|
||||
}
|
||||
|
||||
void ScanForSensor(void) {
|
||||
unsigned long long ID = 0ULL;
|
||||
int NextBit = 64;
|
||||
int _NextBit;
|
||||
int rcode;
|
||||
int retry = 0;
|
||||
unsigned long long _ID;
|
||||
unsigned char _ID_CRC;
|
||||
unsigned char _ID_Calc_CRC;
|
||||
// unsigned char _ID_Family;
|
||||
|
||||
while (retry < 10) {
|
||||
_ID = ID;
|
||||
_NextBit = NextBit;
|
||||
rcode = SearchSensor(&_ID, &_NextBit);
|
||||
if (rcode == 1) {
|
||||
_ID_CRC = (unsigned char)(_ID >> 56);
|
||||
_ID_Calc_CRC = CalcCRC((unsigned char *)&_ID, 7);
|
||||
if (_ID_CRC == _ID_Calc_CRC) {
|
||||
if (ArgScan == 0) {
|
||||
if (ReadSensor(_ID)) {
|
||||
ID = _ID;
|
||||
NextBit = _NextBit;
|
||||
retry = 0;
|
||||
} else
|
||||
retry = 0;
|
||||
} else {
|
||||
ID = _ID;
|
||||
NextBit = _NextBit;
|
||||
printf("%016llX\n", ID);
|
||||
}
|
||||
} else
|
||||
retry++;
|
||||
} else if (rcode == 0)
|
||||
break;
|
||||
else
|
||||
retry++;
|
||||
}
|
||||
}
|
||||
|
||||
void PrintUsage(char *app) {
|
||||
fprintf(stderr, "usage :\n\n\t");
|
||||
fprintf(stderr, "%s -base 0x -gpio n [-xbits] [-s] [-t delay]\n\n", app);
|
||||
fprintf(stderr, " -base 0xn -> n specify the GPIO group base address\n");
|
||||
fprintf(stderr,
|
||||
" -gpio n -> n specify the GPIO number in group [0-7]\n");
|
||||
fprintf(
|
||||
stderr,
|
||||
" -xbits -> x set the number of bits -9bits,-10bits,-11bits and "
|
||||
"-12bits\n");
|
||||
fprintf(
|
||||
stderr,
|
||||
" -t delay -> delay is the time in ms to wait after conversion\n");
|
||||
fprintf(stderr, " -s -> Scan for sensor\n");
|
||||
}
|
||||
|
||||
int DecodeArg(int argc, char **argv) {
|
||||
|
||||
int idx = 1;
|
||||
|
||||
if (argc == 1) {
|
||||
PrintUsage(argv[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
while (idx < argc) {
|
||||
if (strstr(argv[idx], "help") != NULL) {
|
||||
PrintUsage(argv[0]);
|
||||
return 0;
|
||||
}
|
||||
if (strcmp(argv[idx], "-base") == 0)
|
||||
sscanf(argv[++idx], "%x", &GPIO_BASE);
|
||||
else if (strcmp(argv[idx], "-gpio") == 0)
|
||||
DS_PIN = atoi(argv[++idx]);
|
||||
else if (strcmp(argv[idx], "-9bits") == 0)
|
||||
ArgResolution = 9;
|
||||
else if (strcmp(argv[idx], "-10bits") == 0)
|
||||
ArgResolution = 10;
|
||||
else if (strcmp(argv[idx], "-11bits") == 0)
|
||||
ArgResolution = 11;
|
||||
else if (strcmp(argv[idx], "-12bits") == 0)
|
||||
ArgResolution = 12;
|
||||
else if (strcmp(argv[idx], "-s") == 0)
|
||||
ArgScan = 1;
|
||||
else if (strcmp(argv[idx], "-t") == 0)
|
||||
ArgWaitTime = atoi(argv[++idx]);
|
||||
else {
|
||||
fprintf(stderr, "Unknown argument %s! ", argv[idx]);
|
||||
exit(0);
|
||||
}
|
||||
idx++;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
void set_max_priority(void) {
|
||||
struct sched_param sched;
|
||||
memset(&sched, 0, sizeof(sched));
|
||||
// Use FIFO scheduler with highest priority for the lowest chance of the
|
||||
// kernel context switching.
|
||||
sched.sched_priority = sched_get_priority_max(SCHED_FIFO);
|
||||
sched_setscheduler(0, SCHED_FIFO, &sched);
|
||||
}
|
||||
|
||||
void set_default_priority(void) {
|
||||
struct sched_param sched;
|
||||
memset(&sched, 0, sizeof(sched));
|
||||
// Go back to default scheduler with default 0 priority.
|
||||
sched.sched_priority = 0;
|
||||
sched_setscheduler(0, SCHED_OTHER, &sched);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
int loop;
|
||||
int Flag = 0;
|
||||
|
||||
if (DecodeArg(argc, argv) == 0)
|
||||
return 0;
|
||||
|
||||
setup_io();
|
||||
|
||||
// Check for pull up resistor
|
||||
// Signal input should be high
|
||||
|
||||
// Set PIN to INPUT MODE
|
||||
INP_GPIO(DS_PIN);
|
||||
|
||||
Flag = 0;
|
||||
for (loop = 0; loop < 100; loop++) {
|
||||
usleep(1000);
|
||||
if (GPIO_READ(DS_PIN) != 0) {
|
||||
Flag = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (Flag == 0) {
|
||||
fprintf(stderr, "*** Error Unable to detect HIGH level. No pull-up resistor ?\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (ArgResolution > 0) {
|
||||
// need to change resolution
|
||||
ChangeSensorsResolution(ArgResolution);
|
||||
// do it twice just in case
|
||||
ChangeSensorsResolution(ArgResolution);
|
||||
}
|
||||
|
||||
if (GlobalStartConversion() == 0) {
|
||||
fprintf(stderr, "*** Error Unable to detect any DS18B20 sensor\n");
|
||||
exit(-2);
|
||||
}
|
||||
|
||||
set_max_priority();
|
||||
|
||||
ScanForSensor();
|
||||
|
||||
set_default_priority();
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
void setup_io() {
|
||||
#ifdef USE_GPIOLIB
|
||||
|
||||
#else
|
||||
/* open /dev/mem */
|
||||
if ((mem_fd = open("/dev/mem", O_RDWR | O_SYNC)) < 0) {
|
||||
fprintf(stderr, "can't open /dev/mem \n");
|
||||
exit(-1);
|
||||
}
|
||||
/* mmap GPIO */
|
||||
gpio_map =
|
||||
mmap(NULL, // Any adddress in our space will do
|
||||
BLOCK_SIZE, // Map length
|
||||
PROT_READ | PROT_WRITE, // Enable reading & writting to mapped memory
|
||||
MAP_SHARED, // Shared with other processes
|
||||
mem_fd, // File to map
|
||||
GPIO_BASE // Offset to GPIO peripheral
|
||||
);
|
||||
#endif
|
||||
|
||||
#ifdef USE_GPIOLIB
|
||||
|
||||
#else
|
||||
close(mem_fd); // No need to keep mem_fd open after mmap
|
||||
|
||||
if (gpio_map == MAP_FAILED) {
|
||||
fprintf(stderr, "mmap error gpio_map=%p\n", gpio_map); // errno also set!
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
// Always use volatile pointer!
|
||||
gpio = (volatile unsigned *)gpio_map;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
################################################################################
|
||||
#
|
||||
# w1-ds18b20
|
||||
#
|
||||
################################################################################
|
||||
|
||||
W1-DS18B20_SITE_METHOD = local
|
||||
W1-DS18B20_SITE = $(W1-DS18B20_PKGDIR)/src
|
||||
|
||||
W1-DS18B20_LICENSE = MIT
|
||||
W1-DS18B20_LICENSE_FILES = LICENSE
|
||||
|
||||
define W1-DS18B20_BUILD_CMDS
|
||||
$(TARGET_CC) $(@D)/w1-ds18b20.c -o $(@D)/w1-ds18b20 -Os -s
|
||||
endef
|
||||
|
||||
define W1-DS18B20_INSTALL_TARGET_CMDS
|
||||
$(INSTALL) -m 0755 -t $(TARGET_DIR)/usr/bin $(@D)/w1-ds18b20
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
config BR2_PACKAGE_WIFIBROADCAST_NG
|
||||
bool "wifibroadcast-ng"
|
||||
select BR2_PACKAGE_IW
|
||||
help
|
||||
Long-range packet radio link based on raw WiFi radio.
|
||||
https://github.com/svpcom/wfb-ng
|
||||
|
|
|
|||
|
|
@ -1,31 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
finish() {
|
||||
touch /etc/system.ok
|
||||
echo "Restart system to apply fpv changes..."
|
||||
reboot
|
||||
}
|
||||
|
||||
sigmastar() {
|
||||
cli -s .isp.sensorConfig /etc/sensors/imx415_fpv.bin
|
||||
cli -s .isp.exposure 5
|
||||
cli -s .video0.codec h265
|
||||
cli -s .video0.size 1920x1080
|
||||
cli -s .video0.fps 90
|
||||
cli -s .video0.rcMode cbr
|
||||
cli -s .jpeg.enabled false
|
||||
cli -s .outgoing.enabled true
|
||||
cli -s .outgoing.server udp://0.0.0.0:5600
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
ssc33x)
|
||||
sigmastar
|
||||
finish
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: $0 {ssc33x}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
#!/bin/sh
|
||||
yaml-cli -i /etc/wfb.yaml "$@"
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
# Broadcast
|
||||
wlan=wlan0
|
||||
region=00
|
||||
channel=161
|
||||
txpower=1
|
||||
driver_txpower_override=1
|
||||
bandwidth=20
|
||||
stbc=0
|
||||
ldpc=0
|
||||
mcs_index=1
|
||||
stream=0
|
||||
link_id=7669206
|
||||
rcv_buf=456000
|
||||
fec_k=8
|
||||
fec_n=12
|
||||
|
||||
# Telemetry
|
||||
router=2
|
||||
serial=/dev/ttyS2
|
||||
baud=115200
|
||||
channels=8
|
||||
fps=20
|
||||
port_rx=14551
|
||||
port_tx=14555
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
wireless:
|
||||
txpower: 1
|
||||
region: 00
|
||||
channel: 161
|
||||
mode: HT20
|
||||
broadcast:
|
||||
index: 1
|
||||
fec_k: 8
|
||||
fec_n: 12
|
||||
link_id: 7669206
|
||||
telemetry:
|
||||
index: 1
|
||||
router: msposd
|
||||
serial: /dev/ttyS2
|
||||
osd_fps: 20
|
||||
port_rx: 14551
|
||||
port_tx: 14555
|
||||
|
|
@ -1,65 +1,110 @@
|
|||
#!/bin/sh
|
||||
wfb_soc=$(ipcinfo -c)
|
||||
wfb_key=/etc/drone.key
|
||||
wfb_dev=wlan0
|
||||
|
||||
if [ -e /etc/wfb.conf ]; then
|
||||
. /etc/wfb.conf
|
||||
else
|
||||
echo "Configuration file not found"
|
||||
exit 1
|
||||
fi
|
||||
wfb_yaml() {
|
||||
if [ -e /etc/wfb.yaml ]; then
|
||||
if [ "$1" = "b" ]; then
|
||||
config=broadcast
|
||||
elif [ "$1" = "t" ]; then
|
||||
config=telemetry
|
||||
elif [ "$1" = "w" ]; then
|
||||
config=wireless
|
||||
fi
|
||||
value=$(wfb-cli -g ".$config.$2")
|
||||
fi
|
||||
|
||||
eval "$1_$2=${value:-$3}"
|
||||
}
|
||||
|
||||
load_config() {
|
||||
wfb_yaml w txpower 1
|
||||
wfb_yaml w region 00
|
||||
wfb_yaml w channel 161
|
||||
wfb_yaml w mode HT20
|
||||
|
||||
wfb_yaml b index 1
|
||||
wfb_yaml b fec_k 8
|
||||
wfb_yaml b fec_n 12
|
||||
wfb_yaml b link_id 7669206
|
||||
|
||||
wfb_yaml t index 1
|
||||
wfb_yaml t router msposd
|
||||
wfb_yaml t serial /dev/ttyS2
|
||||
wfb_yaml t osd_fps 20
|
||||
wfb_yaml t port_rx 14551
|
||||
wfb_yaml t port_tx 14555
|
||||
}
|
||||
|
||||
load_modules() {
|
||||
for card in $(lsusb | awk '{print $6}' | sort | uniq); do
|
||||
case "$card" in
|
||||
"0bda:8812" | "0bda:881a" | "0b05:17d2" | "2357:0101" | "2604:0012")
|
||||
driver="88XXau"
|
||||
modprobe 88XXau rtw_tx_pwr_idx_override="$driver_txpower_override"
|
||||
driver=88XXau
|
||||
modprobe "$driver"
|
||||
;;
|
||||
|
||||
"0bda:a81a")
|
||||
driver="8812eu"
|
||||
modprobe 8812eu rtw_regd_src=1 rtw_tx_pwr_by_rate=0 rtw_tx_pwr_lmt_enable=0
|
||||
driver=8812eu
|
||||
modprobe "$driver" rtw_regd_src=1 rtw_tx_pwr_by_rate=0 rtw_tx_pwr_lmt_enable=0
|
||||
;;
|
||||
|
||||
"0bda:f72b")
|
||||
driver="8733bu"
|
||||
modprobe 8733bu rtw_regd_src=1 rtw_tx_pwr_by_rate=0 rtw_tx_pwr_lmt_enable=0
|
||||
"0bda:f72b" | "0bda:b733")
|
||||
driver=8733bu
|
||||
modprobe "$driver" rtw_regd_src=1 rtw_tx_pwr_by_rate=0 rtw_tx_pwr_lmt_enable=0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$driver" ]; then
|
||||
echo "Wireless module not detected, check the usb connection"
|
||||
echo "- Wireless module not detected!"
|
||||
exit 1
|
||||
else
|
||||
echo "Detected driver: $driver"
|
||||
echo "- Detected driver: $driver"
|
||||
fi
|
||||
|
||||
if ! ifconfig "$wfb_dev" up; then
|
||||
echo "- Wireless driver not found!"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
load_interface() {
|
||||
ifconfig "$wlan" up
|
||||
iwconfig "$wlan" mode monitor
|
||||
iw "$wfb_dev" set monitor none
|
||||
iw "$wfb_dev" set channel "$w_channel" "$w_mode"
|
||||
iw reg set "$w_region"
|
||||
|
||||
if [ "$driver" = "8812eu" ] || [ "$driver" = "8733bu" ]; then
|
||||
iw dev "$wlan" set txpower fixed $((driver_txpower_override * 50))
|
||||
if [ "$driver" = "88XXau" ]; then
|
||||
iw "$wfb_dev" set txpower fixed $((w_txpower * -100))
|
||||
else
|
||||
iw "$wfb_dev" set txpower fixed $((w_txpower * 50))
|
||||
fi
|
||||
|
||||
iw reg set "$region"
|
||||
iwconfig "$wlan" channel "$channel"
|
||||
case "$w_mode" in
|
||||
"HT20")
|
||||
bandwidth=20
|
||||
;;
|
||||
"HT40+" | "HT40-")
|
||||
bandwidth=40
|
||||
;;
|
||||
"80Mhz")
|
||||
bandwidth=80
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
start_wfb() {
|
||||
echo "Starting wfb_tx"
|
||||
wfb_tx -p "$stream" -R "$rcv_buf" -K "$wfb_key" -B "$bandwidth" -M "$mcs_index" -C 8000 \
|
||||
-S "$stbc" -L "$ldpc" -k "$fec_k" -n "$fec_n" -i "$link_id" "$wlan" &> /dev/null &
|
||||
echo "- Starting wfb_tx"
|
||||
wfb_tx -K "$wfb_key" -M "$b_index" -B "$bandwidth" -C 8000 \
|
||||
-k "$b_fec_k" -n "$b_fec_n" -i "$b_link_id" "$wfb_dev" &> /dev/null &
|
||||
}
|
||||
|
||||
start_tunnel() {
|
||||
echo "Starting wfb_tun"
|
||||
wfb_rx -p 160 -u 5800 -K "$wfb_key" -i "$link_id" "$wlan" &> /dev/null &
|
||||
wfb_tx -p 32 -u 5801 -K "$wfb_key" -M "$mcs_index" -S "$stbc" -L "$ldpc" \
|
||||
-k "$fec_k" -n "$fec_n" -i "$link_id" "$wlan" &> /dev/null &
|
||||
echo "- Starting wfb_tun"
|
||||
wfb_rx -p 160 -u 5800 -K "$wfb_key" -i "$b_link_id" "$wfb_dev" &> /dev/null &
|
||||
wfb_tx -p 32 -u 5801 -K "$wfb_key" -M "$t_index" \
|
||||
-k "$b_fec_k" -n "$b_fec_n" -i "$b_link_id" "$wfb_dev" &> /dev/null &
|
||||
wfb_tun -a 10.5.0.10/24 > /dev/null &
|
||||
}
|
||||
|
||||
|
|
@ -70,24 +115,40 @@ start_telemetry() {
|
|||
devmem 0x1F207890 16 0x8
|
||||
fi
|
||||
|
||||
if [ "$router" -eq 2 ]; then
|
||||
echo "Starting msposd"
|
||||
msposd --master "$serial" --baudrate "$baud" --channels "$channels" \
|
||||
-osd -r "$fps" --ahi 0 --out 10.5.0.1:"$port_tx" > /dev/null &
|
||||
else
|
||||
echo "Starting mavfwd"
|
||||
mavfwd --master "$serial" --baudrate "$baud" --channels "$channels" -p 100 -t \
|
||||
-a 15 --in 0.0.0.0:"$port_rx" --out 10.5.0.1:"$port_tx" > /dev/null &
|
||||
if [ "$t_router" = "msposd" ]; then
|
||||
echo "- Starting $t_router"
|
||||
msposd --baudrate 115200 --channels 8 -osd --ahi 0 -r "$t_osd_fps" \
|
||||
--master "$t_serial" --out 10.5.0.1:"$t_port_tx" > /dev/null &
|
||||
elif [ "$t_router" = "mavfwd" ]; then
|
||||
echo "- Starting $t_router"
|
||||
mavfwd --baudrate 115200 --channels 8 -p 100 -a 15 -t \
|
||||
--master "$t_serial" --in 0.0.0.0:"$t_port_rx" --out 10.5.0.1:"$t_port_tx" > /dev/null &
|
||||
fi
|
||||
}
|
||||
|
||||
majestic_sigmastar() {
|
||||
cli -s .isp.sensorConfig /etc/sensors/imx415_fpv.bin
|
||||
cli -s .isp.exposure 5
|
||||
cli -s .video0.codec h265
|
||||
cli -s .video0.size 1920x1080
|
||||
cli -s .video0.fps 90
|
||||
cli -s .video0.rcMode cbr
|
||||
cli -s .jpeg.enabled false
|
||||
cli -s .outgoing.enabled true
|
||||
cli -s .outgoing.server udp://0.0.0.0:5600
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
if [ ! -e /etc/system.ok ]; then
|
||||
echo "Preparing system tweaks for $wfb_soc..."
|
||||
tweaksys "$wfb_soc"
|
||||
if [ "$wfb_soc" = "ssc33x" ]; then
|
||||
majestic_sigmastar
|
||||
fi
|
||||
|
||||
touch /etc/system.ok
|
||||
fi
|
||||
|
||||
load_config
|
||||
load_modules
|
||||
load_interface
|
||||
|
||||
|
|
|
|||
|
|
@ -4,11 +4,11 @@
|
|||
#
|
||||
################################################################################
|
||||
|
||||
WIFIBROADCAST_NG_VERSION = 3a053040442174e6c1ce76866c6da4b12c19dbb4
|
||||
WIFIBROADCAST_NG_VERSION = 7dbdf92919cfccffa5ff46b0b8294e243f5f5a37
|
||||
WIFIBROADCAST_NG_SITE = $(call github,svpcom,wfb-ng,$(WIFIBROADCAST_NG_VERSION))
|
||||
WIFIBROADCAST_NG_LICENSE = GPL-3.0
|
||||
|
||||
WIFIBROADCAST_NG_DEPENDENCIES += libpcap libsodium iw
|
||||
WIFIBROADCAST_NG_DEPENDENCIES += libpcap libsodium
|
||||
|
||||
define WIFIBROADCAST_NG_BUILD_CMDS
|
||||
$(MAKE) CC=$(TARGET_CC) CXX=$(TARGET_CXX) LDFLAGS=-s -C $(@D) all_bin
|
||||
|
|
@ -17,12 +17,17 @@ endef
|
|||
define WIFIBROADCAST_NG_INSTALL_TARGET_CMDS
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/etc
|
||||
$(INSTALL) -m 644 -t $(TARGET_DIR)/etc $(WIFIBROADCAST_NG_PKGDIR)/files/drone.key
|
||||
$(INSTALL) -m 644 -t $(TARGET_DIR)/etc $(WIFIBROADCAST_NG_PKGDIR)/files/wfb.conf
|
||||
$(INSTALL) -m 644 -t $(TARGET_DIR)/etc $(WIFIBROADCAST_NG_PKGDIR)/files/wfb.yaml
|
||||
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/etc/init.d
|
||||
$(INSTALL) -m 755 -t $(TARGET_DIR)/etc/init.d $(WIFIBROADCAST_NG_PKGDIR)/files/S98wifibroadcast
|
||||
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/usr/bin
|
||||
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/bin $(@D)/wfb_rx
|
||||
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/bin $(@D)/wfb_tx
|
||||
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/bin $(@D)/wfb_tx_cmd
|
||||
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/bin $(@D)/wfb_tun
|
||||
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/bin $(WIFIBROADCAST_NG_PKGDIR)/files/wfb-cli
|
||||
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/bin $(WIFIBROADCAST_NG_PKGDIR)/files/wifibroadcast
|
||||
endef
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue