Onion Omega Documentation
website·Indexed 32 days ago
https://documentation.onioniot.comTechnical documentation for Onion IoT hardware, including the Omega4 and Omega2 legacy series (Omega2, Omega2 Pro, Omega2 S/S+, Omega2 LTE, and Omega2 Dash). Covers hardware overviews, networking configurations like Wi-Fi AP and Bluetooth GATT provisioning, and software libraries for C, Python, and Node.js to control expansion docks, PWM, relays, and OLED displays.
What's inside Onion Omega
- The Omega4 features a hardware real-time clock (RTC) that maintains time when the main system is powered off, provided RTC power is present. On the Omega4 EVB, the RTC backup battery holder uses a CR1220 coin cell. The system is configured to update the RTC after an NTP sync to ensure time persists across reboots.
Overview of the pivot-overlay procedure for Omega2
The pivot-overlay process extends the Omega2's storage capacity by moving the writable portion of the firmware (/overlay) to an external storage device (USB drive or MicroSD card). The Omega's filesystem consists of a read-only base (/rom) and a writable layer (/overlay); pivot-overlay redirects the writable layer to external media, allowing the user to install more packages and store more data.Overview of the Bluetooth Low-Energy (BLE) Expansion
The Bluetooth Low-Energy (BLE) Expansion is a USB-based dongle that adds Bluetooth 4.1 connectivity to an Omega2. It allows the Omega2 to interact with other Bluetooth-enabled devices and is particularly useful for projects requiring stable, short-range wireless connections, such as wireless audio controllers.Overview of Omega2 Package Repositories
A package repo is an HTTP file server that stores compiled packages and a package index. Omega2 devices use this repository as a source for the OPKG package manager to install and track software versions. To function correctly, the repository must be accessible via HTTP and include a package index (created during the production compilation process).Overview of OPKG package manager for Omega2
OPKG is the package manager used by the Omega's operating system to download and install software packages. It functions similarly to theapt-getutility found in Linux distributions.Overview of the Onion OpenWRT Build Process
Onion firmware (based on OpenWRT 23.05) is created using a two-process workflow. Process 1 establishes the core toolchain (Build System, SDK, and Image Builder), while Process 2 uses those tools to create the final packages and firmware images for Omega2 devices.Overview of the Omega2 Expansion Dock hardware
The Expansion Dock simplifies the use of the Omega2 by providing power management, serial communication, and easy access to GPIOs. It features a 30-pin Expansion Header for Onion Expansions, a Micro-USB port for 5V power (stepped down to 3.3V for the Omega), and a USB-to-Serial chip for terminal access via a computer. It also includes a USB 2.0 Type-A port for external storage and an RGB LED for status indication.Overview of the Omega4 Camera and Video Stack
The Omega4 supports camera capture via the RV1103B MIPI CSI-2, CIF, and ISP pipeline. The hardware path flows from the SC3336 camera sensor through the MIPI CSI-2 receiver, Rockchip CIF bridge, and Rockchip ISP, eventually exposing a V4L2 capture node (commonly
/dev/video7).There are three primary workflows for consuming these frames:
- Still frame:
/dev/video7$\rightarrow$v4l2-ctlormfg-camera-test$\rightarrow$ NV12 raw frame. - Video:
/dev/video7$\rightarrow$omega4-vencd$\rightarrow$ hardware VENC $\rightarrow$ H.264 file or stream. - Inference:
/dev/video7$\rightarrow$omega4-rknn-yolo-live$\rightarrow$ NPU $\rightarrow$ JSON detection output.
SC3336 camera sensor -> MIPI CSI-2 receiver -> Rockchip CIF bridge -> Rockchip ISP -> V4L2 capture node, commonly /dev/video7- Still frame:
Overview of Custom Firmware for Omega2
Custom firmware for the Omega2 allows developers to create a firmware image tailored to a specific application use case. This includes integrating default and custom software packages, as well as pre-configuring device features like networking and WiFi.
Key benefits include:
- Reduced Production Time: A single image can be flashed during manufacture.
- Persistent Customizations: After a factory reset, the device reverts to the custom firmware's default state rather than the generic Onion firmware, ensuring the application remains functional.
Overview of Omega4 Hardware H.264 Encoding (VENC)
Omega4 firmware v0.0.14 and newer supports hardware H.264 encoding using the RV1103B RKVENC block. The
omega4-vencdcommand captures NV12 frames from the camera, processes them through the Rockchip MPP encoder, and outputs an Annex-B H.264 stream. This hardware-accelerated path avoids the need to copy raw frames to a host computer for encoding.The typical data pipeline is: SC3336 camera sensor $\rightarrow$ MIPI CSI-2 / CIF / ISP $\rightarrow$
/dev/video7(V4L2 NV12 frames) $\rightarrow$omega4-vencd$\rightarrow$ Rockchip MPP / RKVENC $\rightarrow$ H.264 output.Overview of the Omega4 NPU and Camera Stack
The Omega4 (firmware v0.0.14+) supports the RV1103B NPU via the Rockchip RKNPU driver and RKNN runtime. The NPU pipeline flows from the camera sensor through the Rockchip ISP/RKAIQ, into a V4L2 capture node (typically
/dev/video7), through userspace frame preparation, and finally into the RKNN runtime and/dev/rknpufor classification or object detection output.Note: The NPU inference path is separate from the video encoder path. Because current CLI tools open the camera capture node directly, only one camera-owning process (e.g., either the encoder or the detector) can run at a time unless a shared capture pipeline is implemented.
Overview of the OpenWRT package build pipeline
The process of creating a deployable package for Omega2 follows these stages:
- Package Source Code: A collection of source files and a package makefile (the blueprint specifying name, version, and compilation instructions).
- Package Feed: A repository of package sources used as input for the OpenWRT SDK or build system.
- Compilation: The build system retrieves files from the feed, resolves dependencies, and compiles the code.
- IPK Binary: The result of compilation is an
.ipkfile containing the binaries and metadata. - Package Repo: The
.ipkfiles are hosted in an online repository, allowing users to install them via OPKG.