DUSUN DSGW-021 L-Serial Smart Gateway User Guide
- June 12, 2024
- Dusun
Table of Contents
- 1. Introduction
- 2. Gateway Information
- 3. Target Setup
- 4. Compile the Environment to Build
- 5. Network interfaces
- 6. Openwrt restore to factory setting
- 7. Add APP component in Openwrt
- 8. uboot build and upgrade
- 9. System firmware upgrade
- 10. Communication between zigbee module
- 11. Communication between Z-Wave module
- 12. Communication between BLE module
- 13. System firmware upgrade
- 14. Others
- References
Hangzhou Roombanker Technology Co.,Ltd.
A DUSUN company
S DK Q uick S tart G uide
Product Name: L-Serial Smart Gateway
Model Name: DSGW-021
Revision History
Specification
|
Sect.
| Update Description|
By
---|---|---|---
Rev
| Date
1.0| 2021-08-06| | New version release|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
Approvals
Organization | Name | Title | Date |
---|---|---|---|
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; and how to 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-021
gateway.
Base on the MTK OpenWrt V19.07, and leveraging existing open source software,
the SDK simplifies the process of adding custom applications. Device drivers,
toolchain, Pre-defined configuration profiles, and sample applications are all
in included.
2. Gateway Information
2.1 Basic information
Processor: MTK7628A
Supply: DC-5V
ZigBee: EFR32MG1B232F256G
Z-Wave: ZGM130S037HGN
Bluetooth: EFR32BG21 or NRF52840
RAM: 64MB
Flash: 16MB
2.2 Gateway appearance
3. Target Setup
This section describes how to connect the gateway into your host computer and network.
3.1 Connecting a gateway – Power
3.1.1 Make sure that the power adapter is 5V/2A.
3.1.2 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.
3.1.3 Connect the output plug of the power supply to the gateway
3.2 Connecting a gateway - LAN port
3.2.1 Connect one end of the network cable to the Ethernet port on the laptop
or desktop
3.2.2 Connect the other end of network cable to the LAN port on the gateway.
Figure3-1. Connecting a gateway via Ethernet port
Before you set up your development test bed, please connect the PCB serial
port to your develop PC via USB-to-serial bridge.
Serial port setting:
Baud rate: 57600
Bits: 8
Stop Bits: 1
Hardware flow control: None
4. Compile the Environment to Build
4.1 OpenWrt Version
Take OpenwWRT19.07 as an example
4.2 PC Compile the Environment to Build
Compilation environment: Linux
Openwrt’s compilation tool is automatically generated by SDK built, no
additional installation is required
4.3 OpenWrt configuration and compilation
Get the source code from Dusun FTP server or github and uncompress it under
your work directory.
Github link: https://github.com/openwrt/openwrt.git
Checkout to correct branch after clone, take OpenWRT19.07 as an example,
git checkout openwrt-19.07
git branch -a
4.3.1 DTS file
a) About DTS file for connecting to Dusun gateway’s hardware, please download
in Dusun FTP server.
b) Then move it to the right directory mv DSGW021.dts
target/linux/ramips/dts/
c) Add the component in file vi target/linux/ramips/image/mt76x8.mk
4.3.2 Configure compilation options
a) Configure compilation options
There is already a default configuration in the SDK, which satisfies the basic
functions of routing. Customers could also customize the configuration
according to their own needs.
Command:
cd
make menuconfig
Choose system (MediaTek Ralink MIPS)
Select Subtarget MT76x8 based boards
Choose target profile DSGW-021
If user want to change kernel configuration make kernel_menuconfig
Exit and save the configuration.
b) Build the image
Just use command ‘make V=99’, the image built will take a long time.
The target image will be under ./ bin/targets/ramips/mt7620
Image used for update is openwrt-ramips-mt7620-dsi0134-squashfs-
sysupgrade.bin
5. Network interfaces
Login into the gateway device, using command ‘ifconfig’, you can get all
network interfaces.
Interface eth1 connects to WAN port (Blue RJ45 port), eth0 is LAN port, it’s
connected to an internal switch on SoC, all LAN ports are connected to eth0.
Interface ra0 is 2.4G radio, rai0 is 5G radio.
6. Openwrt restore to factory setting
Command:
firstboot
Press ‘y’ to confirm and then reboot system.
7. Add APP component in Openwrt
Take openwrt-sdk/package/dusun/lib_dusun as an example, If user want to add a new user lever application into openwrt SDK, just follow the example. After code is ready, you still need to add it to config file by “make menuconfig”, and select Dusun
Select libdusun package,
Exit and save config, ‘make V=99’ again, you can get the image with libdusun
8. uboot build and upgrade
1. uboot configuration and build
On development PC:
cd Uboot
make
You get uboot.img
2. uboot upgrade
Setup tftp server on the development PC, and put uboot.img under tftp root
directory.
Make sure connect the board to PC via serial port, reset board and press ‘9’ when current uboot is booting up. Follow the steps in the console:
The uboot.img will be downloaded to the board and upgraded, then automatically reset to boot new uboot:
9. System firmware upgrade
Put the image on any server which supports ssh/scp service.
scp user@serverip:~/openwrt-ramips-mt7621-mt7621-squashfs-sysupgrade.bin /tmp/
sysupgrade -v /tmp/openwrt-ramips-mt7621-mt7621-squashfs-sysupgrade.bin
10. Communication between zigbee module
User can obtained the zigbee module’s NCP program in simplicity studio, the module number is EFR32MG1B232F256G
For detailed information to flash image to the zigbee module, please refer to
document ZIGBEE MODULE FLASH FIRMWAREv1.0
For SDK to develop program in gateway, please refer to document API
Reference for EmberZNet PC Host
It can be found in the ss5’s directory of
C:\SiliconLabs\SimplicityStudio\v4_3\developer\sdks\gecko_sdk_suite\v2.7\protocol\zigbee\documentation
11. Communication between Z-Wave module
User can obtained the Z-Wave module’s NCP program in simplicity studio, and acquire the Z-Wave sdk in siliconlabs for further development
Find the correct Z-Wave module in simplicity studio, then follow the same guide in section 10
12. Communication between BLE module
a) For silicon labs BLE module
User can obtained the ble module’s NCP program in simplicity studio, the module number is ERF32BG21
Find the correct BLE module in simplicity studio, then follow the same guide in section 10
b) For Nordic BLE module
If Gateway is implemented the Nordic BLE module NRF52840, follow the official
SDK from Nordic. https://www.nordicsemi.com/Products/Development-
software/nRF5SDK/GetStarted?lang=en#infotabs
13. System firmware upgrade
a) Using sysupgrade in gateway
scp user@serverip:~/openwrt-ramips-mt7688-mt7688-squashfs-sysupgrade.bin /tmp/
sysupgrade -n /tmp/openwrt-ramips-mt7688-mt7688-squashfs-sysupgrade.bin
b) Using LUCI web server in gateway
c) Using Uboot method
Please refer to document update gateway using uboot.pdf
14. Others
For more information, please visit OpenWRT official website.
Tel:86-571-86769027/8 8810480
Website:www.dusuniot.com
www.dusunremotes.com
Floor8,buildingA,Wantongcenter,H
angzhou 310004,
chinawww.dusunlock.com
References
- Dusun IoT: Embedded Hardware Vendor | IoT Gateway Sepcialist
- GitHub - openwrt/openwrt: This repository is a mirror of https://git.openwrt.org/openwrt/openwrt.git It is for reference only and is not active for check-ins. We will continue to accept Pull Requests here. They will be merged via staging trees then into op
- nRF5 SDK get started - nordicsemi.com