This page skips the reverse-engineering story and the “why” behind every decision — that’s in the other chapters if you want it. This is just: how do I flash this thing and use it.
Everything referenced below (firmware images, mg21-flash-upload.sh, the H5075 reader, build scripts) is in the GitHub repo:
github.com/doer-ee/w1700k-mg21-radio
Before you start: this involves opening the case and wiring a UART console. If any of that is unfamiliar, read Flashing OpenWrt first — this page assumes you already have OpenWrt running. No debugger or J10 connector needed for any of this: flashing the MG21 happens entirely over UART DFU (see Reverse Engineering Process if you’re curious how that was figured out).
1. Get the router onto OpenWrt
Full procedure: Flashing OpenWrt. Short version: UART console at 115200 8N1, U-Boot TFTP chainload of the official w1700k/ubi2-installer images, then the UBI2 installer.
2. Grab a release and pick a radio personality
Download the prebuilt GBL images and mg21-flash-upload.sh from the Releases page — no need to clone or build anything for normal use. Pick one personality:
ble-ncp— Bluetooth LE NCPzigbee-ncp— Zigbee NCPthread-rcp— OpenThread RCP
Only one can run at a time — the MG21 has 64 KB of RAM and one application slot. Reflashing swaps personalities; it does not add one alongside another. (If you want to modify or rebuild the firmware yourself, clone the repo instead: git clone https://github.com/doer-ee/w1700k-mg21-radio.)
3. Flash it over UART, no debugger needed
./mg21-flash-upload.sh <path-to-uncompressed.gbl>This drives the AN7581’s GPIO536 (RESETn) and GPIO537 (bootloader activation) to enter the Gecko Bootloader, streams the image over /dev/ttyS1 via BGAPI UART DFU, and resets into the new application. A full uncompressed image takes well under two minutes. If the router’s UART driver needs the 230400-for-115200 baud workaround described in the BLE and Thread chapters, set MG21_BAUD=230400 before running the script.
4. Use it
BLE: run the prebuilt reader (host/h5075-reader/) to decode Govee H5075-style thermo-hygrometer broadcasts, or write your own BGAPI client against /dev/ttyS1. Full detail: BLE Firmware.
Zigbee: point a Zigbee2MQTT instance at the router’s serial bridge (ember adapter, 115200 baud) and it behaves like any other EmberZNet coordinator — pair devices, integrate with Home Assistant as normal. Full detail: Zigbee Firmware.
Thread: install openthread-br via apk and configure it as a netifd openthread proto interface pointed at /dev/ttyS1 (460800 baud). Don’t forget to add the thread network to a firewall zone — it isn’t automatic. Full detail: Native OTBR.
Only ever one of the three at a time — stop whichever service currently owns /dev/ttyS1 before flashing or using a different personality.