[toc]
# Other features of WTH-8266
In order to increase the flexibility of the device, we provide the WTH-8266 with interface functions besides the platform https://www.lwkits.com, including the following two functions.
- Custom socket for third-party platform
- Serve as http server to provide http get interface
## Custom socket for third-party platform
WTH-8266 can serve as a tcp client customized to refer to the tcp server, as shown in the following picture.
![WTH-8266 socket](https://doc-resources.lewei50.com/lewei50/img/ht-20181205-1.jpg)
1. We use netcat to set up a tcp server on the server of test.iammeter.com to listen to port 12345.
2. Set the socket on the WTH-8266 configuration page to refer to this port.
3. Tcp server receives the packet at the first link.
4. Each time the tcp server sends a read command (nc sends it with ctrl+D), it will receive the packet.
**Packet Description**
mac:The mac address of the WiFi module which can be used as SN.
data:The first one is the temperature value, and the second one is the humidity value. If only the temperature is measured, just one data is transmitted (Please refer to the above example).
## Serve as http server to provide http get interface
This function is mainly used in the local area network, providing relevant monitoring software. The calling method is http get ip/monitorjson as shown in the picture below.
![WTH-8266 http server](https://doc-resources.lewei50.com/lewei50/img/ht-20181205-2.jpg)
**Packet Description**
{"status":"succeed","data":[13.1875],"mac":"b4e62d313338"}
mac:The mac address of the WiFi module which can be used as SN.
data:The first one is the temperature value, and the second one is the humidity value. If only the temperature is measured, just one data is transmitted (Please refer to the above example).
#Other features of WTH-3080
In order to increase the flexibility of the device, we provide the WTH-3080 with interface functions besides the platform https://www.lwkits.com, including the following two functions.
- Custom socket for third-party platform
- Serve as http server to provide http get interface
## Custom socket for third-party platform
WTH-3080 can serve as a tcp client customized to refer to the tcp server, as shown in the following picture.
![WTH-3080 socket](https://doc-resources.lewei50.com/lewei50/img/ht-20181205-3.jpg)
1. We use netcat to set up a tcp server on the server of test.iammeter.com to listen to port 12345.
2. Set the socket on the WTH-3080 configuration page to refer to this port.
3. The tcp server receives the mac address of the WiFi module at the first link, and then uploads the packet once a minute.
4. Each time the tcp server sends a read command (nc sends it with ctrl+D), it will receive the packet.
**Packet Description**
{"method":"uploadsn","mac":"B0F8933BBCBF","version":1.29,"server":"HT","SN":"C2FA94D9","Data":[19.4]}
~~mac: Mac address of the WiFi module
version: Firmware version
sn: SN of the device
data:The first one is the temperature value, and the second one is the humidity value. If only the temperature is measured, just one data is transmitted (Please refer to the above example).~~
## Serve as http server to provide http get interface
This function is mainly used in the local area network, providing relevant monitoring software. The calling method is http get ip/monitorjson as shown in the picture below.
![WTH-3080 socket](https://doc-resources.lewei50.com/lewei50/img/ht-20181205-4.jpg)
**Packet Description**
{"method":"uploadsn","mac":"B0F8933BBCBF","version":1.29,"server":"HT","SN":"C2FA94D9","Data":[19.4]}
mac: Mac address of the WiFi module
version: Firmware version
sn: SN of the device
data:The first one is the temperature value, and the second one is the humidity value. If only the temperature is measured, just one data is transmitted (Please refer to the above example).