User Manual for Transparent Module: DT-06
from SZDOIT
## 1. Introduction DT-06 (TTL-WiFi) is designed and developed based on ESP-M2 WiFi module, which is extracted the TTL, EN, STATE and other pins. Importantly, the TTL-WiFi is already built-in the serial transparent transmission firmware programmed by our company, which can realize the transparent transmit the data to the cloud on the real-time, together with low-power control, status indicator. This board can replace the old wiring serial WiFi device to realize the data collection and control. It has the following features. ![DT-0636](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-0636.jpg) - Fully compatible with the original electrical interface and physical interface for the serial transparent Bluetooth; - Built-in the industrial transparent transmission firmware V3.0 with stability and reliability by using the Web Configuration; - Built-in the high performance WiFi module ESP-M2 with size: 34mm*17mm*4mm; - Working voltage: 4.5V~6.0V, TTL working voltage: 3.3V (compatible with 5.0V); - Provided pins: STATE, TXD, RXD,EN; - Average current: 80mA; when data sent, it is 170mA; but it is 20μA at deep sleep mode; - Support serial AT command; - Support re-programmable, OTA firmware update; - Seamless transparent transmission between serial and WiFi; - Built-in HTTP Web Server, support configure parameters by web page; - Support re-connect automatically at WiFi STA mode and TCP Client; - Support set baud rate, data bit, parity check, stop bits, and/or subcontracting time; - Support baud rate (bps): 300/600/1200/2400/4800/9600/19200/38400/57600/74800/115200/ - 230400/460800/921600/1843200/3686400; - Support AP enable, self-defined SSID/password, self-defined IP and network duration; - Automatically scan the peripheral WiFi hotspot, support STA enable, DHCP, self-defined IP; - Support TCP Server, TCP Client, UDP Server, UDP Client and UDP local broadcast; - Support DNS resolution automatically for the remote sever address; - Support checking the status by AT command; - Provide IO4 to show the WiFi status; - Working temperature: -40℃-125℃; - Applications: smart home, wireless data connection and transparent transmission, smart car control, wireless serial printer, LED light industrial control etc. The Structure of TTL-WiFi can be shown as follows. ![DT-061](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-061.jpg) ***Give up the complex AT command, Simply configure parameters by Web page to transparently transmit data.\*** TTL-WiFi transparent transmission firmware is developed based on the ESP-M2 wireless WiFi module, which can realize the real-time transparent transmission between serial and WiFi. After our deep research, the performance of firmware can be satisfied with industrial requirements on the stability and functionality. In this time, we have already greatly optimized the receive and transmit performance. Especially, we design the reconnection mechanisms at STA and TCP Client modes to guarantee the stable connection and transmission for the data link. **The usage of DT-06 is the same as HC-06.** ![DT-0635](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-0635.jpg) ## 2. Interface definition The interface definition of TTL-WiFi can be shown in the following. ![DT-062](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-062.jpg) ## 3. Functions of button and LED **Table 2.1 Functions of button and LED** | Num. | Type | Function illustration | | ---- | ---- | ------------------------------------------------------------ | | 1 | LED | LED connected to VCC3.3 by a pull up resitance, and other is connected to GPIO4 | | 2 | SW1 | Connected to GPIO0 to coordinate with SW2 button to download the firmware. | | 3 | SW2 | Connect to RST, to coordinate with SW1 to download the firmware | **Importantly, when downloaded the firmware, please firstly press SW1 button, and then press SW2 button, and at last loose the button to finish the download. (Refer to the ESP-M2 module)** **Table 2.2 LED definition** | Num | LED indicator | Function | | ---- | --------------- | ------------------------------------------------------------ | | 1 | Always lighting | Successfully connect to the wireless router when WiFi module is at STA or STA+AP mode | | 2 | Lighting slowly | Level for IO switches once each 1s; if works at AP mode, it shows that the WiFi module unsuccessfully connected to the wireless WiFi router; If at STA mode, the module is trying to connect the wireless router; If at AP+STA mode, the module is trying to connect to the wireless router. | | 3 | Fast lighting | When press SW1/Flash button, if the serial received the data, or the network received the data from the serial, LED would light fast. | | 4 | Extinguish | WiFi module doesn’t work since the power isn’t normal or isn’t the transparent transmission firmware. | ### 3.1 Definition of pins is listed as follows. **Table 2.3 Definition of pins** | Num | Pin | Type | Function | | ---- | ----- | ---- | ------------------------------------------------------------ | | 1 | STATE | I/O | GPIO4; built-in transparent transmission firmware, to show the net connection status: connect to wireless router at STA mode. STATE is low level. | | 2 | RXD | I/O | GPIO3; Module is already serially connected to a 22Ωcurrent-limiting resistance in the inner, thus can connect 5.0V voltage; Can used as the UART Rx when built in the flash. | | 3 | TXD | I/O | GPIO1; Module is already serially connected to a 22Ωcurrent-limiting resistance in the inner, thus can connect 5.0V voltage; Can used as the UART Tx when built in the flash. | | 4 | GND | P | GND | | 5 | VCC | P | Module power: 4.5V~6.0V, recommended voltage is 5.0V | | 6 | EN | I | Enable, high level: enable to let chip work normally; low level, chip is closed. | ### 3.2 Usage of Web configuration This module is already built-in the HTTP Server. Thus, it can configure the parameters by the browsers on pc or mobile phone or other smart devices, without of need of any other tools or Apps. In the factory settings, the module works at AP mode, and the signal is “Doit_WiFi_xxxxxx” , where, “xxxxxx” is the last 6 number of MAC address of this module. Then, one can connect this WiFi hotspot by PCs or phones , and other smart deveices (supportable Android and Ios, Windows) with no password. ![DT-063](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-063.jpg) After successful connection, input the default IP address: “**192.168.4.1**”. ![DT-064](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-064.jpg) Information for hotspot When open the configuration, there is three sub-pages, STATUS, MODULE, and MORE, as shown in the following. ![DT-065](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-065.jpg) **3.2.1 STATUS sub-configuration** ![DT-066](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-066.jpg) Successful connection at STA mode On the STATUS page, it displays much information, e.g., MAC address, IP address at STA mode, WiFi connection status, IP address at AP mode, and the run time, where “Wi-Fi Status”: its value can be “idle”, “connecting”, “wrong password”, “no ap found”, “connect failed”, ”connected (rssi:xxx)”. If STA is connected successfully, it would display the signal strength (i.e., RSSI value, it is a negative). “System Running Time”: display the run time for the device. **3.2.2 MODULE configuration page** “MODULE” page has 3 sub-menus, which can provide many configurations. ![DT-067](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-067.jpg) MODULE meanu **3.2.3 Serial (serial configuration)** In this page, one can set the serial baud rate, data bits, parity checking, stopbits, etc. At the same, one can set the package subextract time. - Set serial baud rate:300/600/1200/2400/4800/9600/19200/38400/57600/74800/115200/230400/460800/921600/1843200/3686400 - Data bit: 5/6/7/8 - Parity checking: NONE/ODD/EVEN - Stopbits: 1/1.5/2 ![DT-068](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-068.jpg) Serial configuration page After setting, can use “Save ” to save the setting. If there are some errors for the parameters, it would remind you a failure. Or, it would successful. Especially, if the setting is successful, then the parameters are enable after reboot the WiFi module. ![DT-069](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-069.jpg) Failure page after save ![DT-0610](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-0610.jpg) Success page after save In the later, the web sets are similar, this manual would be ignored. **3.2.3WiFi (WiFi configuration)** WiFi module can be set at AP, STA, and AP+STA modes. **Note: transmit a signal, and other devices can connect it; STA: as a slaver to connect the other WiFi signal.** - AP setting: - Can open or close AP mode; - Self-define the name and password for the AP. If password is none, then it doesn’t encrypted; or would use web encrypted to connect the WiFi signal. **Note: WiFi password needs 8~63 characters.** - Self-define IP address, sub network mask, and gateway address for WiFi module at AP mode. **Note: at AP mode, the IP, sub-network mask, and gateway address must be not the same network duration from those at STA mode. For example, at AP mode, if IP is 192.168.4.1, then the IP at STA cannot be 192.168.4.X.** ![DT-0611](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-0611.jpg) WiFi Configuration-AP mode **STA setting** - When open the WiFi configuration page, the WiFi module would scan the WiFi hotspot listed in the table block. - Set the SSID and Password for the wireless router. - Whether starts DHCP, if yes, then, IP, netmask, gateway address cannot be assigned. Or, it need to be assigned. **Note: at AP mode, the IP, sub-network mask, and gateway address must be not the same network duration from those at STA mode. For example, at AP mode, if IP is 192.168.4.1, then the IP at STA cannot be 192.168.4.X.** ![DT-0612](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-0612.jpg) WiFi configuration-STA mode **3.2.4 Networks configuration** In the network configuration, one can set the net work mode for this WiFi module. The optional work modes have TCP server/Clien, UDP server/Client, and UDP broadcast, where - When TCP/UDP Client is chosen, the IP address of remote server can support the dynamical domain name. At this time, our firmware can get the IP address automatically by the domain name; - UDP mode can support the broadcast in the local networks. The writing rule is 192.168.x.255, where “x” is the obtained IP address segment at STA mode. ![DT-0613](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-0613.jpg) Network configuration **3.2.5 MORE configure** ![DT-0614](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-0614.jpg) More configure **3.2.6 Restart** ![DT-0615](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-0615.jpg) Re-start page **3.2.7 the factory setting** The factory parameters: STA is closed, working at AP mode, IP address is 192.168.4.1; Serial parameters is 9600, n, 8, 1, subextract time is 50ms; Network configuration is TCP Server, monitor port is 9000. ![DT-0616](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-0616.jpg) Restore the factory ### 4. Version Check the versions of software and hardware. ![DT-0617](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-0617.jpg) Check version ## 5. Built-in AT command set Our transparent transmission firmware is already built-in the serial AT command to get the current status of WiFi module, or restore the WiFi parameters, which are listed as follows. Table 4. 2built-in AT command set | Data direction | Command(ASCII string) | meaning | | ----------------------------------------------- | ------------------------------------------------- | ------------------------------------------------------------ | | STA status check | | | | MCU->WiFi module | AT+STASTATUS | Check the STA status | | WiFi module->MCU | STA:OK | WiFi modle replies STA successful connection | | WiFi module->MCU | STA:DOWN | WiFi module replies STA connection is closed | | Get IP and MAC at STA mode | | | | MCU-> WiFi module | AT+STAINFO | Get IP and MAC from WiFi module | | WiFi module->MCU | Mac\|IP, for example 5CCF7F116380\|192.168.1.125 | Get the MAC and IP at STA mode | | Check the connection status at TCP Client mode | | | | MCU-> WiFi module | AT+TCPCLIENT | Check the connection status at TCP Client mode, and no meaning at other modes. | | WiFi module->MCU | TCP: OK | TCP client is already connected | | WiFi module->MCU | TCP: OFF | TCP client is off the connection | | Restart module | | | | MCU->WiFi module | AT+RST | Restart WiFi module | | WiFi module->MCU | RST: OK | Immediately reply when received the command | | Restore the factory setting | | | | MCU->WiFi module | AT+RESTORE | Immediately reset after WiFi restores | | WiFi module->MCU | RESTORE: OK | Immediately reply when received the command | **Take an example** **Step 1:** use a USB-TTL module to connect TTL-WiFi module, and then open the corresponding serial port, and press the RST button to restart the board. **Step2:** send “AT+STASTATUS” to check the connection of STA. ![DT-0618](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-0618.jpg) AT+STASTATUS **Step 3**: Use this command to restart the module: AT+RST ![DT-0619](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-0619.jpg) AT+RST ## 6. A classical configuration example In this section, we will provide two examples to show the usage of the firmware. Take the TTL-WiFi module to connect USB-TTL module as an example. USB-TTL module is connected to the USB of PC. ![DT-0620](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-0620.jpg) Connection for USB-TTL module **6.1 Transparent transmission example in local network** In this example, we would like to realize the transparent transmission between WiFi serial port and PC. In the default case, STA is closed in the firmware, while the serial parameters is 9600,n, 8,1 at AP mode. Network configuration is TCP Server, and the monitor port is 9000. **Step 1:** connect “Doit_WiFi_xxxxxx”, where “xxxxxx” is the MAC address of WiFi module, and here, the value is “83094E”. ![DT-0621](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-0621.jpg) Connection to WiFi hotspot **Step 2:** Use TCP Debug to create a TCP Client to connect the “9003” port of “192.168.4.1”. At the same time, open a serial debug tool, e.g., DoitSerialCOM to connect USB-TTL module, and set the serial parameters as 9600, n, 8,1. By this way, one can realize the transparent transmission from serial port to the WiFi. ![DT-0622](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-0622.jpg) TCP Client setting ![DT-0623](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-0623.jpg) Fig. 5.4 Example for transparent transmission **6.2 Cloud transmission based on Doit Cloud** Based on the Doit cloud, one can realize the data remote transparent transmission between WiFi module serial port and APP. **Step 1:** open the “tcp.doit.am” on our PC, and can get the IP and port from the Doit cloud (the usage is attached in this page for the Doit cloud). As shown in the following picture, get a temporary IP address and port, e.g., “115.29.109.104” and the port is “6524”. ![DT-0624](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-0624.jpg) Open the Doit cloud **Step 2:** install a network debug tool in the phone, and use the TCP Client to connect “115.29.109.104”,(the port is “6524”). Moreover, the phone can connect to the internet, as shown in the following picture. ![DT-0625](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-0625.jpg) Network debug on the phone **Step 3:** WiFi module connects physically to the PC by USB-TTL module, and then power. Firstly, let phone connect the WiFi hotspot with the factory parameters, and enter into the WiFi configuration page. Set WiFi module work at STA mode, and input SSID and PASSWORD of the wireless router, and save it. In this example, STA mode is enable, SSID Name is “Doit”, and password is “doit3305”, other parameters are the default settings. (Note that, SSID and password is for your used wireless router. Doit is the router from our company) Then, enter into the network configuration page, choose TCP Client, and the IP and port is “115.29.109.104” and “6524”. ![DT-0626](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-0626.jpg) STA mode configuration ![DT-0627](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-0627.jpg) Saving parameters at STA mode ![DT-0628](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-0628.jpg) Network configuration **Step 4:** Restart the WiFi module to make the setting effective, and then can realize the data transparent transmission between APP and WiFi module. ![DT-0629](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-0629.jpg) Receiving data at serial port ![DT-0630](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-0630.jpg) Receiving data at APP ## 7. Minimum system for the module This WiFi module can work at 5.0V. Pin2 (RXD), Pin3(TXD) connect to TXD and RXD for the other MCU, Respectively. ![DT-0631](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-0631.jpg) Minimum system Note: (1) The max current of IO of module is 12mA; (2) EN makes pin high level; (3) Module would enter into a update mode: GPIO0 is at low level (press SW1), and then let the module reset to power ; (4) RXD of the WiFi module is connected to TXD for other MCU, and similarly, TXD is connected to the RXD of other MCU. ## 8. Shape and Size The shape and size are shown in the follows. ![DT-0632](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-0632.jpg) Shape of TTL-WiFi ![DT-0633](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-0633.jpg) (a) Vertical view ![DT-0634](https://github.com/SmartArduino/document/raw/master/docs/ESPSeries/ESP8285/DT06/DT-0634.jpg) (b) Side view ## Contact Us - E-mails: [yichone@doit.am](mailto:yichone@doit.am), [yichoneyi@163.com](mailto:yichoneyi@163.com) - Skype: yichone - WhatsApp:+86-18676662425 - Wechat: 18676662425