This firmware allows you to create a Zigbee switch device with a flexible configuration of inputs and outputs. I’ve created a base firmware for CC2530, CC2530 + CC2590 , CC2530 + CC2591 and CC2530 + CC2592 chips. The attached configurator for Windows can write your device configuration to the selected base firmware. Then you can save the customized version to a separate HEX file and upload it to your device.
Inputs and outputs can work independently. So you may create a switch without a control button, or a simple button only.
The device with this firmware also works as a router.
Note: the firmware is designed for constantly powered devices.
Remember state – The firmware saves the output state to NVRAM and restores it after power off/on.
Link – The input immediately controls the state of the corresponding output. The device sends the on/off state of the output to a coordinator. Otherwise, the input is independent.
Long – The firmware detects and reports to the coordinator a long click (2000 ms).
Double – The firmware detects and reports a double click (max 500 ms between clicks).
Triple – The firmware detects and reports triple-click (max 500 ms between clicks).
The firmware creates a separate endpoint (1..5) for every configured output and/or input (max 5 endpoints).
The firmware reports the state of an independent button via the “ZCL_CLUSTER_ID_GEN_MULTISTATE_INPUT_BASIC” cluster and the “PRESENT_VALUE” attribute. 1 – single click. 2 – double click. 3 – triple-click. 4 – long click.
The firmware does not send a separate report for the linked button. Otherwise, it sends reports about the output state via the “ZCL_CLUSTER_ID_GEN_ON_OFF” cluster and the “ON_OFF” attribute.
You may control the output state via the “ZCL_CLUSTER_ID_GEN_ON_OFF” cluster and the “ON_OFF” attribute.
The “ZCL_CLUSTER_ID_GEN_ON_OFF” cluster also accepts the “read”, “configure” and “onOffWithTimedOff” commands: “read” – returns the current state on the specified endpoint. “configure” – set the periodic reporting interval for the output. The “minReportInt” attribute specifies the reporting interval in seconds. If “minReportInt” is 65535, the firmware disables periodic reports. “onOffWithTimedOff” – sets the output state to “HIGH” for “onTime” milliseconds, and automatically resets to “LOW”.
2019-08-14: Fixed bug with 3rd and 4th inputs. 2019-06-27: First release.
Nowadays, some manufacturers offer boards with additional power amplifiers for the radio signal. These boards may cover a rather large area than the regular CC2530. The standard router firmware does not work with these boards.
Ebay and Aliexpress offer several boards with the CC2530 chip (keyword: CC2530). You may select any board, but use the following criteria:
The board must have the CC2530F256 chip (fig. 3). The key number here is 256 and it means 256 KB of flash memory. Most firmware was compiled for 256K memory.
The board may have many pins or contacts. If you do not have a soldering iron then select a board with headers. I would suggest to select a board where each pin has the corresponding label. The label may slightly different on different boards: P0.2, P02, P0_2 are the same pin. The board must have at least the following pins:
Po.2, Po.3, P2.0 – used for a UART interface. If you plan to use this board instead CC2531 and connect to your SBC like Raspberry Pi, then you need these pins. If you’ll upload a router firmware to this board then these pins are optional.
P2.1, P2.2, RST – used for uploading firmware.
GND – ground.
Power source (VCC) – it may be 3.3V, 5V or both. This pin can be marked by VCC only. Internally, the CC2530 chip uses the 3.3V voltage, but a manufacturer may add a voltage regulator on the board and you may use any supported voltage (3.3V or 5V, no difference). Please, read a description for this board carefully about the voltage.
The board may include an additional small chip (fig.5). Most likely, this is a wireless signal amplifier. Usually these boards contain “Long range”, “RF front-end”, “RF amplifier”, “CC2591”, “RXF2401” in a description. These boards require a special firmware. I would suggest to select this board if you really have a firmware for this combination of the main chip (CC2530) and the RF front-end chip.
The board may contain an antenna on-board (fig.2, 3, 6) or a connector for an external antenna (fig. 1, 3, 4, 5). The board with an external antenna will work better in most cases.
Some boards may have a metallic shield over the main chip and/or the RF front-end. This shield protects the board from radio noises (good). But I would suggest to buy this board from a trusted vendors only because you cannot be sure about chips under this cover.
Rare CC2530 based boards may include an USB interface (fig. 6). CC2530 does not have native USB support apart from CC2531. Therefore a manufacturer adds an additional chip on the board. The additional chip implements the USB interface and the CC debugger. Therefore you can upload a firmware to this board without a special debugger (CC debugger or SmartRF04EB). Therefore it holds small space on your work table. It can be useful for developers. If you need only one CC2530 or CC2531 for a coordinator role you may save money. Please, read a description for a board carefully because this USB interface and chip may be used for another purpose. Therefore I cannot recommend this board for beginners.
My smart home infrastructure contains several Xiaomi humidity/temperature and door sensors. I’ve used these sensors with the corresponding Xiaomi gateway. The gateway was connected with my BananaPi M2U and Pimatic. But my home is long and tall. One gateway does not cover all rooms and therefore far sensors disappear periodically.
I’ve googled and found I can use Xiaomi sockets (Zigbee edition) like Zigbee routers. This socket is less expensive than a new gateway and it has a smaller size. I’ve purchased tow sockets and used it about a month. This socket has a big problem (from my point of view). It can go into the deep sleep mode and cannot forward data packets from sensors.