### Create Custom OpenIPC Packages (Init Script) Source: https://context7.com/openipc/firmware/llms.txt An example init script for a custom package named 'mypackage'. This script handles starting, stopping, and restarting the package's service, integrating it into the firmware's init system. ```bash #!/bin/sh case "$1" in start) echo "Starting mypackage..." /usr/bin/mypackage & ;; stop) echo "Stopping mypackage..." killall mypackage ;; restart) $0 stop $0 start ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 esac ``` -------------------------------- ### Install Build Dependencies (Bash) Source: https://context7.com/openipc/firmware/llms.txt This command automates the installation of all necessary system packages required for building OpenIPC firmware on Debian/Ubuntu-based systems. It ensures that essential tools like compilers, libraries, and version control systems are present. ```bash make deps ``` -------------------------------- ### Listing Available Services on OpenIPC Camera Source: https://github.com/openipc/firmware/blob/master/general/package/nabto/readme.md After successful pairing, this command queries the camera for its available services. The output lists services like RTSP, their types, and connection details (host and port). ```bash ./edge_tunnel_client --services Connected to the device [0] pr-ydk3xhyn.de-orruyc4n Available services ... Service: rtsp Type: rtsp Host: 127.0.0.1 Port: 554 ``` -------------------------------- ### Pairing OpenIPC Camera with Password Open Source: https://github.com/openipc/firmware/blob/master/general/package/nabto/readme.md This command pairs the OpenIPC camera to the client using a provided pair string and password. It initiates the connection and sets up the device in bookmarks for future access. The output confirms successful connection and bookmarking. ```bash ./edge_tunnel_client --pair-string p=pr-ydk3xhyn,d=de-orruyc4n,pwd=X9NphkArpzLU,sct=9jLgbUb4FWhe Connected to device ProductId: pr-ydk3xhyn DeviceId: de-orruyc4n Several pairing modes exists choose one of the following. [0]: Password Open [1]: Local Open Choose a pairing mode: 0 Open Password Pairing requires a username. The username is a name you choose for the new user, the username has to be unique among the registered users on the device. New Username: admin The device [0] pr-ydk3xhyn.de-orruyc4n has been set into the bookmarks as index 0 ``` -------------------------------- ### Firmware Size Validation and Repacking (Makefile) Source: https://context7.com/openipc/firmware/llms.txt Illustrates how Buildroot automatically validates firmware sizes against flash constraints and prepares the final firmware package. It outlines expected limits for kernel and rootfs sizes based on flash types (NOR, NAND) and provides an example of a size validation failure message. ```makefile # The build system automatically validates sizes based on flash type: # NOR Flash (8MB): # - Kernel (uImage): max 2048 KB # - RootFS (squashfs): max 5120 KB # # NOR Flash (16MB): # - Kernel (uImage): max 2048 KB # - RootFS (squashfs): max 8192 KB # # NAND Flash: # - Kernel (uImage): max 4096 KB # - RootFS (ubi): max 16384 KB # Example validation output during build: # - uImage: [1856KB/2048KB] # - rootfs.squashfs: [4932KB/5120KB] # # If size exceeds limit, build fails with: # -- size exceeded by: 128KB # make: *** [Makefile:112: repack] Error 1 # Firmware package contents: # openipc.hi3516cv300-nor-lite.tgz contains: # - uImage.hi3516cv300 # - rootfs.squashfs.hi3516cv300 # - MD5 checksums for verification ``` -------------------------------- ### Create Custom OpenIPC Packages (Makefile) Source: https://context7.com/openipc/firmware/llms.txt Defines the structure and build process for a custom package within the OpenIPC firmware using Buildroot's makefile system. This includes setting package version, site, license, dependencies, build commands, and installation steps. ```makefile ################################################################################ # # mypackage # ################################################################################ MYPACKAGE_VERSION = 1.0.0 MYPACKAGE_SITE = $(call github,username,mypackage,$(MYPACKAGE_VERSION)) MYPACKAGE_LICENSE = MIT MYPACKAGE_LICENSE_FILES = LICENSE # Dependencies MYPACKAGE_DEPENDENCIES = zlib libcurl-openipc # Build commands define MYPACKAGE_BUILD_CMDS $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) endef # Installation commands define MYPACKAGE_INSTALL_TARGET_CMDS $(INSTALL) -m 755 -d $(TARGET_DIR)/usr/bin $(INSTALL) -m 755 -t $(TARGET_DIR)/usr/bin $(@D)/mypackage $(INSTALL) -m 755 -d $(TARGET_DIR)/etc/init.d $(INSTALL) -m 755 -t $(TARGET_DIR)/etc/init.d $(MYPACKAGE_PKGDIR)/files/S99mypackage endef $(eval $(generic-package)) ``` -------------------------------- ### Connecting to RTSP Service on OpenIPC Camera Source: https://github.com/openipc/firmware/blob/master/general/package/nabto/readme.md This command establishes a TCP tunnel to the RTSP service provided by the camera. It specifies the service to connect to and the local port on which the tunnel will be listening. ```bash ./edge_tunnel_client --service rtsp Connected to the device [0] pr-ydk3xhyn.de-orruyc4n TCP Tunnel opened for the service rtsp listening on the local port 44391 ``` -------------------------------- ### Launch TCP Tunnel Device Source: https://github.com/openipc/firmware/blob/master/general/package/nabto/readme.md This snippet shows the command to launch the tcp_tunnel_device after it has been configured. The output confirms the device details, including Product ID, Device ID, Fingerprint, and configured TCP services, and indicates a successful attachment to the Nabto basestation. ```bash tcp_tunnel_device ``` ```text ######## Nabto TCP Tunnel Device ######## # Product ID: pr-ydk3xhyn # Device ID: de-orruyc4n # Fingerprint: 3de2ec6ded2cc975bf87ed63b2303e02b8051fb7359b19a3d950ed0158bb3813 # Version: 0.0.0-branch.heads/master.commits.1910+a49d27fc.dirty # Local UDP Port: 5592 # Friendly Name: "Tcp Tunnel" # # The device offers Local Open Pairing # # The device has Password Open Pairing enabled # Open Pairing Password: X9NphkArpzLU # Open Pairing SCT: 9jLgbUb4FWhe # Open Pairing String: p=pr-ydk3xhyn,d=de-orruyc4n,pwd=X9NphkArpzLU,sct=9jLgbUb4FWhe # ######## Configured TCP Services ######## # Id Type Host Port # rtsp rtsp 127.0.0.1 554 ######## Attached to the basestation ``` -------------------------------- ### Playing RTSP Stream using ffplay Source: https://github.com/openipc/firmware/blob/master/general/package/nabto/readme.md This command uses ffplay to play the RTSP stream accessible through the established tunnel. It specifies the TCP transport and the local address and port where the stream is available. ```bash ffplay -rtsp_transport tcp rtsp://127.0.0.1:44391/stream=0 ``` -------------------------------- ### Configure RTSP TCP Tunnel Device Source: https://github.com/openipc/firmware/blob/master/general/package/nabto/readme.md This snippet demonstrates the interactive configuration process for the tcp_tunnel_device to tunnel an RTSP stream. It prompts for Product ID, Device ID, RTSP port, and endpoint. The output shows the service being added and a fingerprint being generated, which is crucial for cloud registration. ```bash root@openipc-t31:# tcp_tunnel_device --demo-init No device configuration found. Creating configuration: /home/user/.nabto/edge/config/device.json. The device configuration requires a Product ID and a Device ID, created in the Nabto Cloud Console. Product Id: pr-ydk3xhyn Device Id: de-orruyc4n Demo initialization will make a simple IAM setup, be aware that this is not what you want in production. 'Local Open Pairing' and 'Password Open Pairing' are enabled. Newly paired users get the 'Administrator' role. Next step is to add TCP tunnel services. What type of service do you want to add? [0]: continue [1]: ssh [2]: http [3]: rtsp Enter a valid number (default: 1) [0-3]: 3 Enter the port of your RTSP server (default: 8554) [0-65535]: 554 Enter your RTSP endpoint (default: /video): /stream=0 Added rtsp service on localhost port 554 with metadata rtsp-path => /stream=0 ``` ```text The configuration and state has been initialized The Fingerprint must be configured for this device in the Nabto Cloud Console before it will be allowed to attach to the Basestation. If you want to reuse an already configured fingerprint, you can copy the corresponding private key to /home/user/.nabto/edge/keys/device.key The device Fingerprint is: 3de2ec6ded2cc975bf87ed63b2303e02b8051fb7359b19a3d950ed0158bb3813 ``` -------------------------------- ### List Available Board Configurations (Bash) Source: https://context7.com/openipc/firmware/llms.txt This command queries and lists all available board configurations supported by the OpenIPC build system. Each configuration corresponds to a specific SoC model and build settings, defined by defconfig files. The output helps users identify the correct `BOARD` parameter for build commands. ```bash make list ``` -------------------------------- ### Build Firmware for Specific Board (Bash) Source: https://context7.com/openipc/firmware/llms.txt This command initiates the firmware build process for a specified board configuration. It leverages Buildroot to download necessary components, compile the kernel and packages, and generate flashable firmware images. Dependencies include Buildroot and the toolchain, with output typically found in the 'output/images/' directory. ```bash make # Or for a specific board: make BOARD=hi3516cv300_lite # With custom output directory: make BOARD=hi3516cv300_lite TARGET=/path/to/output ``` -------------------------------- ### Build and Configure OpenIPC Firmware Source: https://context7.com/openipc/firmware/llms.txt Commands to build the OpenIPC firmware with a specific board configuration and to further customize it using the menuconfig interface. These actions initiate the compilation process and allow interactive configuration adjustments. ```bash # 2. Build with new configuration make BOARD=hi3516ev300_custom # 3. Customize further using menuconfig make BOARD=hi3516ev300_custom br-menuconfig ``` -------------------------------- ### Build Individual Packages (Bash) Source: https://context7.com/openipc/firmware/llms.txt Allows building or rebuilding specific components of the firmware without a full system build. This is useful for targeted development and testing. Users can specify individual packages like the kernel (`br-linux`) or applications (`br-majestic`). The `make package` command lists all available packages. ```bash # Build Linux kernel: make BOARD=hi3516cv300_lite br-linux # Build a specific package (e.g., majestic): make BOARD=hi3516cv300_lite br-majestic # List all packages: make package # Rebuild a package after cleaning: make BOARD=hi3516cv300_lite clean make BOARD=hi3516cv300_lite br-majestic ``` -------------------------------- ### Accessing Buildroot Configuration (Menuconfig) Source: https://context7.com/openipc/firmware/llms.txt Provides commands to open and interact with the Buildroot configuration menus for the OpenIPC firmware. It details how to access the main Buildroot configuration, kernel configuration, and Busybox configuration, as well as how to save changes. ```bash # Open Buildroot configuration menu make BOARD=hi3516cv300_lite br-menuconfig # Common configuration tasks: # - Target packages → Select additional packages # - Toolchain → Configure toolchain options # - Kernel → Modify kernel configuration # - Filesystem images → Change filesystem options # - System configuration → Hostname, init system, etc. # Open Linux kernel configuration make BOARD=hi3516cv300_lite br-linux-menuconfig # Open Busybox configuration make BOARD=hi3516cv300_lite br-busybox-menuconfig # Save configuration changes make BOARD=hi3516cv300_lite br-savedefconfig ``` -------------------------------- ### Enable and Build Custom Package in OpenIPC Source: https://context7.com/openipc/firmware/llms.txt Commands to enable a custom package ('mypackage') in a board's defconfig file and then build the firmware with that package included. This process integrates the custom package into the build system. ```bash # 5. Enable in board defconfig and build echo "BR2_PACKAGE_MYPACKAGE=y" >> br-ext-chip-hisilicon/configs/hi3516cv300_lite_defconfig make BOARD=hi3516cv300_lite br-mypackage ``` -------------------------------- ### Create Custom Board Configuration (Bash) Source: https://context7.com/openipc/firmware/llms.txt Defines a new board configuration by creating a `defconfig` file within the appropriate chip vendor directory. This involves specifying build options such as architecture and other Buildroot-related settings, enabling customization for new hardware. ```bash # Example: Create a new defconfig file for HiSilicon EV300: cat > br-ext-chip-hisilicon/configs/hi3516ev300_custom_defconfig << 'EOF' # Architecture BR2_arm=y # ... other configurations ... EOF ``` -------------------------------- ### Build Custom Toolchain/SDK (Bash) Source: https://context7.com/openipc/firmware/llms.txt Generates a standalone SDK toolchain for cross-compilation targeting a specific board. This toolchain includes the cross-compiler, C library, kernel headers, and sysroot, enabling external development. The `toolname` target retrieves the name of the generated toolchain. ```bash # Build toolchain/SDK: make BOARD=hi3516cv300_lite toolchain # Get toolchain name: make BOARD=hi3516cv300_lite toolname ``` -------------------------------- ### Build OpenIPC Firmware Configuration Source: https://context7.com/openipc/firmware/llms.txt Specifies the configuration options for the OpenIPC toolchain, kernel, and filesystem. These settings are typically used in a Buildroot environment to define the firmware's components and their versions. ```makefile 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-musleabi" BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_9=y BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y 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)/hi3516ev300.generic.config" BR2_LINUX_KERNEL_UIMAGE=y BR2_LINUX_KERNEL_XZ=y # Filesystem BR2_TARGET_ROOTFS_SQUASHFS=y BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y # OpenIPC configuration BR2_OPENIPC_SOC_VENDOR="hisilicon" BR2_OPENIPC_SOC_MODEL="hi3516ev300" BR2_OPENIPC_SOC_FAMILY="hi3516ev300" BR2_OPENIPC_VARIANT="custom" BR2_OPENIPC_FLASH_SIZE="8" # Custom packages BR2_PACKAGE_DROPBEAR_OPENIPC=y BR2_PACKAGE_HISILICON_OSDRV_HI3516EV300=y BR2_PACKAGE_IPCTOOL=y BR2_PACKAGE_MAJESTIC=y ``` -------------------------------- ### Create Custom OpenIPC Packages (Config.in) Source: https://context7.com/openipc/firmware/llms.txt Adds a new configuration option for 'mypackage' to the Buildroot system's `Config.in` file. This allows the package to be selected and enabled during the firmware configuration process. ```makefile config BR2_PACKAGE_MYPACKAGE bool "mypackage" help My custom package description ``` -------------------------------- ### Cleaning Build Artifacts in OpenIPC Source: https://context7.com/openipc/firmware/llms.txt Command to clean build artifacts for the OpenIPC firmware. This is useful for forcing a complete rebuild or for freeing up disk space by removing intermediate build files. ```bash # Example: Clean all build artifacts make clean ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.