Add OS Build for Khadas VIM4

Description

I am currently looking for future proof SBC hardware I can run Home Assistant on. In the past ODROID N2+ was the best option regarding HA support and performance. However it is already pretty old. This year (2022) some impressive new SBCs are being released. One contender is Khadas VIM4. It would be great if the HA team could add an official HAOS build for this platform. Since they support VIM3, some groundwork has probably already been done.

Specs

Source: https://www.khadas.com/vim4#comp-l2v7460r1

Model Khadas VIM4
SoC  Amlogic A311D2 2.2GHz Quad core ARM Cortex-A73 and 2.0GHz Quad core Cortex-A53 CPU ARM Mali-G52 MP8(8EE) GPU up to 800MHz 8K 24fps decoder & low latency 4K H.264/H2.65 50fps encoder Support multi-video decoder up to 4Kx2K@60fps+1x1080P@60fps HDR10, HDR10+, HLG and PRIME HDR video processing TrustZone based security for DRM video streaming 
Coprocessor [1]  STM32G031K6 
SPI Flash  32MB 
RAM  8GB LPDDR4X 2016MHz, 64bit 
EMMC 5.1  32GB 
Wi-Fi  AP6275S Wi-Fi 6 Module 802.11a/b/g/n/ac/ax, 2T2R MIMO with RSDB [2] 
Bluetooth  Bluetooth 5.1 
LAN  10/100/1000M 
WOL [3]  Wake on Lan 
TF Card  Molex Slot, Spec Version 2.x/3.x/4.x(SDSC/SDHC/SDXC) 
USB HOST  x2 (1500mA & 1300mA Load) 
USB Type-C  USB2.0 OTG & USB PD 
VIN Connector  System Power Input 
Wide Input Voltage  Range from 9V to 20V 
HDMI Output  Type-A Female HDMI2.1, up to 4K2K HDR Video, Dynamic HDR, CEC and HDCP 1.4/2.3 
HDMI Input  Micro HDMI, up to 4Kp60 
DMIC  Stereo Digital Microphones 
V-by-One  8 lanes Interface, Resolution up to 4096*2160 30 Pin 0.5mm Pitch FPC Connector 
Touch Display  MIPI-DSI and eDP Combo Interface 4 lanes MIPI-DSI Interface, Resolution up to 1920*1200 or 4 lanes eDP Interface, Resolution up to 2560*1600 I2C and GPIO Signals for Touch Panel 40 Pin 0.5mm Pitch FPC Connector 
Camera  Interface: 4 lanes MIPI-CSI x2 Supports Dual Cameras Up to 16 MP ISP 30 Pin & 20 Pin 0.5mm Pitch FPC Connectors 
Sensor  KXTJ3-1057 Tri-axis Digital Accelerometer 
M.2 Socket  PCIe 2.0 (1 lane) M.2 2280 NVMe SSD Supported USB 2.0, I2S, I2C, GPIO, MCU-I/O 
RTC Battery Header  0.8mm Pitch Header 
Cooling Fan Header  4-Pins 0.8mm Pitch Header, with PWM Speed Control 
LEDs  White LED x1, Red LED x1 
40-Pins Header(2.54mm)  CPU: USB, I2C, I2S, SPDIF, UART, PWM, ADC, GPIO MCU: SWCLK, SWDIO 
Buttons  x3 (Power / Func / Reset) 
XPWR Pads  For External Power Button 
Mounting Holes  Size M2 x 4 
Board Dimensions  82.0 x 58.0 x 11.5 mm 
Board Weight  31g 
Bootloader  U-Boot 
Linux Kernel  Linux 5.4 
Linux Distros  Ubuntu 22.04 
Android  Android 11 
Khadas Only  Khadas TST [4] 
Khadas KBI 
OOWOW [5] 
Fenix [6] 
Compliances  CE, FCC, TELEC (Japan), RoHS 

[1] MCU: Power management, and boot media (SPI Flash/eMMC) setup.
[2] RSDB: Real Simultaneous Dual Band, which lets VIM4 and other devices transmit and receive data over two bands at the same time.
[3] WOL: Power on or wake up VIM4 remotely over LAN using an app or webpage.
[4] Khadas TST: Developers can enter upgrade mode easily. Press the function key 3 times within 2 seconds, works even if the boot loader is damaged.
[5] OOWOW: A standalone embedded service for seamless online OS delivery, device maintenance, and much more!
[6] Fenix Script: One-click script for building Linux Distributions.
[7] The current version of VIM4 does not include an NPU, future refreshed versions may include an NPU.

Odroid N2+ has an image because it’s the underlying hardware behind Home Assistant Blue.

No idea why the “ASUS tikerboard” has its own image, but generally speaking, it’s pretty unrealistic to expect an HAOS image for the hardware of the day, at least until Nabu Casa has become a mega-corpo :smiley:

The supported action plan would be to manage to have Debian 11 running on that board, then install Supervised, or to use a VM.

I agree. However the N2+ is not getting any younger. I think it is time for Nabu Casa to start looking for new, next-gen, easy-to-recommend hardware. And as I said, since they have a HAOS build for VIM3, some groundwork has probably already been done for the VIM4.

I would love official support on VIM4 - I have got HA running on Debian10 (with some changes to removed the unsupported messages) - I have no idea what is comtainined in the VIM3 as I dont have one - surely it must be the same Debian buster from Fenix

Richard

1 Like

I did notice that Fenix has got some Debian 11/VIM4 code… I built it and flashed - booted up. Its hot off the press for me, so no idea in detail what works/doesnt.

HDMI OUT [OK]
USB 2 [OK]
USB 3 [OK]
EMMC [OK]
ETHERNET [OK]
CPU 8 Cores [OK]
RAM 8GB [OK]
THERMAL [OK]
NVME [??]
miniPCIe [??]
WIFI [??]
BLUETOOTH [OK]
VBYONE [NOT RELEVANT]
HDMI IN [NOT RELEVANT]]

hi all,

Any updates about HAOS for VIM4?

I cant speak about HAOS , but I have debian11 running on VIM4 with HomeAssistant. It has some problems though - still working through them. It works as a base - just doesnt play nice with Coral and NVR features.

Can you share the image?

Thank you,
AP

So. i’ve build Debian 11 image, and able to install hassio.

Small script for Cassio installation:

#!/bin/bash

cat <<-EOF >> /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
net.ipv6.conf.eth0.disable_ipv6 = 1

# kernel.dmesg_restrict=0
EOF

sed -i '/boot_user_args/d'  /boot/uEnv.txt

cat <<-EOF >> /boot/uEnv.txt
boot_user_args='cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory systemd.unified_cgroup_hierarchy=0 apparmor=1 security=apparmor'
cgroup_enable=cpuset
cgroup_memory=1
cgroup_enable=memory
systemd.unified_cgroup_hierarchy=0
apparmor=1
security=apparmor
EOF

apt install apparmor jq wget curl udisks2 libglib2.0-bin network-manager dbus lsb-release systemd-journal-remote -y
apt install gparted xfsprogs mc vim

systemctl status systemd-journal-gatewayd.socket
systemctl enable --now systemd-journal-gatewayd.socket
systemctl restart  systemd-journal-gatewayd.socket
systemctl status systemd-journal-gatewayd.socket

curl -fsSL get.docker.com | sudo sh

wget https://github.com/home-assistant/os-agent/releases/download/1.4.1/os-agent_1.4.1_linux_aarch64.deb && \
    dpkg -i os-agent_1.4.1_linux_aarch64.deb &&\
    rm os-agent_1.4.1_linux_aarch64.deb

wget https://github.com/home-assistant/supervised-installer/releases/latest/download/homeassistant-supervised.deb && \
    dpkg -i  ./homeassistant-supervised.deb && \
    rm ./homeassistant-supervised.deb

Enjoy.

PS still waiting for official Cassio installation and official debian 11 image.

Nice! … I am making an image - will upload shortly -

just a note that ipv6 is needed for Thread/Matter to work :smiley:

UPDATE: I wont be uploading … 28GB image for a OOWOW emmc backup!