HA on Raspberry Pi Compute Modules?

Anyone planning on deploying HA on Raspberry Pi Compute Modules?

1 Like

After watching this Video, I will definitely look into it - I mean plugging in a PCIe SSD drive directly must be a huge improvement in stability/reliability and performance. I wish they had implemented an actual M.2 slot, but well, we can’t have everything.

(would this require HASSOS adaptations, or would it just work?!)

I’m curious what the price will be - currently it’s sold out everywhere with no estimate on when/whether it will be back in stock…

1 Like

“With the new kernel and U-Boot Home Assistant OS can now also run on the Compute Module 4 as well as the Pi 400 (the keyboard).”

1 Like

i have replaced my rpi 4 with compute 4. the compute 4 module has far better bluetooth range and less interference on the zigbee. still missing an adapter for m.2 so I can test external data harddisk

1 Like

This CM4 carrier board has a slot that might be of interest for an nvme drive: https://liliputing.com/2021/02/tofu-carrier-board-for-the-raspberry-pi-compute-module-4-supports-nvme-ssds-or-4g-lte-network-cards-among-other-things.html - not cheap though!

This might be an option and looks promising.
Raspberry Pi boots off an NVME SSD, natively!

So anyone do it yet?!

Home Assistant OS Release 5 now supports the Pi CM4, I have ordered a MirkoPC carrier board ( MirkoPC -> CM4 carrier board | Hackaday.io ) . It will be a couple of months before it arrives.
( Home Assistant OS Release 5 - Home Assistant )

Let us know when you got it all setup!

Ended finding an i5 NUC for $100, so I went that route with a M.2 SSD.

Hi all,

I just started playing with the following:

  • CM4 (2GB, no eMMC, no wifi, just first try , and for sure better than my current 3b)
  • this carrier board: CM4-IO-BASE-B - Waveshare Wiki
  • an NVMe disk

Want use a native HASSOS but sofar it seems not to be working.

Steps:

  • install RaspberryOS on an SDcard, and run rpi-update.
  • tweak with rpiboot, to add nvme support: current raspberry imager does not support enabling NVMe, so you have to git clone the rpiboot code (GitHub - raspberrypi/usbboot: Raspberry Pi USB booting code, moved from tools repository) on a linux machine and make a bootloader update.
  • “etcher” hassos on the NVME disk by using an nvme-to-usb adapter.
  • try to boot with the SdCard removed (boot sequence should use NVMe at first but better safe than sorry)

Sofar:
The native NVMe boot claims I need an updated “software” (and I just run both up-to-date bootloader code and cm4 firmware), so it seems that something went wrong.
Trying to clone current raspberryOS on sdcard to NVMe and verify whether my setup is botched or there is some tweak on HASSOS to be performed.

stay tuned

m.

Update:
The issue was due to start4.elf.
Copying the file to the first partition let me get past this… landing to nothing.
Problem now is that HassOs does not use same kernel file placement as RaspBian so I have to tweak a bit the installation, or fallback to less desiderable solutions such as running HA on top of a standard Rasbian + docker.

As a test, I used RaspberryOS’ own SDcard copy, and cloned the SDcard content to NVME. and it boots correctly.

An important note for those trying to install hassos/haos on a CM4: The following has to be added to /config.txt in the boot partition:

device_tree=bcm2711-rpi-cm4.dtb
dtoverlay=dwc2,dr_mode=host

This has been mentioned in an GitHub issue – I was not able to find that info anywhere else.

Hi all,

I’ve been lurking here for a while and tried the same as @murraythegoz for the CM4-IO-BASE-A, with the same result of

Yesterday I stumbled across Home Assistant OS Release-7, which adds

NVMe boot support for RPi Compute Module 4 for U-Boot

and also the newest beta bootloader.

I flashed the bootloader on my 8GB CM4 Lite and HA on an NVME SDD and have native HA OS running now!

I haven’t tried installing the OS Release 7 without updating the bootloader, but I suspect the “added support for FAT16” in pieeprom-2021-10-04.bin to be crucial.

Hi
I manage to get hold of cm4 with eMMC storage and PiTray Mini
Manage to Install Hassio and boot from eMMC

Installation steps are as follow:
[Home Assistant Raspberry Pi CM4 – installation guide – Abu's Blog!](Home Assistant Raspberry Pi CM4 – installation guide)

Thanks
Abu

Well, just installed HA 7.6 on CM4, version with 4Gb ram and 16Gb flash. Since it’s new board, bought in April 2022, decided to try without any updates. Using WaveShare CM4-IO-BASE-A baseboard.

Installed rpiboot and Raspberry Pi Imager on my Windows 11 pc, and just set the boot switch to OFF per manufacturers programming guide (this board has switch, no jumpers), and started rbiboot and then imager. Raspberry Pi Imager offers choice of operating systems and HA 7.6. (currently newest) is offered. Image installed and verified. After that, shut down CM and switched boot to eMMC. And yes, it boots from eMMC and can be reached using browser.

Next week I’m supposed to receive nvme ssd-drive, since it worked like charm with eMMC using Raspberry stock utilities, will try same method for nvme install. WaveShare CM4-IO-BASE-A has native nvme interface.

Looks like no more need to access command line or using anything extra. Didn’t enable USB separately, since I’ll be using Z-wave.me pro hat for z-wave and have no use for USB.

1 Like

I have the same hardware and everything worked the same. I am waiting for your detailed description of installation on NVMe SSD

After installing nvme-drive, in this case 256GB SK Hynix SSD (BC711, an low cost model intended for compact laptops) I did following to install Home Assistant to nvme:

  1. backed up Home Assistant from eMMC (remember, I had it already on eMMC)
  2. installed Raspbian to eMMC using imager, overwriting my current HA setup. This may be unnecessary, but is fast thing tho do and allows later easily install Home Assistant OS
  3. installed Home Assistant to nvme-drive from Raspbian disk imaging tool, using gui version. It offers Home Assistant in list of operating systems and always loads the newest version. It also configures system to boot from nvme.
  4. After installing Home Assistant, switched boot to nvme-drive

This way, I have thwo operating systems on my CM4. Raspbian on eMMC and Home Assistant on nvme. There were some issues on Home Assistant version 7.7 or 7.8, that prevented nvme booting. Fortunately I had Raspbian on eMMC, simply removed nvme, formatted it in external usb-enclosure, put it back into Rpi, boot into Raspbian and reinstalled Home Assistant. I’m not *nix guru, as such there was probably unnecessary steps, but having Raspbian on eMMC may help recovering from certain issues, besides, if you have that eMMC not needed for HA, why not use it for helping installation/recovery?

If you need to modify config.txt, Raspbian can do that for HA install on nvme. I know there is possibility of using SSH, but why bother, when there is simpler way?!

To sum it up, installing HA on CM4 is easy nowadays, same thing for CM4 with nvme. It’s goddamn fast compared! And now I don’t need to worry about memory card or eMMC wearing, nvme is much more robust on wear leveling. I setup MariaDB for short term storage (30 days) and Influx to store rest of the things for five years (including energy consumption, outdoor temps and my heating system parameters).

2 Likes

Thought I would bump this thread for @tonybunce and anyone else who has a CM4 on hand and had the misfortune of having their HA Yellow ship date slip, and slip, and slip, and needs to move forward with another option.

I recently picked up a CM4-IO-BASE-BOX-B from Amazon. Similar to the Yellow, the unit has a real-time clock, and an M2 slot (2242 max size) for an NVMe. It also has a fan, and a full GPIO header. I also found another model CM4-POE-UPS-BOX, that adds PoE, on-board UPS and a full-size (2280) NVMe slot. The only thing really missing is the on-board Zigbee/Thread radio.

In my setup I am using a raZberry 7 Pro for Z-Wave. The CM4-IO-BASE-BOX-B has an antenna hole intended for the CM4’s on-board WifI/BT, but it worked perfectly for the external Z-Wave antenna. The only modification I had to make was to cut one of the bolts securing the fan, as it was hitting the raZberry 7 module. Otherwise the unit is working great. I wish they would have been more transparent with the Yellow ship dates… I would have gone with this option months ago, as I desperately need to migrate off of my degraded SmartThings environment and cannot wait till the end of January (or later) for a Yellow.

Below is my boot/config.txt options which enable the real-time clock and fan speed control to work with HA OS.

# Enable primary UART console for GPIO
enable_uart=1

# Free up full-fledged PL011 UART for GPIO
dtoverlay=miniuart-bt

# Disable audio (needed for RTC)
#dtparam=audio=on

# Enable USB Ports
dtoverlay=dwc2,dr_mode=host

# Enable RTC
dtparam=i2c_vc=on
dtoverlay=i2c-rtc,pcf85063a,i2c_csi_dsi

# Fan Controller
dtoverlay=i2c-fan,emc2301,i2c_csi_dsi,midtemp=45000,maxtemp=50000

2 Likes

I’ve just got HA OS up and running on the same baseboard (though I intend to re-use an Aeotec Z-stick 5) rather than a raZberry.

Hence i’ve been attempting to edit boot/config.txt to enable USB (wasn’t aware of the other edits you posted, but will also add those…thank you!).

How have you edited the boot/config file?

While flashing the emmc was fine, I can’t successfully mount the ha os pi on a mac for editing (i can mount it if i flash it with rpi os, but not with ha os. Have also tried SSH to port 22222 but thus far no joy. My next planned attempt is to find another pi and mount it to that.

The only other issue i struck with this base board is that the box only fits a smaller format than typical nvme drive (max 2242mm) which is remarkably hard to find at reasonable cost. Still waiting for mine to arrive, so currently everything is happening on emmc.

I’m using SSH on port 22222. There is an add-on that makes it easy to install your cert for access (you can’t just use a password). I used Putty Keygen on Windows to generate my key pair. I’m not sure how to do that in macOS off the top of my head, but if you also have iOS devices, there is the excellent SSH client Prompt, that will generate keys.

thanks for the description. I really don’t know what i’ve been screwing up, but I haven’t been able to get into port 22222 inspite of configuring the add-on (again-and-again).

Good news, however, is I was able to mount the compute module emmc using rpimount on another pi. A tangle of usb cables and powered hub was required to keep everything adequately powered (insufficient power to mount directly from another pi), but otherwise quite straight forward.

(And the fan is way quieter on the board - it starts and stops a lot…assume that’s normal…).