Skip to content

Y202-W Standard WiFi DTU Technical Manual

Table of Contents

  1. Introduction
  2. System Overview
  3. Hardware Interfaces
  4. Electrical Specifications
  5. Serial Configuration & Packaging
  6. WiFi & Ethernet Networking
  7. Socket Protocol Workflows
  8. Modbus Gateway & JSON Services
  9. Advanced Functions
  10. Remote Management & Diagnostics
  11. AT Command Highlights

1. Introduction

Y202-W is the WiFi-enabled member of the Yanji standard DTU family. It converts two independent RS232/RS485 channels to WiFi or 10/100 M Ethernet with dual sockets per port, Modbus RTU ↔ TCP gateway, JSON uploader, HTTP/MQTT clients, registration packets, heartbeats, OTA, and remote AT workflows inherited from the MiniLink Y201/Y202 series. The compact 84 × 70 × 25 mm enclosure uses a DB9 plus pluggable terminal and supports 5–36 V DC, making it ideal for retrofitting panels where only wireless uplinks are available.

ItemDescription
MCU & OSDual-core 240 MHz MCU + RTOS, dual watchdog
Serial Interfaces2 × RS232/RS485 (COM1 DB9, COM2 3-pin terminal)
Wireless802.11 b/g/n @ 2.4 GHz, AP / STA / AP+STA
Ethernet10/100Base‑T RJ45, static/DHCP
ServicesTransparent sockets, HTTP client, MQTT client, Modbus gateway, JSON uploader, OTA
Power5–36 V DC via terminal or DC barrel (Ø5.0 mm)

Dimensional drawings, SKU matrix, and ordering information reside in the Y202-W Specification.


2. System Overview

  • Dual Serial Engine – COM1 and COM2 are isolated from each other, each exposing Socket A/B plus packaging and heartbeat parameters.
  • Flexible Uplink – WiFi can run AP, STA, or AP+STA concurrently, while an RJ45 port provides wired fallback; AT+NETIF selects the active interface.
  • Firmware Parity – Shares the same feature set as Y202-R (TCP/UDP, HTTP, MQTT, Modbus gateway, JSON uploader, EDP peer-to-peer, remote AT, OTA, watchdog).
  • Built-In UI – Web console (192.168.4.1 in AP mode) mirrors AT commands and provides Status/System/Port tabs.
  • Industrial Protections – 5–36 V input, reverse polarity guard, EFT/ESD hardening, dual watchdog, programmable reboot-on-silence, and offline cache.

3. Hardware Interfaces

GroupDescription
Power5.08 mm 2-pin terminal (V+/V-) and Ø5.0 mm DC barrel (center positive).
SerialCOM1 DB9 male (factory RS232, switchable to RS485); COM2 3-pin terminal (A/B/GND or TX/RX/GND).
WiFiSMA female connector for external 2.4 GHz antenna.
EthernetRJ45 10/100Base‑T with LINK/ACT LEDs, auto MDI/MDIX.
USBMicro-USB (CDC) for local AT commands and firmware download.
ButtonReload – hold ≥3 s to revert to default parameters (equivalent to AT+RSTCFG).

LED Behavior

LEDBehaviorMeaning
POWERSteady onDC supply OK
WORK (WiFi)Slow blink (~1 s)WiFi connected (STA) or AP broadcasting
WORK (WiFi)Fast blink (~300 ms)WiFi disconnected / searching
LINKOnEthernet link established
ACTBlinkEthernet activity
TX1/RX1BlinkCOM1 traffic
TX2/RX2BlinkCOM2 traffic

4. Electrical Specifications

ParameterValue
Supply Voltage5–36 V DC
Typical Current55 mA @ 12 V (WiFi idle)
Operating Temp-40 °C ~ +85 °C
Humidity5% ~ 95% RH, non-condensing
Power ProtectionReverse polarity, surge clamp, user-fused recommended
WatchdogHardware + software; programmable reboot timer (AT+SOCKRTO)

Ensure shielding for RS485 pairs and provide ≥15 mm clearance for antenna rotation and airflow. Keep WiFi antennas outside metal cabinets or use an extension pigtail.


5. Serial Configuration & Packaging

5.1 UART Parameters

Per-port command: AT+UARTn=<baud>,<databits>,<stopbits>,<parity>,<fc> (n = 1/2).

FieldOptionsDefault
Baud Rate2,400–460,800 bps115,200
Data Bits7 / 88
Stop Bits1 / 21
ParityNONE / EVEN / ODDNONE
Flow ControlNFC (RS232) / auto-direction (RS485)NFC

5.2 Packaging (AT+UARTTLn)

  • Length trigger: 64–1024 bytes (default 1024).
  • Gap trigger: 0–300 ms (0 = auto based on baud, default 0).
  • Flush occurs when either threshold is met. Example: AT+UARTTL1=30,512.

5.3 Modes

  • Transparent Mode – Default serial tunnel.
  • AT Command Mode – Send +++, wait ≥500 ms, send a, then issue commands; exit with AT+EXIT.
  • Broadcast AT / Remote AT – Enable via AT+EXAT for socket-side management; protected by keyword.

6. WiFi & Ethernet Networking

6.1 WiFi AP Mode (Default)

ParameterValue
SSIDHY-W502
SecurityWPA2-PSK
Passwordadmin123 (example, change immediately)
IP192.168.4.1
DHCPEnabled (1–6 STA)
HTTP Loginadmin / admin

Steps:

  1. Power on and connect a PC/phone to SSID HY-W502.
  2. Browse to http://192.168.4.1, enter credentials.
  3. Configure WiFi STA, Ethernet, serial, sockets, Modbus, heartbeats.
  4. Save and reboot.

6.2 WiFi STA / AP+STA

  • AT+NETIF=STA to join an external AP; set credentials via AT+STA=<ssid>,<password>.
  • AT+NETIF=APSTA keeps the device discoverable while connected upstream (AP radio follows STA channel).
  • Channel selection for AP mode: AT+WCH=<1-13>.
  • STA status query: AT+STALK.

6.3 Ethernet Mode

  • AT+NETIF=ETH enables RJ45 and disables WiFi radio.
  • Static IP: AT+WAN=STATIC,192.168.10.8,192.168.10.1,255.255.255.0.
  • DHCP: AT+WAN=DHCP.
  • DNS backup: AT+DNS=114.114.114.114.
  • LAN discovery broadcasts UDP on port 8168 with keyword HuayunIOT (AT+SEARCH=<port>,<key>).

7. Socket Protocol Workflows

Each COM port exposes Socket A and Socket B. Enable with AT+SOCKENns=ON and configure type/address/port via AT+SOCKns=....

7.1 TCP Client / Server

TCP Client example (COM1 SocketA):

AT+SOCKEN1A=ON
AT+SOCK1A=TCPC,10.10.10.50,9000
AT+REBOOT

Auto-reconnect occurs every second.

TCP Server example (COM2 SocketB):

AT+SOCKEN2B=ON
AT+SOCK2B=TCPS,0.0.0.0,8010
AT+REBOOT

Up to eight TCP clients per socket; data is broadcast to all connected clients.

7.2 UDP Client / Server

  • UDPC requires target IP/port; optional localport ensures firewall pinholes.
  • UDPS listens on a local port and replies to the most recent sender—ideal for mobile maintenance tools.

7.3 HTTP Client

  1. Switch socket to HTPC.
  2. Configure headers (AT+HTPHDn=Connection:keep-alive|Content-Type:application/json).
  3. Select request type (AT+HTPREQn=GET/POST/AUTO).
  4. For POST, set URL via AT+HTPURLn=/api/v1/upload.
  5. In AUTO mode, include the full URI in the payload (e.g., http://example.com/path\r\nPAYLOAD).

7.4 MQTT Client

  • AT+MQCONFn=<n>,<type>,<addr>,<port> defines broker endpoint; type can be TCP or TLS (via external gateway).
  • AT+MQAUTHn=<user>,<password> sets credentials.
  • AT+MQPUBn=<topic>,<qos> and AT+MQSUBn=<topic>,<qos> control data flow.
  • Aliyun/Baidu/OneNET helpers: AT+MQALI, AT+MQBAI, AT+MQONE.

7.5 Registration Packets & Heartbeats

  • Registration type: AT+REGTPn=MAC/CUS.
  • Mode: AT+REGMDn=OFF/FIRST/EVERY/ALL.
  • Payload: AT+REGDATn=<hex>.
  • Heartbeat mode: AT+HEARTMDn=OFF/NET/UART, interval via AT+HEARTTMn (1–86,400 s), payload via AT+HEARTDATn.

7.6 Peer-to-Peer (EDP)

  • Acquire EDP IDs from Yanji, configure via AT+SOCK1A=EDP,huayuniot,888 and AT+EDP1=<target_id>,OFF.
  • Supports one-to-one, one-to-many, many-to-one tunnels while still allowing HTTP/MQTT on other sockets.

8. Modbus Gateway & JSON Services

  • Enable per port: AT+MBMDn=ON. Modbus TCP frames on sockets convert to RTU on the associated COM, preserving timing.
  • Scheduler: AT+MBCFGn=<enable>,<interval_ms>,<period_s> defines poll timing; AT+MBCMDn=<hex> holds RTU frames.
  • JSON uploader:
    AT+HJREG=loop_voltage,0,1000,0.1,V
    AT+MBJSn=ON,30
    Data can be delivered via HTTP (HTPC sockets) or MQTT topics.

9. Advanced Functions

FeatureCommandDescription
Offline CacheAT+CACHEn=ON/OFFBuffers up to 50 frames when uplink fails; auto-flush on recovery.
No-Data RebootAT+SOCKRTO=<minutes>Reboots device if no data arrives within the window (default 1,440 min).
Remote ATAT+EXAT=<mode>,<keyword>Enables password-protected AT control via sockets after LAN discovery.
HTTP OTAAT+DOWNLOAD=<uri>Pulls firmware from HTTP server, verifies, then swaps after reboot.
Parameter BackupAT+BKCFG, AT+RSTCFG, AT+CLRCFGBackup, restore, or factory reset configuration partitions.
WiFi ScanAT+SCANLists surrounding AP SSID/RSSI/auth for site surveys.
STA ListAT+APLKShows clients connected to the AP radio.

10. Remote Management & Diagnostics

  1. After commissioning, run AT+BKCFG and store the backup file in your CMDB for rapid field recovery.
  2. Enable registration packets (FIRST) so head-ends receive MAC/SN whenever sockets connect.
  3. Configure NET heartbeats (e.g., 60 s) to detect uplink issues; optionally enable UART heartbeats for PLC keepalive.
  4. Set AT+SOCKRTO=30 (minutes) when unattended installations must auto-recover from silent networks.
  5. Schedule OTA windows and keep firmware hosted on accessible HTTP servers; use AT+DOWNLOAD for remote upgrades.
  6. Use LAN discovery (AT+SEARCH=8168,HuayunIOT) plus remote AT to audit fleets without local access.
  7. For WiFi STA deployments, monitor AT+STALK RSSI values (> -65 dBm recommended).

Diagnostic commands:

  • AT+DEVINFO – Model, firmware, MAC, SN, build time.
  • AT+SOCKLK – Socket connection states.
  • AT+PING=<host> – Reachability tests (returns latency or error).
  • AT+NETSTAT – Interface statistics (WiFi/Ethernet).
  • AT+LOG=<level> – Sets temporary debug verbosity.
  • Reload button – Restores last saved configuration without host.

11. AT Command Highlights

CommandPurpose
AT+LISTEnumerate supported commands
AT+VERFirmware version
AT+NETIFSelect AP / STA / AP+STA / Ethernet
AT+AP, AT+STA, AT+WCH, AT+NUMSTAWiFi SSID/password/channel/STA limit
AT+WAN, AT+DNS, AT+SEARCHEthernet IP/DNS/discovery
AT+UARTn, AT+UARTTLnSerial parameters and packaging
AT+SOCKns, AT+SOCKENnsSocket definition and enablement
AT+REGTPn, AT+REGMDn, AT+REGDATnRegistration packets
AT+HEARTMDn, AT+HEARTTMn, AT+HEARTDATnHeartbeat settings
AT+MBCFGn, AT+MBCMDn, AT+MBJSn, AT+HJREGModbus scheduler & JSON mapping
AT+MQCONFn, AT+MQAUTHn, AT+MQPUBn, AT+MQSUBnMQTT workflows
AT+HTPURLn, AT+HTPHDn, AT+HTPREQnHTTP client settings
AT+EDPnPeer-to-peer configuration
AT+DOWNLOADHTTP OTA
AT+CACHEn, AT+SOCKRTOOffline cache & auto-reboot
AT+BKCFG, AT+RSTCFG, AT+CLRCFGBackup/restore/factory reset