-
Notifications
You must be signed in to change notification settings - Fork 1
Transfer Data Between Serial And Tcp
This function is used Uart1, and the uart1 baudrate is 115200, and tcp port is 5005 by default,but you can change them through http command, in Access Point mode, ip address: 192.168.230.1
- Open Tunnel
http://192.168.230.1:9999/server.command?command=open_tunnel
- Close Tunnel
http://192.168.230.1:9999/server.command?command=close_tunnel
- Tunnel Port
get port
http://192.168.230.1:9999/server.command?command=tunnel&get_port
set port
such as change port to 6006
http://192.168.230.1:9999/server.command?command=tunnel&set_port&value=6006
- Tunnel Baudrate
get baudrate
http://192.168.230.1:9999/server.command?command=tunnel&get_baudrate
set baudrate
such as change baudrate to 9600
http://192.168.230.1:9999/server.command?command=tunnel&set_baudrate&value=9600
Here Used Uart1
Baudrate: 9600 19200 38400 57600 115200 230400
Uart Protocol Table
Note: A packet of data should be less than 1024 Bytes
Name | Bits | Value | Discription |
---|---|---|---|
Id | 2 Bytes | 0xAA 0xAA | \ |
Command Type | 1 Byte | 0x00 | 0x00: Set Command 0x01: Get Command |
Command | 2 Bytes | 0x00 0x00 | 0x00 0x00: Open Tunnel 0x00 0x01: Close Tunnel 0x00 0x02: Send Data |
Status | 1 Byte | 0x00 | Open/Close Tunnel Through Uart, it will return: 0x00: OK 0x01: Fail |
Parity | 2 Bytes | 0x00 0x00 | 0x00 0x00: none |
Length | 2 Bytes | 0x00 0x00 | Don't Send Data,value=0x00 0x00 Send Data,Value Depends On Data |
Data | 2 Bytes | \ | Depends On Length |
Uart Protocol Command
- Open Tunnel
0xAA 0xAA 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
- Close Tunnel
0xAA 0xAA 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00
- Send Data
0xAA 0xAA 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x05 0x14 0xE0 0xFA 0x96 0xCB
- Test for tcp - to download NetAssist
- Test for uart - to download UartAssist
- Power on the WisCore module, and then connect the wireless "WisCore_macaddr".
- Open UartAssist, and connect it, the same to setup console through serial
- Before open tunnel, set/get port/baudrate
By default, the baudrate is 115200, port is 5005, and you can get the params through http command
if you want to get the params,input the url,and it will returns a value, value="port/baudrate"
Get Baudrate
Get Port
if you want to change the params,input the url,and it will returns a value, if value=0,set port/baudrate success
Set Baudrate
Set Port
Through Http Command
input the url,and it will return a value, if value=0,open tunnel success
Through Uart Command
input uart command, if open success, it will return the correct command
IF OK, GO ON PLEASE!
If open tunnel success, please connect NetAssist:
- Protocol: Tcp Client
- Local host addr: your computer's IP
- Remote host adr: module's IP
Then, you can send data in NetAssist: just send data in UartAssist: packet header + data
Note: A packet of data should be less than 1024 Bytes
Through Http Command
input the url,and it will return a value, if value=0,close tunnel success.
Through Uart Command
input uart command, if close success, it will return the correct command