Skip to main content

Developer Guide

This document guides you through setting up the complete NE503 AIPC development environment and building from source to release package.

Part A: Environment Setup​

1. System Requirements​

SystemSupport LevelNotes
Ubuntu 20.04+Full supportRecommended, all layers available natively
macOS (Intel / Apple Silicon)SupportedLayer 1/2 native; Layer 3 via Docker image (arm64 native, no QEMU)

Hardware: Minimum 4-core CPU, 8 GB RAM, 20 GB disk. 4 GB RAM sufficient for Go/Web-only development.

2. Get Source Code​

git clone <repo-url> && cd ne503

Verify repository integrity:

ls Makefile platform/ web/

Project root structure:

ne503/
β”œβ”€β”€ platform/ # Platform services (Go + C++)
β”œβ”€β”€ hal/ # HAL v1 (C, legacy)
β”œβ”€β”€ hal_v2/ # HAL v2 (C++, recommended)
β”œβ”€β”€ sdk/ # Developer SDK (Python / Go)
β”œβ”€β”€ web/ # Web console (React + TypeScript)
β”œβ”€β”€ apps/ # Example applications
β”œβ”€β”€ configs/ # Configuration templates
β”œβ”€β”€ tools/ # Development tools
β”œβ”€β”€ scripts/ # Build/test/deploy scripts
└── docker/ # Docker development environment

3. Install Dependencies​

The NE503 build system has three layers:

LayerContentsTypical Use Case
Layer 1Go + Node.js + protoc + PythonPlatform services, Web console, SDK development
Layer 2Layer 1 + CMake + g++ + gRPC C++Native C/C++ components like camera-daemon
Layer 3Layer 1/2 + Hailo Yocto SDK (cross-compile)Hailo-15 HAL firmware builds

Most developers only need Layer 1/2.

A full release build (pack-release) requires Layer 3; it can be skipped only when developing Go services, the Web console, or the Python SDK.

Which option to choose:

Your situationChoose
Want to ship a release fastest / no local setup / on macOSOption A Docker (recommended)
Ubuntu native development, can run scripts onlineOption B Script install
Script failed / offline / need precise version controlOption C Manual install

Option B is the automated wrapper of Option C β€” if the script fails, fall back to Option C and follow the manual steps to debug.

The pre-built image includes all three layers of dependencies, ready to use out of the box.

The image is multi-platform (amd64 + arm64); on Apple Silicon it pulls the arm64 native variant automatically β€” no QEMU emulation, with performance on par with native Linux.

Pull the image:

docker pull zerobot/ne503-dev-env-full

Create a persistent dev container:

docker run -d --name ne503-dev \
-v $(pwd):/ne503 \
-w /ne503 \
zerobot/ne503-dev-env-full \
bash -c "sleep infinity"

The container is reusable and long-lived β€” no need to recreate it each time. Use docker exec for daily work:

docker exec -it ne503-dev bash         # Enter container interactively
docker exec ne503-dev make env-check # Run commands inside the container

All three layers are pre-installed. Skip to Β§4 Verify Environment to confirm.

Option B: Script Install​

The project provides automated scripts supporting Ubuntu/Debian (apt) and macOS (brew), covering Layer 1/2:

./scripts/setup_env.sh layer1    # Go + Node.js + protoc + Python
./scripts/setup_env.sh layer2 # Layer 1 + cmake + g++ + gRPC C++

Scripts automatically detect and skip existing tools. For first-time setup, run ./scripts/setup_env.sh layer2 directly.

The script also offers a layer3 entry point, but it does not auto-download the Hailo SDK (the SDK is a ~2.7 GB private toolchain, obtainable from technical support) β€” it only prints the manual SDK installation steps:

./scripts/setup_env.sh layer3    # installs Layer 2 + prints Hailo SDK manual install steps

For full builds, Option A (Docker image, SDK built in) is recommended; or follow the steps printed by layer3 to install the SDK manually (see Option C).

After installation, ensure $(go env GOPATH)/bin is in your PATH (scripts do not configure this automatically):

# macOS
echo 'export PATH="$PATH:$(go env GOPATH)/bin"' >> ~/.zshrc && source ~/.zshrc

# Ubuntu
echo 'export PATH="$PATH:$(go env GOPATH)/bin"' >> ~/.bashrc && source ~/.bashrc

Option C: Manual Install​

Ubuntu 20.04+

Layer 1:

# Go 1.25+
sudo add-apt-repository -y ppa:longsleep/golang-backports
sudo apt-get update -qq && sudo apt-get install -y golang-go

# Node.js 20+
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs && npm install -g pnpm

# protoc + Go plugins
sudo apt-get install -y protobuf-compiler
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

# Python 3
sudo apt-get install -y python3 python3-pip

Layer 2 (in addition to Layer 1):

sudo apt-get install -y build-essential cmake protobuf-compiler-grpc libgrpc++-dev libprotobuf-dev

Layer 3 β€” Hailo SDK:

The Hailo Yocto Poky SDK is an x86_64 Linux-only cross-compile toolchain for building camera-daemon, ai-runtime, and HAL v2 firmware.

  1. Contact CamThink Technical Support for the SDK installer (filename format: poky-glibc-x86_64-*-aarch64-toolchain-4.0.23.sh, approximately 2.7 GB)

  2. Install to /opt/poky:

chmod +x poky-glibc-x86_64-*-aarch64-toolchain-4.0.23.sh
sudo ./poky-glibc-x86_64-*-aarch64-toolchain-4.0.23.sh -d /opt/poky/4.0.23 -y
  1. Verify installation:
ls /opt/poky/4.0.23/environment-setup-armv8a-poky-linux

A manual install places the SDK at /opt/poky/4.0.23. Commands in later sections use the Docker default /opt/hailo-sdk β€” manual-install users should substitute /opt/poky/4.0.23.

macOS

Layer 1:

brew install go node protobuf
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
npm install -g pnpm

Layer 2 (in addition to Layer 1):

brew install cmake grpc
xcode-select --install

Layer 3 β€” Hailo SDK (Linux only):

macOS cannot install the Hailo SDK natively (it is an x86_64 Linux-only cross-compile toolchain). For Layer 3, use the Option A: Docker pre-built image β€” the image is multi-platform (amd64 + arm64), Apple Silicon pulls the arm64 native variant, so Go / Node / CMake / the SDK cross-compiler all run natively; all three layers are available inside the container, with no manual SDK configuration required.

Dependency Versions​

ToolMinimum VersionCheck CommandLayer
Go1.25+go versionL1
Node.js20+node --versionL1
pnpmLatestpnpm --versionL1
protoc3.12+protoc --versionL1
protoc-gen-goLatestwhich protoc-gen-goL1
protoc-gen-go-grpcLatestwhich protoc-gen-go-grpcL1
Python3.8+python3 --versionL1
CMake3.16+cmake --versionL2
GCC/G++10+ (C++20)g++ --versionL2
gRPC C++1.30+which grpc_cpp_pluginL2

4. Verify Environment​

make env-check

This command checks all three layers and reports status. Output when all three layers pass:

=== NE503 Build Environment ===

--- Layer 1 (Universal) ---
OK: go version go1.25.x linux/arm64
OK: libprotoc 3.x.x
OK: protoc-gen-go
OK: protoc-gen-go-grpc
OK: Node.js v20.x.x
OK: Python 3.x.x
OK: pnpm x.x.x

--- Layer 2 (Native C/C++) ---
OK: cmake version 3.x.x
OK: g++ (Ubuntu 13.x / Apple clang) x.x.x
OK: grpc_cpp_plugin

--- Layer 3 (Hailo-15 Cross-compile) ---
OK: Hailo SDK (/opt/hailo-sdk)

The above is the output from the Docker pre-built image (Option A). Under manual install (Option C), Layer 3 shows OK: Hailo SDK (/opt/poky/4.0.23) β€” both paths are valid.

If Layer 3 is not installed, you will see:

--- Layer 3 (Hailo-15 Cross-compile) ---
NOT FOUND: Hailo SDK

Missing Layer 3 only affects full release builds (pack-release), not Go service or Web console development.

If you see WARNING: hailo15 target requested, a stale Makefile.docker exists in the project root. Remove it: rm Makefile.docker.

5. Python SDK & IDE Configuration​

Run the commands below inside your dev environment: Docker users first enter the container with docker exec -it ne503-dev bash; native users run from the project root.

Python SDK (development mode)​

cd sdk/python
pip3 install -e ".[dev]"

On error: externally-managed-environment (Ubuntu 24.04+, macOS Homebrew Python), use a venv:

cd sdk/python
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"

Run deactivate when done; re-run source .venv/bin/activate before each development session.

VS Code with extensions:

  • Go β€” golang.go
  • Python β€” ms-python.python
  • C/C++ β€” ms-vscode.cpptools
  • CMake Tools β€” ms-vscode.cmake-tools
  • Protocol Buffers β€” bufbuild.vscode-buf

Part B: Release Build​

6. Full Build​

The build produces build/release/aipc-hailo15-<version>.tar.gz containing platform services, HAL libraries, Web console, and deployment scripts.

Run inside the ne503-dev container created in Option A β€” works identically on Ubuntu / macOS Intel / Apple Silicon:

docker exec ne503-dev bash -c \
'source /opt/hailo-sdk/environment-setup-armv8a-poky-linux && \
make pack-release SDK_PATH=/opt/hailo-sdk VERSION=1.0.0'
# Expected output (stage progress; per-file compile lines omitted)
==> Compiling proto (inference / device / event / camera / app / ...)
==> Building device-control (CGO_ENABLED=0)
==> Building event-bus / app-manager / platform-api / device-discovery
==> Building Web Console
==> Building Python SDK
=== Layer 1 complete: proto + Go services + web + Python SDK ===
==> Building HAL v2 [platform=hailo15]
==> Building camera-daemon / ai-runtime (C++) / aipc-cli
==> Building tools (shm-reader, nv12-to-jpeg)
=== Layer 2 complete ===
==> Packaging release [1.0.0, platform=hailo15]
=== Release Package Ready ===
File: build/release/aipc-hailo15-1.0.0.tar.gz (111M)

Under manual install (Option C), the SDK path is /opt/poky/4.0.23 β€” replace the env script and SDK_PATH in the command above with that path.

Verify Build Artifacts​

Confirm binaries are ARM aarch64 (the container has no file, use readelf):

docker exec ne503-dev bash -c \
'readelf -h build/output/device-control | grep Machine'
# Expected output: Machine: AArch64

All artifacts under build/output/ (Go/C++ services, aipc-cli, shm-reader, hal/hailo15/libaipc_hal.so) are aarch64. On the host (outside the container) you can also run file build/output/device-control (output contains ARM aarch64).

7. Individual Service Builds​

During development iteration, rebuild and replace only the service you're working on:

# Device management
make device-control HAL_PLATFORM=hailo15

# Event bus
make event-bus HAL_PLATFORM=hailo15

# App management
make app-manager HAL_PLATFORM=hailo15

# API gateway
make platform-api HAL_PLATFORM=hailo15

# Device discovery
make device-discovery HAL_PLATFORM=hailo15

# Video capture (source SDK environment first)
source /opt/hailo-sdk/environment-setup-armv8a-poky-linux
make camera-daemon HAL_PLATFORM=hailo15 SDK_PATH=/opt/hailo-sdk

# AI inference (source SDK environment first)
source /opt/hailo-sdk/environment-setup-armv8a-poky-linux
make ai-runtime HAL_PLATFORM=hailo15 SDK_PATH=/opt/hailo-sdk

HAL_PLATFORM=hailo15 automatically sets cross-compile parameters. Run these commands inside the container or on a Linux host with the SDK environment sourced; macOS users should first enter the container with docker exec -it ne503-dev bash.

8. Build Troubleshooting​

protoc / protoc-gen-go not found​

sudo apt install protobuf-compiler
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
export PATH="$PATH:$(go env GOPATH)/bin"

grpc_cpp_plugin not found​

sudo apt install protobuf-compiler-grpc libgrpc++-dev libprotobuf-dev

camera-daemon cross-compile protobuf version mismatch​

C++ proto files must be generated with the SDK's bundled protoc. The Makefile handles this automatically when HAL_PLATFORM=hailo15.

If auto-generation fails, run the matching proto target manually (e.g. make proto-camera), or run make help to list the proto-* series.

CMake selected wrong toolchain​

rm -rf platform/camera-daemon/build-hailo15
make camera-daemon HAL_PLATFORM=hailo15 SDK_PATH=/opt/hailo-sdk

pnpm reports "Ignored build scripts" on first run​

cd web && pnpm approve-builds esbuild msw unrs-resolver

Web console build fails (missing modules)​

pnpm build reports Cannot find module '.../lib/...'. The root cause is the .gitignore lib/ rule catching web/src/**/lib/, so those source files are not tracked by git. Confirm .gitignore has the un-ignore exception:

lib/
!web/src/**/lib/

Add the exception, re-pull, and pnpm build works again.

Python SDK docs build reports ModuleNotFoundError: grpc​

The Building Python SDK Documentation stage prints many ModuleNotFoundError: No module named 'grpc' lines β€” sphinx autodoc tries to import SDK modules without grpcio installed. Non-fatal: the Python SDK itself builds successfully, the docs are still generated, and the build continues into Layer 2; the final release package is unaffected. Safe to ignore.

Make Target Reference​

TargetDescription
make pack-releaseFull Hailo-15 release (build + package)
make packPackage from existing build artifacts (no SDK needed)
make platformAll Go services
make hal-v2HAL v2 (HAL_PLATFORM=hailo15 cross-compile)
make camera-daemonC++ camera-daemon
make ai-runtimeC++ AI inference service
make protoCompile .proto to Go code
make webWeb console (pnpm)
make layer1proto + Go + Web + Python SDK
make layer2Layer 1 + HAL stub + C++ components
make env-checkCheck build dependencies
make cleanClean build artifacts
make testRun all tests