Skip to content
Csongor Varga edited this page Dec 20, 2023 · 6 revisions

Zigbee2MQTT Setup on Dusun DSGW-210

This document details how I installed a Mosquitto MQTT Broker and Zigbee2MQTT on my Dusun DSGW-210 IoT Gateway computer. You can see the review of the device here:

Dusun DSGW-210 Review

I am using this device to be a standalone, self-contained Zigbee2MQTT gateway to integrate Zigbee device to a TapHome home automation system over MQTT. My exact model is a DSGW-210-F18-HA. HA means that it has Home Assistant preinstalled, which I am not going to use in my project.

Also watch my video on this setup if you want to follow along:

Zigbee2MQTT setup on DSGW-210

For this setup, I recieved support from the Dusun Online Community, especially on the Zigbee adapter configuration for Zigbee2MQTT. You can find my comments in this post: https://community.dusuniot.com/t/i-cant-use-zigbee2mqtt/177. Do not hesitate to contact them if you face problems with their products.

Access and Other Housekeeping

The default password for user root is root on this device. There is also an admin user installed, I will be using the admin user to install Mosquitto and Zigbee2MQTT.

First log in with root/root change the root password with:

passwd root

Also change the default password for user admin with:

passwd admin

Reboot the device with reboot and log in with admin with the new password. We will do the rest of the steps with user admin.

Update Linux to make sure we are up to date:

sudo apt-get update
sudo apt-get upgrade

Change the hostname of the device, default is set to HomeAssistant:

sudo nano /etc/hostname

And now also edit this file:

sudo nano /etc/hosts

Normally in this file the first line reads 127.0.0.1 localhost just type you new hostname after localhost (and a space), and save. After this reboot again with sudo reboot.

Follow this article to change the local timezone of the machine: https://linuxize.com/post/how-to-set-or-change-timezone-in-linux/. I don't think it is necessary, but it is better to keep in sync with your local time.

Mosquitto MQTT Broker Install

I have documented this process already for my main server install: https://github.com/nygma2004/km/wiki/Node-Red-Server#mqtt.

Perform the steps as they are, there should be the same as for my main server. Once everything is running, I test the connection with MQTT Explorer.

Zigbee2MQTT Install

Here, we are going loosely follow the instructions I already prepared for my main server: https://github.com/nygma2004/km/wiki/Node-Red-Server#zigbee2mqtt. Please open the page in the link and this page and check in parallel.

Determining and Setting Up the Zigbee Coordinator

First, read the instructions around determining the ID of the serial device. Here we will obviously use the coordinator built into the IoT Gateway, and for me the ID of this device is usb-1a86_USB_Serial-if00-port0. I assume since you get the same hardware it will be the same, but if not, please update the rest of my examples with your ID.

Before we continue, please check if your user has access to the serial device:

test -w /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0 && echo success || echo failure

If the response is success you can skip to the next part, if it is failure please read along.

Give admin access to the serial device:

sudo chown admin /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0

Also give access the user to communication ports:

sudo usermod -a -G uucp $USER
sudo usermod -a -G tty $USER
sudo usermod -a -G dialout $USER

Test the access to the serial device again, and this time the response should be success.

Disable Home Assistant

This step is optional, but since I was not planning on using Home Assistant, it was just using system resources and slowing the boot process down. I followed this guide: https://gist.github.com/narfel/035944cbf8475b29621a7a5dff00d97f, and did step 1 and step 2. This just disables the Home Assistant service from starting when the gateway starts. It can be re-enabled again in the future if required.

Installing Zigbee2MQTT

Please follow my other page, and within that the "Installing" section of this page: https://www.zigbee2mqtt.io/guide/installation/01_linux.html#installing

Once that is done, configure Zigbee2MQTT's configuration file:

nano /opt/zigbee2mqtt/data/configuration.yaml

I configured my file as below:

homeassistant: false
permit_join: false
mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://localhost
  user: YOUR_USERID
  password: YOUR_PASSWORD
serial:
  port: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
  adapter: ezsp
frontend:
  port: 8085
advanced:
  homeassistant_legacy_entity_attributes: false
  legacy_api: false
  legacy_availability_payload: false
device_options:
  legacy: false

Obviously update the userid, password and the serial ID if required.

And now go back to the Zigbee2MQTT installation guide (link above), and complete the "Starting Zigbee2MQTT", and "(Optional) Running as a daemon with systemctl" sections.

At this point Zigbee2MQTT should be running and when you log into the MQTT server with MQTT Explorer, your should see a zigbee2mqtt topic: image

With this, the configuration is complete. Have fund using your new Zigbee2MQTT Gateway!