DSGW-510 KNX Smart Gateway Quick Start Guide
1.Introduction
This Quick Start Guide explains the basics:
- how to connect and set up your target on the network
- how to install the SDK
- how to modify and build the firmware images
The Linux Software Developer’s Kit (SDK) is an embedded hardware and software suite that enables Linux developers to create applications on Dusun’s DSGW-510 Industrial control board.
2.Baseboard Information
This section describes the baseboard’s basic resource infomation and interfaces.
2.1 Peripherals & Interfaces
| Category | Specifications |
|---|---|
| Master | RK3399, dual-core Cortex-A72 andquad-core Cortex-A53 |
| RAM | 4GB |
| Flash | 32GB |
| SYSTEM | Debian 12 |
| WIFI | BL-M8821CU1 Modules |
| ZIGBEE/ZWAVE | USB Type-C 5V/3A |
| LTE | EC25EUX |
| Ethernet | 2-way,1000M |
| RS485 | 2-way |
| RS232 | 1-way |
| RS232 | 1-way |
| MBUS | 1-way |
| KNX | 1)Power & battery LED 2)Wireless LED 3)LTE indicator |
| USB | 3-way,2USB3.0 TYPEA、1Micro PRO ( 1-way USB3.0 TYPEA and Micro PRO Multiplex one USB2.0 bus, default is Micro PRO) |
| HDMI | 1-way |
| KEY | 2-way ,1USER KEY、1RESET KEY |
| LED | 6*LED(LEDPWR1、LED1、LED_4G、LED_WIFI、LED ZIGBEE、KNX_PROG_LED) |
| RTC | 1-way |
| Power supply mode | DC 6 ~ 30V |
2.2 Appearance
2.2.1 Main board
Front:

Back:

2.2.2 Interface board
Front:

Back:

2.2.3 RF board
Front:

Back:

3.Instructions
Debug Setup This section describes how to connect the board into your host computer and network to debug for development.
3.1 Equipment preparation
- A DSGW-510 industrial control board.
- A power adapter with a range of 6~30V.
- A monitor or TV with an HDMI port and an HDMI cable.
- 100M/1000M Ethernet cable and router.
- USB wireless/wired mouse/keyboard.
3.2 Power on
- Make sure that the power adapter is 12V/2A.
- Select the appropriate power plug adaptor for your geographical location. Insert it into the slot on the Universal Power Supply; then plug the power supply into an outlet.
- Connect the power output plug to the industrial control board, and the power indicator light will turn on.
3.3 Download Tools
Down1oad RK Driver Assistant DriverAssitant-RKDriver Assistant and the flashing tool RKDevTool.
Install the USB driver using the RK Driver Assistant. No need to connect the device during this process. After installation, restart your computer.

3.4 Debug Uart Connect
- Before you set up your development test bed, please connect the PCB serial port to your develop PC via USB-to-serial bridge.
- PCB serial port on Gateway

- Open the serial port tool settings on the computer:
Baud rate: 1500000
Bits: 8
Stop Bits: 1
Hardware flow control: None

4.SDK Download And Compile
This section describes how to download the sdk and compile it.
4.1 SDK Envirment Prepare
Compilation environment: Linux system Ubuntu20.04
4.2 SDK Download
- Get the source code from Dusun FTP server uncompress it under your work directory. For example: download DSGW-510-DB-SDK
https://drive.google.com/drive/folders/1flUGzsSwJH01Cj-7s0VlzsiAKQZoxifD?usp=drive_link
- After downloading, copy it to the Linux server
#Create a new SDK working directory
$ mkdir -p ~/work_dir/dsgw510
#Copy the downloaded SDK to the working directory
$ cp rk3399-linux-dsgw-510.tar.gz* ~/work_dir/
$ cd ~/work_dir/
# Unzip the SDK to the working directory
$ cat rk3399-linux-dsgw-510.tar.gz* | tar zxf -C ./dsgw510/
$ cd dsgw510 && ls

4.3 SDK Compile
environment & compilation:
- Compile All, One-click firmware generation
$ ./build.sh
Compilation is complete and the firmware path is generated.
- Compile the uboot separately
$ ./build.sh uboot
- Compile the kernel separately
$ ./build.sh kernel
- Image packaging to generate firmware
$ ./build.sh updateimg
4.4 SDK Output
Generate the full firmware file directory: output/update/Image/
update.img contains all the separately compiled firmware, the generated upgrade firmware
uboot.img is the uboot partition firmware
boot.img is the kernel partition firmware
rootfs.img is the file system partition firmware
recovery.img is the recovery partition firmware
$ ls -l output/update/Image/
If the compilation fails, please according to the error information, their own Baidu or google to solve or view the compilation error common problems document, really can not solve the problem, you can record the complete error information, through technical communication group consultation.
5.Firmware Program And Upgrade
5.1 Firmware Program
USB OTG:
Driver installation (burn mirror/ADB debugging)
1.Unzip driverAsSatant_v5.0
2.Open driverinstall.exe
3.Click Drive Installation, and it will show that the installation driver is successfulMirror Upgrade Tool
1.Unzip AndroidTool_Release_V3.31Enter the upgrade mode
- Connect the OTG port to the burning computer
- Connect the power supply
- Plug in the voltage and wait for the display of “Found One ADB Device”

- Click on the Switch , display “Found One LOADER Device”

- Select the firmware, click Upgrade, and wait for the upgrade process to complete.

- Method 2: You can also press and hold the Recovery key to enter the LOADER mode. After the message "Found One LOADER Device" is displayed, select the firmware to burn.
6.Gateway Login
6.1 Login Through Debug Uart
connect uart serial tool to the board’s debug uart port
config the serial tools’s uart config:
Login Account:root , password: root

6.2 Login Through Network(SSH)
Username: root Password: root
- config the ssh connection parameters


- connect success

7.Application Layer Development
7.1 I2C
the board has two i2c bus
- i2cdetect

- i2cdump

- i2cget

7.2 GPIO
- see the gpios used by kernel

- gpio export N is the gpio number.
$ echo N > /sys/class/gpio/export
- gpio out on/off
$ echo out > /sys/class/gpio/gpioN/direction
$ echo 1 > /sys/class/gpio/gpioN/value
$ echo 0 > /sys/class/gpio/gpioN/value
- gpio in
$ echo in > /sys/class/gpio/gpioN/direction
7.3 UART
The board has one uart used by user ttyS
- install minicom
$ apt-get update; apt-get install minicom
- Configure UART using minicom
$ minicom -s

- Short the UART rx and tx pins to test the continuity.Prees any key, it will receive any key in loopback mode

7.4 Kernel DTS Description
This Gateway’s dts file is the rk3399-evb-ind-lpddr4-linux.dts
8.External interface usage
8.1 HDMI
Plug in a USB keyboard and USB mouse, and connect the monitor and power adapter to the DSGW-510 development board. (When you power on the board for the first time, please wait patiently for a moment until the desktop is loaded. Do not unplug the power cord during this period.)

8.2 Ethernet
This board has one wan port eth0 work as dhcp
$ ifconfig

8.3 DEBUG
Connect USB-TYPE-C to the computer, refer to 6.1 Connection.
8.4 USB
Plug in sub-devices such as mouse and keyboard, and you can test the function through the HDMI page.

8.5 LTE-4G
First confirm that the SIM card is inserted and use the shell script to dial.
- Start the LTE module
$ bg96_powerup.sh on
- Send AT commands
$ pppcmd /dev/ttyUSB3 AT+CPIN?
- Automatic dialing
$ bg96_dial.sh
8.6 RTC
Test by powering off without intervening in the network and then powering on to see if the time is restored to the factory settings.

8.7 LED
Switch LED light.
$ ls /sys/class/leds/

8.8 RS485
The uart device number used by RS485 is ttyCH343USB0 and ttyCH343USB3
8.9 RS232
The uart device number used by RS232 is ttyCH343USB2
8.10 MBUS
The uart device number used by MBUS is /dev/ttyCH343USB1
8.11 Zigbee/ Zwave
The uart device number used by Zigbee/ Zwave is /dev/ttyS0
8.12 KNX
KNX connects to sub-devices (KNXH1 and KNXG1). After sending a command, the program automatically determines whether it is normal. If normal, it returns "ok"; otherwise, it returns "FAIL".
shell commands:test.sh knx_test

8.13 CAN
Set CAN parameters to enable and connect the CAN port to USBCANTool for testing.

8.14 OTG
The OTG used to program the board. See Section 5.1
8.15 RECOVERY
This Key Used to switch the board to MaskRom Mode.
8.16 Key RST
This Key used to reset the board.
8.17 WIFI
The board has one wifi mode BL-M8821CU1
- ifconfig wlan0/wlan1
$ ifconfig wlan0
$ ifconfig wlan1
- add supplicant config file
$ cat > /etc/wpa_supplicant.conf <<EOF
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
update_config=1
network={
scan_ssid=1
ssid="AAAAAA"
psk="dl123456"
key_mgmt=WPA-PSK
}
EOF
add network interface

up wlan1
$ ifconfig wlan1 up
- scan
$ wpa_cli -i wlan1 scan
OK
- scan results
$ wpa_cli -i wlan1 scan_result;

- wpa_cli command to connect to WiFi
$ wpa_cli -i wlan1 add_network
$ wpa_cli -i wlan1 list_network
$ wpa_cli -i wlan1 set_network 1 ssid '"AAAAAA"'
$ wpa_cli -i wlan1 set_network 1 psk '"dl123456"'
$ wpa_cli -i wlan1 set_network 1 key_mgmt WPA-PSK
$ wpa_cli -i wlan1 set_network 1 priority 2
$ wpa_cli -i wlan1 set_network 1 scan_ssid 1
$ wpa_cli -i wlan1 enable_network 1
$ wpa_cli -i wlan1 select_network 1
$ wpa_cli -i wlan1 save_config
$ udhcpc -i wlan1
# List of added networks
$ wpa_cli -i wlan1 list_network network id/ssid/bssid/flags

- nmcli command to connect to WiFi
# View a list of available WiFi networks.
$ nmcli device wifi list

Connect to WiFi (replace SSID and password).
$nmcli device wifi connect "YourWiFiSSID" password "YourPassword"

Check the connection status .
$ nmcli connection showCheck the connection status .

9.Support
Please contact our sell to get more support.
- Tel
+86-571-86769027/88810480
- Website:
www.dusuniot.com
www.dusunremotes.com
www.hzdusun.com