Skip to content

Commit 9e8734b

Browse files
authored
Merge pull request tasmota#556 from ayavilevich/development
document "Serial to TCP Bridge"
2 parents ef76b8c + 75f8481 commit 9e8734b

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

docs/Serial-to-TCP-Bridge.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Serial to TCP Bridge
2+
3+
!!! info "Connect to a serial device over the network"
4+
5+
Needs `#define USE_TCP_BRIDGE`. This is available in the `zbbridge` build so you can use that or [compile your own build](Compile-your-build).
6+
7+
This feature can be used to add a "serial to network" functionality to a device that is otherwise serial only. You connect the device to a ESP8266/ESP32 and Tasmota will bridge between serial and network.
8+
9+
This is commonly used with a CCxxxx Zigbee based module to connect it to a remote ZHA or zigbee2mqtt instance.
10+
11+
## Commands
12+
13+
* `TCPBaudRate <x>`: sets the baudrate for serial (only 8N1 mode), min `1200`, max `115200` by 1200 increments.
14+
* `TCPStart <port>`: listens to port `<port>`. This features supports 2 parallel TCP connections, which can be useful if you need a terminal + a specific protocol (like XMODEM). The 3rd connection will disconnect an previous connection. The number of parallel connections is a compile-time option.
15+
* `TCPStart 0` or `TCPStart`: shuts down the TCP server and disconnects any existing connection.
16+
17+
For security reasons, the TCP bridge is not started at boot, and requires an explicit TCPStart command (can be automated with Rules).
18+
19+
## Configuration
20+
21+
First assign two GPIOs to `TCP Tx (208)` and `TCP Rx (209)` types in the "Configure Module" page. The Rx/Tx are relative to the ESP device. For example with ESP01's hardware serial, set GPIO1 as TCP Tx and GPIO3 as TCP Rx.
22+
23+
Then set baud rate with `TCPBaudRate` and port with `TCPStart`.
24+
25+
You can add a rule to start the TCP server at boot.
26+
To do this for port 8888, run `Rule1 ON System#Boot do TCPStart 8888 endon` then enable with `Rule1 1` and restart the device.
27+
28+
## Additional resources
29+
30+
[PR](https://github.com/arendst/Tasmota/pull/8702)
31+
[Sonoff ZBBridge reference](https://zigbee.blakadder.com/Sonoff_ZBBridge.html)

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ nav:
9292
- RF 433MHz Protocol: RF-Protocol.md
9393
- Rules.md
9494
- Scripting: Scripting-Language.md
95+
- Serial-to-TCP-Bridge.md
9596
- Blinds-and-Shutters.md
9697
- Smart-Meter-Interface.md
9798
- Subscribe-&-Unsubscribe.md

0 commit comments

Comments
 (0)