0% found this document useful (0 votes)
8 views23 pages

WIFI Interface

The DWIN WIFI Module Protocol User Guide outlines the development and integration of DWIN smart LCD Modules with network functionality, detailing various versions and their modifications. It highlights the advantages of the DWIN WIFI solution in terms of development efficiency, stability, and cost, while providing technical specifications and hardware interface definitions. The guide also includes steps for development, access methods, and network interface definitions within the DGUS system.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views23 pages

WIFI Interface

The DWIN WIFI Module Protocol User Guide outlines the development and integration of DWIN smart LCD Modules with network functionality, detailing various versions and their modifications. It highlights the advantages of the DWIN WIFI solution in terms of development efficiency, stability, and cost, while providing technical specifications and hardware interface definitions. The guide also includes steps for development, access methods, and network interface definitions within the DGUS system.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

DWIN WIFI Module Protocol User Guide

V1.2.3
Change Log
Version State of
Description of modification point Author Date
number change
Realize basic wifi module protocol Wang
V 1.0 C 2019-12-15
function Jintai
Wang
V1.1 A Add scanning hotspot function 2019-12-30
Jintai
1. Add UDP broadcast protocol
2. Added instructions for using UDP
V1.2.1 A Li Jianmin 2020-4-15
broadcast protocol, please refer to the
instructions for 5.6
1. Increase write-back to IP
Wang
V1.2.2 A 2. Increase the configuration of the 2020-4-20
Jintai
port
V1.2.3 A Modify 487 address description Li Jianmin 2020-6-4

*Change status: C-create, A-add, M-modify, D-delete


Description of modification points: A brief explanation of the change status, such as
adding a certain function, modifying a certain module and other information. The
words "modified according to review opinions" are not allowed

1. Overview

In order to make DWIN smart LCD Module easy and convenient to connect to the
Internet, DWIN set up its own cloud server and integrated the interface to connect to
the Internet on the DGUS system, so that it will be very simple and convenient to
develop DWIN smart LCD Module with network function in the future .

Currently supported LCD Module platforms are T5UID1, T5UID2 and T5L_ASIC.
Supported products are 86 box series products and network screens, etc.

The advantages of the DWIN WIFI solution are mainly reflected in the following
three aspects:

1. Development efficiency
Based on the DGUS architecture, after the stand-alone function is realized, the Single
Chip Microcomputer zero code can realize network configuration and data upload.
The engineer only needs to plan the data address. The complex JSON protocol parsing
is processed in the cloud to save the resources of the Single Chip Microcomputer and
improve the development efficiency. Customers can focus on the core functions of the
product.
2. Stability
The solution has opened the protocol between the main chip (GUI), WIFI module,
and MQTT server to form a UI+IOT integrated solution, reducing the number of
customer development links, reducing communication costs, and reducing the
uncertainty in development, so that the entire solution Stability is improved.

3. Cost
As a part of DWIN's IoT solution, WIFI module faces tens of thousands of customers
in different industries, forming a scale advantage. Direct cooperation with the original
WIFI chip manufacturer to ensure cost advantage.

1.1. System block diagram

1. With a simple configuration, the Smart LCD Module equipped with the DWIN
WIFI module will connect to the MQTT server through the "Connect A" channel.

2. The WIFI module will upload or download the DGUS register variables of the
DWIN Smart LCD Module and the corresponding DGUS variables on the server.

3. Mobile terminal and background management through the MQTT server for data
communication and interaction between servers. The mobile terminal mainly
implements remote UI functions and variable modification functions. The background
management can realize the function of variable modification control and file
upgrade.

4. The third-party server can be the client's server, and the DGUS variable can be
operated by providing an interface to upgrade the file.

1.2. Access method


DWIN WIFI module and MQTT server and data relay server are mandatory for
DWIN. The server for storing and processing business data can be DWIN's or the
client's own server.

1.3. Characteristic parameters


The characteristics of the WIFI module are:

(1) Main chip ESP8266+4MB Flash

(2) Support 802.11 (2.4 GHz), frequency range 2.4G ~ 2.5G (2400M ~ 2483.5M)

(3) The antenna type includes PCB on-board antenna

(4) Maximum transmit power 14dBm

(5) Serial transmission rate 921600bps (transmission data rate on the device side)

1.4. Hardware interface


The V1.0 hardware package is defined as shown above, with a foot pitch of 2.0mm.

 WIFI module should have VCC (3.3V), GND, TXD, RXD, C/D, TXD_C, /RST 7
pins.

 TXD, RXD: Data channel, Baud rate 921600.

 TXD_C: has nothing to do with business, internal information printout pin,


suspension processing.

 C/D: WIFI module download enable, internal pull-up resistance 10K. When the
module is powered on, the pin is low, indicating that the boot mode is entered.
Use suspension normally

 3V3, GND: peak current of 300mA is required.

 /RST: Reset pin, which needs to be connected to reset chip for reliable reset. Low
level reset WIFI module.

The definition of V2.0 hardware package is as shown above, and the foot pitch is
2.0mm.

the difference:

 IO14/SCL: I2C interface SCL, WIFI module output

 DL/SDA: WIFI module download enable, internal pull-up resistor 10K. When the
module is powered on, this pin is low, it means to enter the boot mode. Normal
use can be suspended.

 SDA of the I2C interface, if the I2C interface is enabled, the TX function of
UART1 needs to be disabled

1.4.1. Interface between T5UID1_86 platform and WIFI module

The T5UID1_86A platform is an application of the standard T5UID1 platform on 86


boxes, and additionally defines IO and serial ports connected to WIFI. In the end,
only UART4 was used, and the rest were not used.

T5 ASIC IO WIFI_IO Explanation


Connect the resistor, the hardware
IO2 C/D configuration download is enabled, it is not
actually needed, and can be left floating
IO3 - Power on key detection
UART4_TX RXD Serial port
UART4_RX TXD Serial port
Debugging information output, don't need to
IO1 TXD_C pay attention, can not be used in practice, can
be left floating
UART6_RX

1.4.2 T5L hardware platform interface

In the end, only UART1 was used, and the rest were not used.

T5L ASIC
WIFI Module IO Explanation
IO
Connect the resistor, the hardware
IO18 C/D
configuration download is enabled
IO19 TXD_C Debug information output, don't care
UART1_TX RXD Serial data
UART1_RX TXD Serial data

2. Development steps
2.1. Determine the platform
Platform Explanation Examples of products
1. The 22.bin file needs to be configured
and uploaded TR028C11W04
22. Bin file. TC035C21W04
T5UID1,T5UID2
2. The 8283 instruction needs to be TR028C12W00
implemented in the OS. can TC035C22W00
Use the given routine code.
Just configure 22.bin file and load 22.bin
T5L ASIC
File

2.2. Stand-alone device program development

Same as the original DGUS stand-alone development, no special treatment

2.3. Access to cloud operations

Write 22.bin file to meet network access requirements, including product ID, display
network connection status icon, etc., display version number and MAC address, etc.

2.4. Development of mobile terminal and cloud background

Log in to http://merchant.dwinhmi.com.cn/ for background management and develop


apps.

3. DGUS platform interface definition

3.1. DGUS system read-write interface


The DGUS system generally interacts with external systems through memory data.
The memory variable space is 0x0000-0xFFFF, where 0x0000-0x0FFF is the DGUS
system area, and 0x400-0x4FF in the system area is the network communication
interface. The 0x1000-0xFFFF area is the user memory area.

The external device reads and writes the bus interface of DGUS system through
UART, mainly 82H, 83H instructions.

Data block 1 2 3 4 5
CRC calibration
Definition Frame header Data length instruction Data
(optional)
Data length 2 1 1 N 2
Including
Explanation 0×5AA5 instructions, data, 0×82/0×83
calibration
Example (no
5A A5 04 83 00 10 04
calibration)
Example
5A A5 06 83 00 10 04 25 A3
(calibration)

Issued: Specify the address to start writing data string


Variable space first address (0×0000-0×FFFF) (word data) to the variable space. Do not write
0×82 + written data in the space reserved by the system
answer: Write instruction response
0×4F, 0×4B
Issued:
Read the specified length word data from the
Variable space first address (0×0000-0×FFFF)
address specified in the variable space
+ read data word length (0×01-0×7D)
0×83
answer:
Variable space first address + variable data Data response
word length + read variable data word

It should be noted that the length of the 82H/83H instruction is only 1 byte, that is, the
maximum is 256 bytes. With the removal of the frame header and frame tail and the
CRC, the general payload is about 240 bytes. Therefore, if there is a large amount of
data interacting with the DGUS system, it needs to be broken into small packages for
interaction. For example, the 4K data in the cloud is sent to the WIFI module. The
WIFI module needs to be disassembled into small packages and written into the
DGUS system variables in turn.

3.2. Network interface definition in DGUS system

The definition address of the network part in the DGUS system is in the area of
0x400-0x4FF, which is defined as follows:
Lengt
h Recommended
Definition Address Instructions
(word value(hex)
)
0x5AA5 indicates that the network communication interface is enabled
Recommended value description: Generally 0x5AA5 is written as a
fixed value to 22 file.
Network switch
0x400 1 5AA5 It is also possible to use the configuration button to return or
interface
incremental regulation and other touch controls to write the trigger key
value 0x5AA5 to address 0x400 to achieve the opening of the network
interface.
D5-D4:0x5AA5 enable the RMA spatial data uploading immediately.
D3-D2: RMA variable memory address to be uploaded.
D1-D0: the word length of the RMA variable memory to be uploaded.
(Currently up to 4KByte)
RAM ALARM 0x401 3 All are 00 Recommended value description: It is used to transmit the data of the
variable address on the screen to the cloud server, which is usually
applied to the cloud call view of the alarm history information and other
parameters. If you do not need to use this function, you can fill in 0000
by default in 22 file.
Reserve 0x404 12 All are 00 Reserve.
High byte: 0x5A indicates that the device description is valid.
Low byte: the encoding method and length of the device description
text.
.7-.6: encoding 0x00=UNICODE 0x01=GBK, GBK is recommended.
0x410 1 5A45
.5-.0: describes the text length 0x00-0x34.
Recommended value description: Write the configuration at a fixed
value of the 22 file corresponding address, the encoding method GBK
written here, the text length is 5
Device manufacturer ID, assigned by DWIN factory, 0xFFFF: 0000 -
0x411 2 00000001 0xFFFF: FFFF segment is reserved. After the device is added to the
Device DWIN cloud platform, it is automatically generated by the platform.
description The classification of each manufacturer's equipment is according to the
DWIN classification standard equipment classification.
0x413 1 0001
After the device is added to the DWIN cloud platform, it is automatically
generated by the platform.
The individual device number of each type of device.
0x414 2 user-defined After the device is added to the DWIN cloud platform, it is automatically
generated by the platform.
Device description text, up to 52Bytes.
44475553325F543
Recommended value description:
0x416 26 555494431(behind
44445553325F543555494431, corresponding to the ASCII code
all 00)
character DGUSII_T5UID1, has been written as a fixed value written in
22 file. The user can also make a text variable address association for
display.
Example of cloud platform interface:

RMA automatically refreshes the server interval


0x0000-0xFFFF in 0.1 seconds.
0x430 1 012C Recommended value description: Writing 0x0000 means that no
automatic refresh is required. 0x012C indicates that the automatic
refresh interval is 30 seconds.
RMA (mapped to the server's variable memory) read space start
address, word address, out of bounds can not be read.
0x431 1 1000
Recommended value description: 0x1000 means to start reading space
from 0x1000 address.
RMA read space size in 128Words with a maximum size of 2KWords
Device
and 0x0000 indicates forbidden reading.
description 0x432 1 0004
The recommended value 0x0004 indicates a read space size of
(RMA mapping)
512Words, which can be set to 0x01F4 at most.
RMA write space start address, can overlap with the read space, can
not write out of bounds.
0x433 1 2000
The recommended value 0x2000 indicates reading space starting at the
address 0x2000.
RMA write space size in 128Words with a maximum size of 2KWords,
0x0000 indicates write forbidden.
0x434 1 0004
The recommended value 0x0004 indicates a read space size of
512Words, which can be set to 0x01F4 at most.
0x435 3 All are 00 reserved
The remote upgrade interface is enabled. 0x5AA5 indicates that the
Device
device is enabled with the remote upgrade interface. The system will
description
0x438 1 5AA5 automatically detect the Buffer.
(remote
Recommended value description: Generally 0x5AA5 is written as a
upgrade)
fixed value to 22 file. It is also possible to use the configuration button
return or incremental regulation and other touch controls to write the
trigger key value 0x5AA5 to address 0x438 to achieve the switch.
0x439 1 0064 Remote upgrade packet timeout timer configuration in 0.1 second.
The first remote upgrade space for the device (aligned to 4KB) is
5A defined:
00010 D7:0x5A indicates that the remote upgrade space is enabled.
0x43A 4
00000 D6-D3: 32-bit start address of the upgradeable space (lower 12 bits is
0F00 0), up to 4 GB.
D2-D0: The size of the upgradeable space, in 4KB, up to 4GB.
5A00 0000
0x43E 4 The second remote upgradeable space definition for the device
0000 8000
0x442 4 All are 00 The third remote upgradeable space definition for the device
0x446 4 All are 00 The fourth remotable upgrade space definition for the device.
Remote upgrade Buffer interface definition:
D3:0x5A indicates that the remote upgrade Buffer is valid.
D2: upgrade mode 0x00= the communication side is responsible for
verifying the data CRC, and the error frame informs the host to resend.
D1: the number of buffers available for remote upgrades, 0x01-0x10, up
to 16.
D0: the starting address of Buffer0 is high byte (word address) and low
address is 8bit 0x00.
5A Each Buffer is fixed in 2304 words (0x900) space, which is arranged in
00 the back row.
0x44A 2 08 A single Buffer definition (the first 512 bytes is the control interface, the
B0 next 4KB is the data): D0:0x5A means to start the remote upgrade of
00 this buffer once, and clear it after CPU processing.
D1: Remote upgrade space selection, 0x00-0x03, one of 4 remote
upgrade spaces.
D2-D5: Write the destination address of the remote upgrade space. The
lower 12 bits are 0 (aligned to 4KB).
D6-D7: Data byte length, 0x0001-0x0FFF.
D8-D9: Data CRC checksum.
D10-D511: Reserved.
D512: Data starts, up to 4096 bytes.
0x44C 4 All are 00 reserve
Device QR_Code device QR code
description 0x450 48 All are 00
reserved
D31: 0x5A indicates that the communication device description data is
valid.
Communication
D30: The encoding method and length of the device description text.
device 0x480 16 User-defined
.7-.6 encode mode 0x00=UNICODE 0x01=GBK, GBK is recommended.
description
.5- .0 Description: The length of the text is 0x00-0x14.
D29: Communication device category 0x01=WiFi
D28: Communication device status, bit definition
.7 Equipment working status 0=Configuration 1=Normal;
.6-.3 undefined, write 0;
.2- .0 signal quality, 0x00-0x07 A total of 8 files, 0x00 means the worst,
0x07 means the best.
D27-D22: 6Bytes communication device MAC address
D21-D20:reserved
D19-D0: Description of the communication device in text format, up to
20Bytes.
Communication Customize the communication device, such as WIFI username and
device 0x490 8 User-defined password.
reserved

The device description information is corresponding to the 0x0800-0x09FF byte address

of the 22 initialization file, and the corresponding content configuration (regardless of

whether the 22 file initialization variable buffer function is enabled, the underlying layer will

automatically handle the loading).

4. WIFI register interface definition

The address of 0x400-0x47F is the communication interface of the DGUS system,


and the address of 0x480-0x4FF is the function and status interface of the specific
communication module or device.

Different network modules and devices have different definitions. The following is
the definition of WIFI module.

Length Recommended
Definition Address Instructions
(word) value (hex)
D31: 0x5A indicates that the communication device description data
is valid.
D30: The encoding method and length of the device description text.
.7-.6 encode mode 0x00=UNICODE 0x01=GBK, GBK is
recommended.
.5- .0 Description: The length of the text is 0x00-0x14.
D29: Communication device category 0x01=WiFi D28:
Communication device status, bit definition
Communication
.7 Equipment working status 0=Configuration 1=Normal;
device 0x480 16 User-defined
.6-.3 undefined, write 0;
description
.2- .0 signal quality, 0x00-0x07 A total of 8 files, 0x00 means the
worst, 0x07 means the best.
D27-D22=6Bytes MAC address of communication equipment,
D21-D20 are reserved.
D19-D0: The description information of the communication device in
text format, up to 20Bytes.
Where D19:D18 is fixed in position indication "OK", D17-D0 wifi
module version number
Restart WIFI module is valid
D15-D14: The baud rate setting is reserved. Currently fixed at
921600bps, it cannot be set.
WIFI D13-D9: keep the local IP address
hardware D13: 5A means the IP address is valid
0x490 8 User-defined
parameter D12-D9: IP address XX.XX.XX.XX (such as decimal
Set up 192.168.10.150)
D8: WIFI module switching Debug firmware 5A means valid.
D7: D0: WIFI module type identification information Default
"DWD100".
D7: Writing 5A means starting the WIFI configure network, and the
configure network is completed. The value is cleared to 0.
D6: 0x5A means to start the network name and password to connect
WiFi_Config 0x498 4
to the router (the network name and password are saved at 0x4B0)
D6:0XA5 indicates that start scanF scan function result is placed at
0x4D0
D7-D6, as long as it is started once, D7-D6 will be cleared at the
same time after completion. The two Internet access modes cannot
be started at the same time. If they are all 5A, the one-click configure
network takes precedence.
D5: Network time 5A means the screen comes with RTC (0x9C); 5B
means RTC library RTC (0xF430)
D4-D2: D4:0x5A means the UDP port setting is valid
D3-D2: UDP port number
D1: The WIFI module is automatically upgraded. 5A means enable.
D0: Soft reset. 5A initiates reset and reset is cleared to 0.
The user can design the configure button in the UI.
Start manual configure network touch button (press to return 0x498
address write 0x005A)
Start one-key configure network touch button (press to return 0x498
address write 0x5A00)
Reserve 0x49C 4 All are 00 reserved
D15-d14 (0x4A0) reserved, the wifi version number is displayed at
the 0x487 position ASC code
D13-d12: configure network status feedback
00: unmatched network
01: start configure network
02: in the configure network
03: configure network success
0F: configure network failure
D11-d10: network connection status
00:user name and password not obtained
01:WIFI router connection is successful
network status 0x4A0 8
02: WIFI module self-upgrade
03: connect to the server
04: logged in to the server
05: connected to the cloud
D9-D8: (0x4A3) network strength (same as 481)
D7-D6: Reserved
D5-D2: Reserved
D1-D0: (0x4A7) Keep the counter, and each cycle period (<1s) will
increase by 1. DGUS finds that the value has not changed for a long
time, and it can be considered that the WIFI module has crashed.
For the next step
D7: state machine.
Program
0x4A8 4 D6: UART state machine.
running status
D3-D0: remaining stack space.
D7:5A means the time is valid.
Network RTC 0x4AC 4
D6-D0:Year Month Day Week (0-6) Hours Minutes Seconds
Network 0x4B0 32 0x4B0: SSID, the end must end 0xFF.
parameters 0x4C0: SN, the end must end at 0xFF.
0x4D0 48 0x4D0: Save, the name of the SSID split by \n

The registers that DGUS sends commands to WIFI such as 400H, 490H, etc., will be
actively read by the WIFI module every 0.1s-0.2s.

The status of the WIFI module is 480H, 4A0H. These registers will be written into the
DGUS register every 3-5 seconds.

4.1 Operation instructions:

Instructions:

 Edit the 22.bin file template and modify the values you need

 The router's network name and password settings: 498H register write 005AH
enable, 4B0H set SSID and password; you can also do not set, start one-click
network configuration in the application.

 The T5UID1 platform requires the 8283 instruction code added to the OS, and an
interrupt is required to detect the WIFI serial port, please refer to the routine for
details. The T5L platform does not require any processing.

4.2 UI operation instructions: (need to make icons for status

indication)

4.2.1 Mobile phone one-click network configuration page:

Touch: start one-key network configuration button (press to return to 0x498 address
and write 0x5A00)

Display:

 One-click network configuration status icon (0x4A1 address: 00 Network not


configured 01 start network configuration 02 network configuration 03 network
configuration success 0F network configuration failure);

 WIFI connection status icon (0x4A2 address: 00 User name and password not
obtained 01: WIFI router connected successfully 02: WIFI module self-upgrade
03: connected to the server 04: logged into the server 05: connected to the cloud)
 WIFI module MAC address (0x482-484 address: hexadecimal display, 12 bytes
ASCII length display)

 WIFI module version number: (0x487 address: ASC code string display, length
18 bytes)

4.2.2 Manually enter the network name and password mode

Touch:

 Network name text input (0x4B0 address), network password text input (0x4C0
address)

 Start to connect to the network button (Press to return to 0x498 address and write
0x005A)

Display:

 WIFI connection status icon (0x4A2 address: 00 User name and password not
obtained 01: WIFI router connected successfully 02: WIFI module self-upgrade
03: connected to the server 04: logged into the server 05: connected to the cloud)

 WIFI module MAC address (0x482-484 address: hexadecimal display, 12 bytes


ASCII length display)

 WIFI module version number: (0x487 address: ASC code string display, length
18 bytes) After that, the WIFI module will automatically surf the Internet and
start data synchronization

4.3 Workflow of WIFI module serial port side:


4.3.1 Read the configuration information: After the WIFI module is powered on,
read the 0x400-4FF configuration information, and enter the next state after
reading it.

4.3.2 Status between WIFI module and DGUS:


 a. Lowest priority 0: read DGUS variables (83 instructions) every 0.1-0.2 seconds,
400H, 490H, etc. involve DGUS issuing instructions. Every 3-5 seconds, the
necessary state of the WIFI module is written into DGUS through the 82
command.

 b. Second-lowest priority 1: Whether the synchronization timing with the server


interface has expired, and then the specified big data will be periodically
uploaded.

 C. Second-lowest priority 2: Detect whether the RMA alarm interface is enabled,


and then perform triggered upload of designated big data.

 d. Second highest priority 3: Triggered upload of network configuration, network


timing, and network status change to DGUS. For example, in distribution
network, during network login, once the status changes, it will be written to
DGUS immediately.

 E. High priority 4: file upgrade. When the first file upgrade package is received,
normal task scheduling will be suspended to ensure that resources are sent to
DGUS in MQTT and serial port as much as possible. Allow other 82H/83H
instructions to be generated.

4.4 Workflow on the MQTT side of the WIFI module:

 Initialize after power on, wait for 512bytes configuration word

 Wait for the router to connect

 Determine whether to upgrade the WIFI module. If you need to upgrade the WIFI
module, upgrade the WIFI module. After the upgrade is successful, it will
automatically restart

 Access the REG registration API through the HTTP protocol and get the user
name and password to log in to the MQTT server

 Re-establish the connection and log in to the MQTT server with the user name
and password

 Subscribe to topic channels and send online notifications.

 After the data channel is established, you can perform 82H and 85H read and
write instructions with the server, synchronize the registers, and use 92H and 93H
instructions to perform file buffering.

5. WIFI communication with the server

The maximum buffer of one frame left in the WIFI module is 5K (5120), that is, the
maximum packet length with the server is 5K
5.1. Overview

5.1.1 The current data synchronization is not responding to commands, why?

 The data is centered on the device, and the data of the device is the basis. The
device itself has an automatic timing reporting mechanism. The data on the
mobile phone is only used for UI display and cannot reflect the real device status.

 The data uses a full packet transmission mechanism. That is to say, when the
device sends data to the server, every frame tries to pass all the data as far as
possible.

 If the mobile phone controls a certain operation and the device does not receive it,
the mobile phone can first lock the display data to the request state, and then
display the real value and overwrite the display value after the timeout (for
example, 5 seconds). The data on the mobile phone is considered unreliable data,
and the real data will always be reported and synchronized by the device.

 The non-response mechanism will simplify the synchronization mechanism of


each process, simplify complex problems, and finally (automatically report if it is
30s) will display all display terminals in the state of the device.

5.1.2 If there is no response, how does data convergence work?

The automatic data convergence is mainly achieved by the device actively reporting
and periodically reporting.

 The server writes data to the device and receives no response.

 However, after the server writes data to the device, it may also receive new data
immediately. After the device finds that the variable has changed, it automatically
triggers the automatic reporting function and issues the 0x85 command, which is
the variable upload of the entire block.

 If the data sent by the server to the device is not updated, it will not be reported
automatically. The command was not answered originally. The device did not find
the variable change, nor will it immediately trigger the report, so the server will
not receive the 0x85 command

If the instructions distinguish between writing and reading, they are all for
transferring registers.

The commands currently supported by the WIFI module and the server:

 The server writes data 0x82 to the device, and the WIFI module receives the
server's instruction 82, then writes data to the device. There is currently no
response to this command (if it is answered, it should be 0x83 according to the
protocol, and the response is "OK" (4F 4B).

 The server requests 0x84 to read data from the device, and the WIFI module
receives the command type 0x84 from the server. After receiving this instruction,
the WIFI module replies to the server 0x85 to answer the instruction, and at the
same time brings the data. After the server receives the 85 instruction, it needs to
write the data into the server's mapped memory block.

 The device writes data to the server

 The device reads data from the server

In fact, in the end, data only needs to be transmitted from the device to the server, or
from the server to the device. The function described by the device writing data to the
server is replaced by the 0x85 instruction. The function described by the device
reading data from the server is replaced by the 0x82 instruction.

Finally, only 0x82 instructions, 0x84, 0x85 instructions were reserved. 0x82
implements data transfer from the server to the device, 0x85 command implements
data transfer from the device to the server, and 0x84 command implements server
actively querying the device's registers.

5.2 Frame structure


5.2.1. RAM write operation

Mainly use RAM to write, especially the server writes to the device RAM
Frame header Frame length
Frame type Address (2B) Word data flow
(2B) remaining (2B)
AA55 Max 5117 0x82: write XXXX

RAM write response (not currently implemented):

Frame header Frame length


Frame type Address (2B) Word data flow
(2B) remaining (2B)
0x83: write
AA55 Max 5117 XXXX 4F4B
response

5.2.2. RAM read operation

Active query use refers to the server querying the device.

sender

Frame header Frame length


Frame type Address (2B) Word data flow
(2B) remaining (2B)
AA55 5 0x84: read

Responder (This response can be used as an instruction to be actively reported by the


device)

Frame header Frame length


Frame type Address (2B) Word data flow
(2B) remaining (2B)
0x85: read
AA55 5
response

5.2.3. Upgrade BUF frame

Server to device

Frame Frame length


Frame type BID (2B) BUF structure
header (2B) remaining (2B)
D0: 0x5A means to start a remote upgrade
of this buffer, which is cleared after CPU
processing.
D1: Remote upgrade space selection,
0x00-0x03, one of 4 remote upgrade spaces.
0x92:
BUF ID D2-D5: Write the target address of the
AA55 5 Upgrade BUF
number remote upgrade space, the lower 12 bits are
write
0 (aligned to 4KB).
D6-D7: data byte length, 0x0001-0x1000.
D8-D9: data CRC checksum.
D10-D511: Reserved.
D512: Start of data, up to 4096 bytes.

Response

Frame header Frame length


Frame type BID (2B)
(2B) remaining (2B)
0x93: Upgrade
BUF ID
AA55 0×02 BUF write
number
response

5.3. Initialization process

WIFI and server operation process: (mainly communicate through DGUS business
theme)

 After WIFI is powered on, use the content of 0x411-0x413 as PID and MAC
address as DID to register with the registration server, get the login information,
and then log in to the server.

 Subscribe to DGUS business topics.

 Write the 0x400-0x4FF data in DGUS to the server through the DGUS business
theme.

 After the initialization is completed, all the data frame structures will be in the
topic in the future.
5.4 Data communication
RMA operation, frame type is 0x82 or 0x83.

The communication frame header with the server is 0xAA 55 data stream.

After receiving the data stream from the server, the WIFI module is converted into a
DGUS frame structure and reads and writes to DGUS.

5.5. BUF upgrade

The server converts the corresponding address (4G space) according to the DGUS file
rules. Then form a BUF application frame.

The BUF frame is put into the communication frame as a payload.

After receiving the BUF, the WIFI answers the BUFID.

5.6 Use of UDP485 bus

 The address to be uploaded 0x402 is set to the address to be uploaded. For


example: 0X3800

 Set the length of the data to be uploaded at 0x403 For example: 0x0010

 Need to set 0x401 to 0x7AA7, after sending, it will be cleared automatically

The data will be broadcast to all devices in the local area network through UDP. Other
devices will get the data and write the data to the local 3800 address to overwrite the
original data. The specific data will be determined by the device.

5.6.1. Writing the frame structure of UDP bus

UDP write operation: mainly use RAM to write to device RAM

Frame header Frame length Frame type Address (2B) Word data flow
(2B) remaining (2B)
AA55 Max1024 0x72: write XXXX

You might also like