What Is the ZimaBoard-Specific Integration in CasaOS?

The ZimaBoard-specific integration in CasaOS provides hardware-specific utilities and data models that expose board metadata—such as serial numbers, LAN IPs, and model identifiers—to enable plug-and-play home server functionality on ZimaBoard hardware.

CasaOS was originally developed as the pre-installed operating system for the crowdfunded ZimaBoard single-board computer. According to the IceWhaleTech/CasaOS source code, the ZimaBoard-specific integration supplies specialized utilities and data structures that allow the platform to treat ZimaBoard as a first-class home server device while maintaining compatibility with Intel NUC and Raspberry Pi hardware.

Core Purpose of the ZimaBoard Integration

The integration serves as the hardware abstraction layer that enables CasaOS to detect when it is running on ZimaBoard hardware and extract device-specific metadata for system configuration and monitoring.

Device Discovery and Identification

The DeviceInfo struct defined in model/zima.go captures hardware-specific fields including LAN IPv4 addresses, serial number, model name, OS version, and an initialization flag. These values are populated from the underlying board firmware and used throughout CasaOS to display system status, generate unique IDs, and drive network-dependent features.

System Service Exposure

The system service layer implements GetDeviceInfo() in service/system.go, which returns a populated model.DeviceInfo instance. This method is invoked by the API layer and internal components requiring exact hardware context for automatic port mapping, OTA updates, and hardware health monitoring.

How the Integration Works Under the Hood

The ZimaBoard-specific code is implemented through a tightly-coupled combination of data models and service methods that query the underlying hardware.

The DeviceInfo Data Model

Located at model/zima.go (lines 27-35), the DeviceInfo struct serves as the canonical data structure for ZimaBoard hardware metadata. It includes fields for network configuration, device identification, and system state tracking.

Retrieving Hardware Metadata

The GetDeviceInfo() method in service/system.go (lines 58-73) queries the underlying system to populate the struct fields. This method bridges the gap between the hardware firmware and the CasaOS application layer, ensuring that board-specific information is available to both internal services and external APIs.

Accessing ZimaBoard Data via API

You can retrieve ZimaBoard-specific device information programmatically through the system service or via the REST API.

Using the Go service layer:

package main

import (
    "fmt"
    "github.com/IceWhaleTech/CasaOS/main/service"
    "github.com/IceWhaleTech/CasaOS/main/model"
)

func main() {
    // Initialise the service layer (normally done by CasaOS start-up)
    srv := service.NewService()

    // Fetch the ZimaBoard-specific device info
    devInfo := srv.System().GetDeviceInfo()

    fmt.Printf("Model: %s\n", devInfo.DeviceModel)
    fmt.Printf("Serial: %s\n", devInfo.DeviceSN)
    fmt.Printf("LAN IP(s): %v\n", devInfo.LanIpv4)
    fmt.Printf("OS version: %s\n", devInfo.OS_Version)
}

Via the HTTP API:


# Assuming CasaOS is listening on port 8089

curl -s http://127.0.0.1:8089/v1/system/deviceInfo | jq .

The endpoint returns a JSON object matching the model.DeviceInfo structure:

{
  "lan_ipv4": ["192.168.1.42"],
  "port": 8089,
  "device_name": "CasaOS",
  "device_model": "ZimaBoard",
  "device_sn": "ZB123456789",
  "initialized": true,
  "os_version": "Ubuntu 22.04",
  "hash": "a1b2c3d4"
}

Summary

  • The ZimaBoard-specific integration enables CasaOS to detect ZimaBoard hardware and extract specialized metadata including serial numbers, LAN IPs, and model identifiers.
  • The DeviceInfo struct in model/zima.go defines the data model for hardware-specific fields, populated directly from board firmware.
  • The GetDeviceInfo() method in service/system.go exposes this data to the API layer and internal services for network configuration and system monitoring.
  • CasaOS originated as the pre-installed OS for ZimaBoard (as documented in README.md) but maintains a generic codebase supporting Intel NUC and Raspberry Pi through the same abstraction layer.

Frequently Asked Questions

What hardware information does CasaOS collect from ZimaBoard?

CasaOS collects the device model, serial number, LAN IPv4 addresses, OS version, and initialization status through the DeviceInfo struct defined in model/zima.go. These values are populated from the underlying board firmware and used for system identification and network configuration.

Is CasaOS exclusive to ZimaBoard hardware?

No. While CasaOS originated as the pre-installed system for the crowdfunded ZimaBoard product, the platform fully supports Intel NUC and Raspberry Pi devices. The ZimaBoard-specific integration is implemented as a specialized layer within a generic codebase that adapts to multiple hardware platforms.

How does CasaOS detect it is running on a ZimaBoard?

CasaOS detects ZimaBoard hardware by querying firmware-specific fields through the system service layer, which populates the DeviceInfo struct with board-specific data such as the serial number and model identifier. The presence of valid ZimaBoard metadata in this struct indicates the platform is running on native hardware.

Can I access ZimaBoard device information programmatically?

Yes. Developers can access device information programmatically by importing the service package and calling service.System().GetDeviceInfo() in Go, or by querying the /v1/system/deviceInfo REST API endpoint. The API returns a JSON object containing all hardware-specific metadata exposed by the integration.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →