Migrating from RPi3b to RPi4b Zigbee HAT Not Working Z2M Anymore

So I recently had my HAOS running on a Raspberry Pi 3b die due to another failed SD card, this was with the device supposedly using the attached SSD for data. I decided get a new Raspberry Pi 4b 8GB and have proceeded to migrate to it. I have been using a Zigbee HAT in my RPi4 with an external antenna. I have this device:

https://elekitsorparts.com/product/high-power-zigbee2mqtt-hat-for-raspberry-pi-cc2652p-zigbee-hat-for-raspberry-pi-home-assistant-cc2652p-zigbee/

My process was:

  1. Prepare RPi4 with new SSD install.
  2. Preconfigure RPi4 config.txt to disable BT & WiFi.
  3. Take a full backup of the HA system on the RPi3.
  4. Take a Z2M backup.
  5. Moved Zigbee HAT to RPi4.
  6. Moved backup to RPi4 SSD in the HA backups directory.
  7. Reconfigured IP address for RPi4 to assume the RPi3 IP.
  8. Started up the new RPi4.
  9. Created a temp account/setup.
  10. Logged in under temp settings and restored backup.

I had some issues with the add-ons not showing as started but after removing them all, manually installing them then restoring just the add-ons from the full backup they were all working again.

The problem Iā€™m faced with now however is that all of my Zigbee devices are no longer working. I setup the Zigbee HAT on my RPi3 a couple of years ago now and donā€™t recall having to do anything special other than disable the on-board Bluetooth & WiFi.

Actually after the RPi3 has gone down I was able to rebuild it with a new SD card while I was waiting for the RPi4 to arrive. When I rebuilt the HA setup on the RPi3 I installed a fresh copy of HAOS on the SD card and again just disabled the Bluetooth & WiFi and the Zigbee devices all worked without an issue.

Z2M logs indicate that it is starting up just fine, using the same serial port device as the RPi3 has, and if I try changing it to something else it fails to start, so it seems like it is able to take to the HAT.

Something different with the RPi4 hardware setup is that I did plugin the included case fan to a GND & 3.3v connector farther down the GPIO header so that the Zigbee HAT could still be plugged in. Iā€™m not sure if that fan could be causing some issues. I could probably remove the fan easy enough.

Any ideas would be a huge help. I really donā€™t want to have to re-setup all of my Zigbee devices again, and donā€™t really want to invest in a new coordinator either. Thanks!

OK, so after going through and reading more on the whole UART setup, and trying some different combinations, I finally decided to just disconnect the CPU fan. I rebooted with essentially the configuration I had before and now all of my Zigbee devices are working on Z2M again. I had it connected to pins 17 & 20 to give me a 3.3v & GND but somehow that must have been enough to cause a problem. Perhaps the fan was causing some interference? I was using the blue led fan instead of the standard fan so not sure if that could have something to do with it.

To be honest I havenā€™t learned much about the GPIO header to really understand how everything is setup on there. The Zigbee HAT uses up all of the other pins with voltage to power a fan so I was just using what was open.

Hi Tim,

I reply to your post because I plan to do the same - migrating an existing Homeassistant installation from Raspberry 3 to Raspberry 4.

Did you made it finally working with your ā€œmigration approachā€ ?

And from looking into documentation about Raspberry GPIO Pins we (you and me :upside_down_face:) should be able to use also Pins left beside 23 and left beside 10 to connect the fan. Did you tried that out ?

BR

Michael

@dominator30 so initially I did finally get things sorted I ended up attaching the fan leads to pins 17(3.3v) & 34(gnd). One other key piece was that I needed to make sure I updated the RPi 4 to ensure that Bluetooth & WiFi were disabled. At that point I performed a full system restore and the entire Zigbee setup was restored.

Now, all that being said just in the past few days everything came to a screeching halt with my entire Z2M setup. Itā€™s not clear to me if it was something with the latest HAOS/Home Assistant Supervisor/Z2M updates, but rolling back to a previous working backup didnā€™t manage to restore my Zigbee devices to working order. You can read more about it here:

I ended up buying a Sonoff Zigbee 3.0 Dongle Plus and USB extension with next day delivery from Amazon, which just arrived today and I was able to migrate to the new coordinator(I flashed the latest Z-Stack firmware on it first) and get all of my devices back in working order. When I moved to using the Sonoff I ended up putting the CPU fan leads on pins 4(5v) & 5(gnd).

I canā€™t really explain what happened. I did see a very strong hidden SSID 2.4GHz network showing up on channel 1(which can interfere with with Zigbee channel 11, the default) however, I decided to leave things be first and try the Sonoff and Iā€™m not experience interference that I can tell yet. Weā€™ll see how things go and if things start acting up this may have been all an issue with interference. I will say that since I am using an SSD over USB3 on the RPi 4 that maybe I was just getting lucky this past month with interference.

Hi @timnolte

thx for the detailed answer, for Zigbee I use the ā€œDeconz RaspBee 2ā€ ā€¦ letā€™s see how far I can keep it working after platform migration.

Iā€™ll keep you updated :slightly_smiling_face:

BR
Michael

Hi @timnolte

Iā€™m finally done with my migration / upgrade to a RPi4b, but Iā€™m struggling now with Deconz Addon ā€¦ it throws a ā€œDevice ā€˜/dev/ttyAMA0ā€™ does not exist in deCONZ (core_deconz).ā€ against me :unamused:

How did you performed this step ?

I flashed the SD with Raspberry Image tool and restored the backup during Homeassistant startup - no choice to edit the config.txt in Raspberry /boot folder.

BR

Michael

@dominator30 I donā€™t use Deconz I use Zigbee2MQTT. I did have some initial issues though related to that and I needed to make sure that I configured my RPi4 to disable the built-in Bluetooth & WiFi. Mounted my SD card on my Linux laptop and edited the configuration file before booting it up on my RPi.

I actually ended up having problems with my Zigbee Pi Hat and ended up switching to a Sonoff USB stick on a long USB extension. I was using a USB3 SSD which I think also started giving me issues with the HAT.

Ok, understood ā€¦ but how to locate the config file ?

If I mount the partitions of SD card in my linux laptop there isnā€™t any ā€œconfig.txtā€. Even not in some path like ā€œ/mnt/bootā€ ā€¦

I know the file from basic Raspberry installation, but not in HA :smiling_face_with_tear:

Finally I made some progress : Where's the config.txt file :slight_smile:

1 Like

And this is what I have to add to ā€œconfig.txtā€ to have RaspBee 2 working on my Raspberry 4 B

enable_uart=1
dtoverlay=disable-bt

This made RaspBee2 available via ā€œ/dev/ttyAMA0ā€ after a restart.

Just if others are struggling in a similar way :innocent:

Ah yes, sorry, Iā€™m away on vacation and havenā€™t really had the time so any digging up of what I configured. Whatā€™s interesting is that I donā€™t recall having to explicitly turn on enable_uart. Though perhaps I finally did.