Using EM3581-based controller as router

I’m modifying a cheap zigbee hub to work as an HA controller with direct connection. So far so good, thanks to this post and their developments I have an implementaton that works as a controller. However I’m wondering if it’d be possible to make the controller act as a router instead. I was able to find router firmware for TI chips, and even firmware builders for end devices, but nothing for the EM3581 so far.

One thing I was able to try was using bellows to join the network using bellows join, but that only joins the device as an end device, meaning no routing. Even if I manually edit the bellows code to join it as a router, the onboarding process gets stuck at the “Starting interview” step. I’m not sure if this is because fundamentally the controller firmware is not able to act as a router, or if there’s something wrong with how it joins the network (aka something that could be fixed).

Is it possible to make the controller join as a router using bellows? Do I need to flash a different firmware? Where can I find router firmware? Would it be an option to just build a basic firmware with router capabilities using the SDK provided by SL? I’m documenting my progress in this issue, any feedback is also welcome there.

While I appreciate the concern, I’m not looking for answers to “solve the problem” with “buy a cheap lightbulb, those act as routers” (in fact I do have some of those). Yes I’m aware that there are simpler solutions with better/more reliable hardware, but I’m not interested in that, I’m trying to see how far I can take this cheapo hub. Thanks for reading, any help is much appreciated!

First of all, please understand that EM3581 is an obsolete SoC that is End of Life (EOL), and that is propbably just one of reasons why no one in this community has posted previous attempts on building Zigbee Router firmware for and old Zigbee gateway appliance based on the old EM3581 chip. At least I am pretty sure that you can not find someone here that already tried tro do so, and I strongly doubt you find anyone else to build Zigbee Router firmware for EM358x based Zigbee gateway appliance products today when they is older than ever before.

Anyway, to answer you questions: Maybe you can convert the existing firmware on it to a Zigbee Router without flashing different custom firmware for it though personally I doubt that, but yes if you are looking for a personal challenge for yourself then it is technically possible for you to build and compile such a custom firmware, however, note that it is not supported in the newer SDK versions from Silicon Labs so you need to find and use old Silabs SDK that supported, and to legally get access to that you need to buy Silicon Labs development kit hardware. Then even if you do build a firmware for it you very likely then to flash it with a compatible JTAG debug and possible solder to attatch it.

Even so, you still need to understand that EM3581 SoC is so very old it IMHO would not be worth building a custom firmware for that today even if it was used in a less niche product that more people as it would not make a good router.

The hard cold fact is simply that the old chip with old firmware would just not make a very good Zigbee Router, epecially not when you can instead either buy a cheap commercial Zigbee Router product (like the IKEA Trådfri Signal Repeater for ~$13) or make your own DIY Zigbee Router (based on for example Sonoff ZBDongle-E or ZBDDonge-P for ~$20) that will have a much new SoC and new firmware so will empirically be much better Zigbee Router devices. See → Zigbee networks: how to guide for avoiding interference + optimizing using Zigbee Router devices (repeaters/extenders) to get best possible range and coverage

Hence I think you will be alone on converting that specific product into a Zigbee Router.

Perhaps have convincing arguments why doing this on obsolete hardware would be time well spent?

Idiom that comes to mind is Flogging a dead horse (or beating a dead horse in American English)

I mean this is a community where the majority of people just want to make pretty lights glow the color they want, so I feel that asking for motivations is kind of unfair. I’m not looking for a practical solution, this is just to mess around. I got like 5 of these obsolete hubs so I can afford to break some and learn something in the process.

Anyways, yes this thing has a JTAG port, but it’s not required to flash firmwares. I was able to get it into bootloader mode using bellows and flash a newer emberznet controller firmware.

Maybe not fair if you plan on building the firmware yourself, as then you are oly aksing for help or advice on how to build firmware on EM3581, but I think it is fair to ask for a little better motivation if you are asking for other people to build such firmware for you.

Regardless, you probably get better responses if you ask for help on Silicon Labs own community forum (which is free to register on and post to):

Again, if want to download old versions of Silicon Labs Gecko SDK (GSDK) that is compatible with EM358x when you need to buy and register a development kit which can also be used as a J-Link debug probe) to get access needed to download older SDKs when login at Silabs:

Check out for example this Silabs Wireless Gecko Starter Kit for Zigbee

There are other development kits but you I think need to buy one for Zigbee to get access to Zigbee:

1 Like

Having someone build it for me is out of my expectations. I’m just trying to answer some of the questions I made in the post.

Thanks for all the info! I’ll see if I can get my hands on the SDK. I’m still kinda puzzled about the bellows join command, what it was intended for and if it’s a technical limitation of the firmware not being able to join networks as a router (see post).

Also, happy cake day!

I think that is a much more interesting general question for all Silicon Labs modules with Zigbee NCP firmware instead of than building a custom firmware for a specific single device that is also niche + old.

“Zigbee Router mode” and “Join” command for Zigbee NCP in all zigpy radio radios would be both a good approach and useful for several reason, so if could manage to get that to work in bellows then you do not only remove the need for a custom firmware but it would possible be something that could be repurposed on all Silicon Labs modules and adapters shipping with Zigbee NCP (Coordinator) firmware, including all modern Zigbee Coordinaor adapters. If you achieve that then it could then be replicated in other popular zigpy radio libraries such as zigpy-znp.

In fact I posted that question as an open discussion to the zigpy/ZHA developers a few years ago here:

MattWestb also posted specific feature request about it to the bellows repository about the same time:

Anyway, zigpy developers have made it clear that the bellows CLI is deprecated and is no longer meant to be used on its own, as instead you are supposed to use bellows and other radio libraries indirectly via the CLI of zigpy-cli and/or the API of the main zigpy library. However, the CLI of some radio libraries like bellows and zigpy-znp was developeed on their own before zigpy-cli was created as a unified command line interface for zigpy radios and therefore the CLI of radio libraries like bellows and zigpy-znp may have several additional extra CLI command features that have not yet been implemented into zigpy-cli or the API zigpy library, so there is not full feature-parity, thus I think your best approach would be to submit a new feature request for “command ability to join Zigbee NCP device as Zigbee Router” (or similar) as an open issue for zigpy-znp or continue that discussion under the main zigpy repository. Again see:

Suggest you post a new feature request for “Zigbee Router mode” (and “Join” command) for zigpy-cli:

One possible real-world use-case scenario is having ZHA or zigpy-cli stand-alone join an existing Zigbee network for troubleshooting reasons, as a developer tool, that can be used to for example capture and verify Zigbee OTA firmware images (by sending OTA image request with the required image_id, hardware_id, etc., which is something that the deCONZ OTA plugin has the capability of doing). See:

and

Another directly related real-world use-case scenario is then having ZHA join the Zigbee network of existing Zigbee network does not even belong to a ZHA Zigbee Gateway instance but instead Zigbee2MQTT or a commercial Zigbee gateway/bridge/hub (like the IKEA Trådfri Gateway, Philips Hue Bridge, or the Samsung SmartThings Hub).

Yet another real-world use-case scenario is having two Home Assistant instances with the ZHA in the same home/house but only one of them acting as a Zigbee Gateway and having the optiuon to join the second as a Zigbee Router to the first node instead having to setup a new Zigbee network, (could possible even work in some kind of high-availability solution where both are always active that way and it is possible to fail-over to the other node by restoring ZHA backup). After all, a Zigbee Coordinator is technically more or less a Zigbee Router with the added role of security gatekeeper, holding the keys and allowing other devices to join the network or not.

Thanks again for that detailed write up.

The first question that I have regarding joining as a Router is if the firmware has the capabilities of working as a Router without the presence of ZHA or any other software interfacing with the microcontroller. Same goes for joining as an End Device, are the endpoints presented to the controller fixed to some bogus values hardcoded on the firmware? Are they configurable by zigpy?

If the router or end devices can’t work without something instructing it via EZSP then, what capabilities would need to be implemented on bellows/whatever program is controlling the EmberZNet device?

I am not sure what you mean. A standard Zigbee Router device firmware will work as a Zigbee Router device after it has been joined to a Zigbee network. See Zigbee fundamentals and example applications:

That depends on the firmware build. Again see Zigbee fundamentals and above example applications.

There are no default endpoints, the developer of the firmware build must have added them when developing the firmware, and there can be configurable endpoints if the developer has added them.

I believe you must now be referring to the "“Zigbee Control Bridge” mentioned in that issue and that is not a standard Zigbee Router so deffintily something that would first need to be implemented by zigpy developers in the main zigpy libary → Using the hub as ZigBee router · Issue #1 · fakuivan/orvibo-gynoid-zigbee-hub-hack · GitHub