DEV Community

Xingliao Smart Home
Xingliao Smart Home

Posted on

Where you put the gateway decides how well the mesh underneath it works

Most gateway problems that get diagnosed as hardware faults are placement faults. The box is fine, the firmware is fine, and the ZigBee devices are fine. What is wrong is that the gateway is sitting in a metal cupboard behind the television, three metres of brick away from half the devices it is supposed to coordinate. Placement is the cheapest thing to get right and the most common thing to get wrong.

The gateway has two radios doing different jobs

A gateway is not one network device. It is two, connected internally.

On one side it has a Wi-Fi radio that talks to your router. On the other it has a ZigBee radio that talks to the mesh of devices underneath it. Those two links have completely different characteristics, and optimizing one often hurts the other.

The Wi-Fi side wants to be near the router, with clean line of sight and no interference. The ZigBee side wants to be near the devices, ideally central to them. Those two locations are frequently not the same place, which is why there is usually a compromise involved and why blindly optimising either side produces a system that half works.

Distance to the router matters less than what is between them

People tend to measure distance. What actually attenuates a signal is material.

Two metres of empty air costs you almost nothing. The same two metres through a brick wall, a concrete floor, or the back of a refrigerator costs you a great deal. Metal is the worst offender by a wide margin, and it is also the most common accidental obstruction, because gateways get put into cabinets, onto shelves next to amplifiers, and behind televisions.

Foil-backed insulation, mirrored glass, and the metal mesh inside some plasterboard all behave like partial shields. If a device on the far side of one of those drops off intermittently, moving the gateway a metre sideways on the same shelf will often fix it, because you are moving around the obstruction rather than getting closer to anything.

The things that quietly break a ZigBee signal

ZigBee shares spectrum with Wi-Fi, and the interference pattern is not intuitive. Within a building, the channels that overlap are the practical issue, and a Wi-Fi access point blasting on an overlapping channel will degrade a mesh noticeably.

USB 3.0 ports and hubs are a well-documented but rarely suspected source. An unused USB 3 cable or hub plugged in near the gateway raises the noise floor measurably, and moving either one resolves it.

Microwave ovens are the classic intermittent offender, because they only cause trouble for the ninety seconds they are running. A problem that reliably appears at dinner time and vanishes afterwards is almost always this.

Cheap LED drivers and some dimmer switches radiate broadly. A gateway mounted directly above a lighting transformer will behave worse than the same unit mounted a metre away, and nobody ever suspects the downlight.

Put it where the mesh needs it, not where the router wants it

Because the gateway bridges two networks, its position should be chosen primarily for the mesh, since the mesh link is the more fragile of the two.

Aim for somewhere central to the ZigBee devices rather than close to the router. Get it off the floor and off the ceiling; waist to shoulder height, in open air, performs better than either extreme. Keep it out of any enclosure, and especially out of metal ones.

If the router connection then becomes marginal, extend that side instead. Moving the access point, adding an access point, or running ethernet to the gateway fixes the Wi-Fi link without dragging the mesh to the router's location. It is often better to solve each side separately than to compromise one position for both.

Power and ethernet are worth planning

A gateway is infrastructure. Treat its power the way you would treat a router's, because when it goes down, everything that depends on local execution goes down with it.

Avoid putting it on a switched socket someone can flick off, and avoid sharing a power strip with something that draws large switching loads. If your automations include anything you care about during an outage, put the gateway on the same small UPS as the router, so both survive together.

If the unit supports ethernet, use it. A wired gateway takes its own Wi-Fi radio out of contention, removes one source of interference, and stops it competing with every other client for airtime. This single change resolves a surprising share of reliability complaints.

How to tell whether placement is your problem

Placements faults have a signature, and it is worth learning because it saves replacing hardware that works.

Symptoms cluster by location rather than by device. If several unrelated devices in one part of the building misbehave while identical devices elsewhere are fine, the gateway cannot hear that corner, and the devices are not at fault.

Behaviour changes when something else turns on. If reliability tracks the microwave, the television, or a particular light circuit, you have identified the interferer.

Symptoms improve temporarily after a reboot and then decay. That pattern points at a marginal link that re-establishes cleanly and then degrades, rather than at a device that has failed.

XingLiao builds smart home gateways with both ethernet and Wi-Fi uplink, alongside Tuya ZigBee and smart home devices from our own factory in Shenzhen.

The short version

Choose the gateway's position for the mesh it serves, keep it out of metal and off the floor, remove the interference sources nearby, wire it if you can, and put it on protected power. Roughly every intermittent "faulty gateway" report I have seen traced back to one of those five things, and every one of them costs nothing to fix.

Top comments (0)