# What Is the ZimaBoard-Specific Integration in CasaOS?

> Discover the ZimaBoard-specific integration in CasaOS. Access hardware metadata like serial numbers and IPs for seamless plug-and-play home server functionality on ZimaBoard.

- Repository: [IceWhale/CasaOS](https://github.com/IceWhaleTech/CasaOS)
- Tags: deep-dive
- Published: 2026-06-28

---

**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`](https://github.com/IceWhaleTech/CasaOS/blob/main/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`](https://github.com/IceWhaleTech/CasaOS/blob/main/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`](https://github.com/IceWhaleTech/CasaOS/blob/main/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`](https://github.com/IceWhaleTech/CasaOS/blob/main/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:**

```go
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:**

```bash

# 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:

```json
{
  "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`](https://github.com/IceWhaleTech/CasaOS/blob/main/model/zima.go) defines the data model for hardware-specific fields, populated directly from board firmware.
- The `GetDeviceInfo()` method in [`service/system.go`](https://github.com/IceWhaleTech/CasaOS/blob/main/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`](https://github.com/IceWhaleTech/CasaOS/blob/main/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`](https://github.com/IceWhaleTech/CasaOS/blob/main/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.