Optimal Raspberry Pi Setup
Optimal Home Automation Gateway Setup
With over 10K zzh in the field and more than 1500 support tickets answered, here's our recommendations for an optiaml smart home gateway setup.
You should consider having your home automation gateway to be Using WiFi/Bluetooth or any other 2.4GHz radio in close proximity, you will have signal issues Using
#1 - Set up your smart home gateway to be an independent appliance
Raspbery Pi and various other single board computers are affordable enough, setting up a dedicated "appliance" for your smart home is our top recommendation.
Expecially if you're just starting out, using something along the lines of Homeassistant OS will help you get up and running very quickly and make your life easier in the long run as they will have the necessary mechanisms to keep your setup up to date with the newest versions of software. They also either offer backup mechanisms or clear instructions on taking backups so you can recover from downtime easily should it occur.
Given that there won't be anything else running on this board, chances of something breaking and taking down your smart home network is less likely. Even in the case of hardware failure, you should be able to recover from a backup fairly easily as these pre-built solutions will have better defined mechanisms than a homebrew setup. This will help a lot with your stress levels when your partner or co-habitants ask why the lights stopped working while you're trying to fix everything.
#2 - Used wired ethernet and disable WiFi/Bluetooth
WiFi, Bluetooth and Zigbee all use the 2.4GHz wireless spectrum and having all radios operating at the same time will cause interfence, degrading the performance of your Zigbeee network. To prevent this, disable the WiFi and Bluetooth interfaces on your host and use wired Ethernet for connectivity. This also allows you to power your Raspbewrry Pi via Power-over-Ethernet for a single cable deployment using the zoe2 Radio + PoE addon for the Raspberry Pi.
If you'd like to take this one step further and optimise your Zigbee network by picking a channel that is lesser utilised in the 2.4GHz spectrum, have a look at this article.
#3 - Do not use USB-SATA adapters
If you're following our advice from point 1 and setting up a dedicated appliance for your smart home gateway, you won't be needing the speed/capacity of an SSD and using a high quality SD card will be adeaute for most use cases. Do not buy mystery meat SD cards and no, the SD card you had lying around from 6=7 years ago is not going to cut it. Go for "A" speed grade "high endurance" SD cards from the known big names which should provide stable enough storage for a dedicated gateway that can run many years. Also don't forget to take regular backups so you can recover from hardware failure quickly.
There are three reasons why we suggest against using SSDs:
a) USB3 and 2.4GHz spectrum interference has been a known problem for a very long time, here's a link to a whitepaper published by Intel on the subject from 2012. b) Most USB-SATA adapters sold, especially the cheaper "plug-in" types sold on Aliexpress and other marketplaces are terrible EMI aggressors. c) SSD modules themselves appear to generate a fair bit of noise, especially during short bursts of writes.
EMI and compliance are complicated subjects and in an ideal world this should not be an issue but . Radio devices are, by their very definition, highly efficient receivers and if there is electrical noise geenrated by other devices in the frequency band the radio is operating at, it will be picked up. The noise generated by other devices in
If you're insistant on using SSDs, here's some pointers that might help
a) Connect your radio stick to a USB2 port using a high quality, shielded, extension lead and position it as far apart from the USB-SATA device as possible. Although this is a good start, it is not always enough as electrical noise propagates throughout the circuit. Also worth noting that some USB extension leads, especially slimmer ones, are known to have inadequate or simply no shielding at all which can exacerbate the problem as without shielding you simply have more conductors to pick up noise.
b) Dont use the very cheap "plug-in" type USB-SATA adapters, instead go for shielded metal enclosures that you can attach to your Pi with a high quality, shielded, USB cable. This will
#4 - Place your radio stick far away from the host, using a high quality shielded USB3 cable.
This is why we ship zzhp with the USB "elbow" and custom double sided pads. A DIY version that can be used with zzh is released in this reposiryt
If you'd like a more permanent fix, we also released a 3D printable "screw mount".
Virtually all the support tickets we receive around poor performance and/or connectivity issues are caused by points 2 and 3 discussed above. While EMI is a complicated subject, here's an article written on this very subject by James Pawson from Unit 3 compliance, using zzh and a Raspberry Pi to demonstrate the interference caused by WiFi and USB-SSDs.
Troubleshooting
-
Are you using an SSD disk with a USB-SATA adapter in close proximity to your radio stick?
-
Are you using a wired ethernet connection?
-
Do you have any other USB devices, especially other radios, connected to the host in close proximity to your radio stick?
-
Are you using an extension lead to place your radio stick further away from the host it is plugged in to?
-
Have you placed your radio stick away from metal ojectsw with a clear βline of sightβ to your other wireless devices?
Disable WiFi and Bluetoothβ
To prevent radio interference with Zigbee, the built-in Bluetooth and WiFi radios should be disabled. A wired Ethernet connection is strongly recommended as you will, without a shadow of doubt, have better Zigbee performance with other radios disabled.
Edit /boot/config.txt as root and append the following to the end of the file:
dtoverlay=disable-bt
dtoverlay=disable-wifi
Reboot the Pi and verify that both WiFi and Bluetooth interfaces are disabled by observing the outputs of ifconfig and hciconfig.