Skip to main content

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

CategorySpecifications
MasterRK3399, dual-core Cortex-A72 andquad-core Cortex-A53
RAM4GB
Flash32GB
SYSTEMDebian 12
WIFIBL-M8821CU1 Modules
ZIGBEE/ZWAVEUSB Type-C 5V/3A
LTEEC25EUX
Ethernet2-way,1000M
RS4852-way
RS2321-way
RS2321-way
MBUS1-way
KNX1)Power & battery LED
2)Wireless LED
3)LTE indicator
USB3-way,2USB3.0 TYPEA、1Micro PRO ( 1-way USB3.0 TYPEA and Micro PRO Multiplex one USB2.0 bus, default is Micro PRO)
HDMI1-way
KEY2-way ,1USER KEY、1RESET KEY
LED6*LED(LEDPWR1、LED1、LED_4G、LED_WIFI、LED ZIGBEE、KNX_PROG_LED)
RTC1-way
Power supply modeDC 6 ~ 30V

2.2 Appearance

2.2.1 Main board

Front:

pic

Back:
pic

2.2.2 Interface board

Front:
pic

Back:
pic

2.2.3 RF board

Front:
pic

Back:
pic

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.

pic pic

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

pic

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

pic

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

pic

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/

pic 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 successful

  • Mirror Upgrade Tool
    1.Unzip AndroidTool_Release_V3.31

  • Enter the upgrade mode

  1. Connect the OTG port to the burning computer
  2. Connect the power supply
  3. Plug in the voltage and wait for the display of “Found One ADB Device”
    pic
  4. Click on the Switch , display “Found One LOADER Device”
    pic
  5. Select the firmware, click Upgrade, and wait for the upgrade process to complete. pic
  • 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:
pic Login Account:root , password: root
pic

6.2 Login Through Network(SSH)

Username: root Password: root

  • config the ssh connection parameters
    picpic
  • connect success
    pic

7.Application Layer Development

7.1 I2C

the board has two i2c bus

  • i2cdetect
    pic
  • i2cdump
    pic
  • i2cget
    pic

7.2 GPIO

  • see the gpios used by kernel
    pic
  • 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 

pic pic pic

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

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.)
pic

8.2 Ethernet

This board has one wan port eth0 work as dhcp

$ ifconfig

pic

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. pic

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.
pic

8.7 LED

Switch LED light.

$ ls /sys/class/leds/

pic

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
pic

8.13 CAN

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

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
    pic

  • up wlan1

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

pic

  • 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

pic

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

pic

Connect to WiFi (replace SSID and password).

$nmcli device wifi connect "YourWiFiSSID" password "YourPassword"

pic

Check the connection status .

$ nmcli connection showCheck the connection status .

pic

9.Support

Please contact our sell to get more support.