Pi OS (instead of HA OS) on Yellow?

I’ve received this fancy brick of hardware called Yellow and did initially setup the device as stated in the docs (https://yellow.home-assistant.io).
Since I did also insert a M2 SSD and did also make a lot of good experiences with a “manual” install on the RPI3, I somehow disliked the automagically installed HA OS with Supervisor as it makes me feel somewhat “claustrophobic”.

DId someone already install Pi OS in Yellow and is maybe also running Home Assistant this way on it?
Not sure, if just installing Pi OS with the imager tool and then setting up hass via vEnv would be it in terms of any “special” hardware to be considered (maybe by the kernel?).
I am also curious in knowing how to completely bypass the eMMC and just use the SSD at installation time, if anyone already came to that point.

3 Likes

Got it working right now!

  • rpiboot (switch both available jumper on the board to “USB” instead of “UART” and enable “USB-C Recvry”).
  • Flash Pi OS Lite 64-bit via PI imager
  • Get (e.g. flash to USB) the Yellow Pi OS image
  • Copy the following from the Yellow Pi OS image
    – bcm2711-rpi-cm4-ha-yellow.dtb
    – overlays/rpivid-v4l2.dtbo (Not sure, if really needed)

cmdline.txt

console=ttyAMA2,115200n8 root=PARTUUID=21e60f8c-02 rootfstype=ext4 fsck.repair=yes rootwait quiet init=/usr/lib/raspberrypi-sys-mods/firstboot systemd.run=/boot/firstrun.sh systemd.run_success_action=reboot systemd.unit=kernel-command-line.target

config.txt:

# From Yellow 
disable_overscan=1
gpu_mem=16
dtoverlay=miniuart-bt
dtoverlay=krnbt=on
dtoverlay=vc4-kms-v3d-pi4
dtoverlay=imx219
enable_uart=1
uart_2ndstage=1
device_tree=bcm2711-rpi-cm4-ha-yellow.dtb
# Mods in the context of the original file
dtparam=audio=off
camera_auto_detect=0
display_auto_detect=0
#

comment out (put # in front of the line) the following:

dtparam=audio=on
camera_auto_detect=1
display_auto_detect=1
dtoverlay=vc4-kms-v3d

At the moment I am absolutely not sure, if all these settings are really needed, but it works at least.
As soon as I have a bit more time, I will try to move the OS from the eMMV over to the NVMe and try dis wipe and/or disable the eMMC completely.

Thanks to @agners for giving some helpful input and pointing me to the right path.

1 Like

Thanks for the tip with cmdline.txt and config.txt i was not aware that i needed to do changes in those. Did you get Zigbee to work with that? That’s right now what isn’t working for me. I can do the changes in config.txt fine but something is not working with the firstrun.sh in cmdline.txt

I don’t use firstrun.sh at all as I was using the default rpi lite 64bit image instead of the HAOS. AFAIR this vanilla does not include any firstrun.sh (please correct me, if I am wrong).
Zigbee is currently not working for me.
Maybe someone has an idea what needs to be done (or even how to check) to get the MGM210P (which is actually the Zigbee chip) running. Is there any module to be loaded maybe?
The device itself looks somehow existing for me as ttyAMA0 is automagically linked to /dev/serial0.

Status 20221109:
Yellow is booting from NVMe with PiOS (Raspbian) Lite 64bit.

What is working:

  • Start Yellow from NVMe (/boot on vfat, everything else on ext4)
  • Bluetooth (obviously via MGM210P)
  • hass 2022.11 via vEnv

Currently not working:

  • Zigbee (MGM210P)
  • Boot from LVM (/boot on vfat, / and others on LVM)

Quick feedback:
Everything is working now - after fiddling around quite heavily with the boot options.
I will shortly clean up the mess a bit and then write down the verified steps here.

How does the system look as of today (aka what is working):

  • Yellow with NVMe booting from /boot on vfat and all other parts (incl. /) from LVM
  • Hass Core from vEnv
  • On-board Bluetooth and Zigbee (SiliconLabs MGM210P)

To come shortly:

  • Aeotec Z-Stick Gen 7 via Zwave JS Docker container

I’m still interested in how you got Zigbee to work, for now i have used my old Zigbee Stick. If you have time it would be great if you can point me to the right information.

Same, haven’t found out how to enable Zigbee yet.

@linuxguru I would be also very interested in how you got the Zigbee module working. Can you please provide us with the correct boot options? Thank you very much.

@laurius, @MrPlow254

Okay, I gave it a shot in case somebody else stumbles upon this, just follow the steps below and the device should pop up during the onboarding process with HA (at least with Docker), but the same should apply with a virtEnv installation.


Prerequisites

  • Home Assistant Yellow with Raspberry Pi OS on the CM4 installed
  • SSH enabled

Copy drivers, edit boot and run in docker

  1. Flash Installer for HA Yellow on a USB stick

  2. Copy to existing HA Yellow Installation (on RasPi OS) from USB stick directory:

    scp .\bcm2711-rpi-cm4-ha-yellow.dtb user@yourdeviceIP:/home/youruser
    scp .\overlays\rpivid-v4l2.dtbo user@yourdeviceIP:/home/youruser
    
  3. copy files from home to boot directory (permissions are overwritten):

    sudo mv bcm2711-rpi-cm4-ha-yellow.dtb /boot/
    sudo mv rpivid-v4l2.dtbo /boot/overlays/
    
  4. Replace the console= in cmdline.txt with console=ttyAMA2,115200n8

  5. Backup original config.txt file: sudo cp config.txt config.bkp

  6. Edit the config.txt file to look like this (based on HA Yellow config.txt):

    # Additional overlays and parameters are documented /boot/overlays/README
    
    # DISABLE audio (loads snd_bcm2835)
    dtparam=audio=off
    
    # DO NOT Automatically load overlays for detected cameras
    camera_auto_detect=0
    
    # DO NOT Automatically load overlays for detected DSI displays
    display_auto_detect=0
    
    # Enable DRM VC4 V3D driver
    #dtoverlay=vc4-kms-v3d
    #max_framebuffers=2
    
    # Run in 64-bit mode
    arm_64bit=1
    
    # Disable compensation for displays with overscan
    disable_overscan=1
    
    # Make room for larger initramfs
    gpu_mem=16
    
    # fixes rpi (3B, 3B+, 3A+, 4B and Zero W) ttyAMA0 serial console
    dtoverlay=miniuart-bt
    
    # enable autoprobing of Bluetooth driver without need of hciattach/btattach
    dtoverlay=krnbt=on
    
    dtoverlay=vc4-kms-v3d-pi4
    dtoverlay=imx219
    
    # Enable UART debug prints
    enable_uart=1
    uart_2ndstage=1
    
    # Use Yellow device tree
    device_tree=bcm2711-rpi-cm4-ha-yellow.dtb
    
    [cm4]
    # Enable host mode on the 2711 built-in XHCI USB controller.
    # This line should be removed if the legacy DWC2 controller is required
    # (e.g. for USB device mode) or if USB support is not required.
    otg_mode=1
    
  7. reboot HA Yellow

  8. Install Docker according to Install Docker Engine on Debian | Docker Documentation

  9. Install docker-compose: sudo apt install docker-compose

  10. Add user to docker group: sudo usermod youruser -aG docker

  11. Log out and into SSH again

  12. Make a docker-compose.yml:

    version: '3.7'
    services:
      homeassistant:
        container_name: home-assistant
        image: homeassistant/home-assistant
        volumes:
          - /home/youruser/hass-files-tmp:/config
          - /etc/localtime:/etc/localtime:ro
          - /etc/hosts:/etc/hosts:ro
        devices:
          - /dev/ttyAMA1:/dev/ttyAMA1
        network_mode: host
        restart: always
    
  13. Pull image: docker-compose pull

  14. Run container: docker-compose up -d

  15. Go to http://yourhost.lan:8123/, finish onboarding process, add ZHA. Chip should be visible at /dev/ttyAMA1.

image

Hope this helps.

Best,
Chris

1 Like

Thanks this worked now for me on a new install. I thought i did the same steps before but it didn’t work for some reason. So it might help to do this on a fresh install if not working.

I was able to get the ZigBee host device to show in HA now. If someone wants to use HA supervised on Raspberry Pi OS 64-bit CGROUP will have an error. The latest docker uses version 2 while home assistant uses 1. I added “systemd.unified_cgroup_hierarchy=0” to the start up script. AppArmor will also be disabled by default. Add “apparmor=1 security=apparmor

Also for the supervised version do not follow step 8 to 15. You also do not need to reinstall your OS if you already setup everything as Raspberry Pi OS 64-bit w/ HA supervised.

For the cmdline.txt file:

console=ttyAMA2,115200n8 root=PARTUUID={keep with whatever your system has} rootfstype=ext4 fsck.repair=yes rootwait *systemctl start system-resolved apparmor=1 security=apparmor systemd.unified_cgroup_hierarchy=0

That being said. I cannot for the life of me figure out how to connect a device to this ZigBee host. I have attempted to sync a Philips hue switch but it will not find one. Any suggested devices that are easy to test with?

– Edit –
I was able to connect to the Philips hue switch everything about that device works (battery level, and 4 button type clicks). So this discussion post is a huge success.

scp .\bcm2711-rpi-cm4-ha-yellow.dtb user@yourdeviceIP:/home/youruser
scp .\overlays\rpivid-v4l2.dtbo user@yourdeviceIP:/home/youruser

I was using the default rpi lite 64bit image instead of the HAOS
I found cat/sys/class/thermal/thermal_ Zone 0/temp is invalid

scp .\bcm2711-rpi-cm4-ha-yellow.dtb user@yourdeviceIP:/home/youruser
scp .\overlays\rpivid-v4l2.dtbo user@yourdeviceIP:/home/youruser

I was using the default rpi lite 64bit image instead of the HAOS
I found cat/sys/class/thermal/thermal_ Zone 0/temp is invalid

Having the same issue of “/sys/class/thermal” entries disappearing.

root@yellow:/# cat /sys/class/hwmon/hwmon0/temp1_input
cat: /sys/class/hwmon/hwmon0/temp1_input: No such file or directory

It was working before, around February, when I did the initial setup and had a script reading and logging temperature from /sys/class/hwmon/hwmon0/temp1_input. I don’t know which upgrade broke it, as the yellow was a long time without being updated, but it definitely broke when I upgraded last night.

Following errors now show up in dmesg

[    1.533544] thermal_sys: Failed to find 'trips' node
[    1.533569] thermal_sys: Failed to find trip points for thermal id=0
[    1.533599] bcm2711_thermal fd5d2000.avs-monitor:thermal: error -EINVAL: could not register sensor: -22
[    1.533630] bcm2711_thermal: probe of fd5d2000.avs-monitor:thermal failed with error -22
...
[    5.356090] i2c-mux-pinctrl soc:i2c0mux: Cannot look up pinctrl state i2c_csi_dsi: -19

Also, when I boot the yellow with the device tree commented:
#device_tree=bcm2711-rpi-cm4-ha-yellow.dtb

no errors are shown in dmesg and thermals are back:

root@yellow:~# cat /sys/class/hwmon/hwmon0/temp1_input
57452

It seems the issue started to show up after upgrading to kernel 6.1

Following seems to be somehow related:

Ok, after applying the home assistant yellow patches on top of the raspberry/linux 6.1 kernel (branch rpi-6.1.y), I was able to get the thermals back:

root@yellow:~# ls -lah /sys/class/thermal/thermal_zone0/
total 0
drwxr-xr-x 4 root root    0 May 29 23:57 .
drwxr-xr-x 3 root root    0 May 29 23:57 ..
drwxr-xr-x 3 root root    0 May 29 23:57 hwmon0
drwxr-xr-x 2 root root    0 May 30 00:05 power
lrwxrwxrwx 1 root root    0 May 29 23:57 subsystem -> ../../../../class/thermal
-r--r--r-- 1 root root 4.0K May 30 00:05 available_policies
-rw-r--r-- 1 root root 4.0K May 30 00:05 integral_cutoff
-rw-r--r-- 1 root root 4.0K May 30 00:05 k_d
-rw-r--r-- 1 root root 4.0K May 30 00:05 k_i
-rw-r--r-- 1 root root 4.0K May 30 00:05 k_po
-rw-r--r-- 1 root root 4.0K May 30 00:05 k_pu
-rw-r--r-- 1 root root 4.0K May 30 00:05 mode
-rw-r--r-- 1 root root 4.0K May 30 00:05 offset
-rw-r--r-- 1 root root 4.0K May 30 00:05 policy
-rw-r--r-- 1 root root 4.0K May 30 00:05 slope
-rw-r--r-- 1 root root 4.0K May 30 00:05 sustainable_power
-r--r--r-- 1 root root 4.0K May 30 00:05 temp
-rw-r--r-- 1 root root 4.0K May 30 00:05 trip_point_0_hyst
-r--r--r-- 1 root root 4.0K May 30 00:05 trip_point_0_temp
-r--r--r-- 1 root root 4.0K May 30 00:05 trip_point_0_type
-r--r--r-- 1 root root 4.0K May 30 00:05 type
-rw-r--r-- 1 root root 4.0K May 29 23:57 uevent
root@yellow:~# cat /sys/class/hwmon/hwmon0/temp1_input
55991

I created a gist, in case someone else wants to give it a try, until NabuCasa releases official 6.1 kernel support for the HA yellow:

One of the errors did not yet disappear tho:
[ 5.356090] i2c-mux-pinctrl soc:i2c0mux: Cannot look up pinctrl state i2c_csi_dsi: -19
EDIT: Updated the gist, now the error doesn’t show up anymore

Zigbee radio is working in Home Assistant, using device /dev/ttyAMA4

Note: I had to comment the “audio” label in bcm2711-rpi-cm4-ha-yellow.dts, I don’t know the side effect of doing so, but without that it wouldn’t build. I’m pretty sure something else will be broken, because the cm4 code from kernel 5 to 6 changed a bit. I guess NabuCasu will also need to do some refatoring, since they based the yellow dts on the cm4 dts.

Sorry but I don’t understand how you got working Bluetooth vie MGM210P. Yes, in theory this radio chip can do Bluetooth but I cannot find any information that it is supported by Homeassistant. Even if I install HAOS on yellow it uses Bluetooth on CM4 module not MGM210P.

Looks like my Pi OS is stuck in halt state after install. Any other people experienced that after following the guide above?

You need a different firmware for Bluetooth on the zigbee chip. Default it has been flashed with the EmberZNet firmware that only uses Zigbee. You need the RCP-firmware for other protocols and a bunch of other software to get Bluetooth working via the SILabs chip.

I disabled Bluetooth on my Yellow and using OpenMQTTGateway to get the Bluetooth-data. Bluetooth will fry your SSD in 2 years because of all the caching data it receives and writes to local SSD.

Installing the overlay and using the extra options in config.txt worked like a charm!