You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -311,13 +311,43 @@ Always try the verbose option if something is not working properly.
311
311
312
312
## Advanced Usage
313
313
### TCP socket server
314
+
Instead of the serial port emulation there is a also builtin raw tcp server since version 2.7:
314
315
```
315
316
network options:
316
317
--expose-tcp-host TCP_HOST
317
318
Network interface for the server listen on (default: 127.0.0.1)
318
319
--expose-tcp-port TCP_PORT
319
320
Port to listen on, disables local serial port and enables TCP server if specified (default: None)
320
321
```
322
+
This is only activated if TCP_PORT is set. Also it removes the dependency to com0com or other drivers.
323
+
324
+
The server is listening on localhost per default, therefore only reachable from apps running on the same machine. Other interfaces or `0.0.0.0` for all interfaces can be specified with TCP_HOST.
325
+
Security is to consider though, this is plain TCP without encryption or authentication. Only recommended on a separate local network, otherwise stay with the default/localhost.
326
+
327
+
Note: this is limited to one concurrent connection, it will reject all connection attempts if there is already a client connected and emit a warning, example:
19:30:26.726 | INFO | tcp_socket.py: New TCP peer connected: ('127.0.0.1', 56172)
340
+
19:30:26.726 | WARNING | tcp_socket.py: More than one connection is not allowed, closing
341
+
```
342
+
343
+
Now there a various ways to connect to it.
344
+
#### Linux and macOS
345
+
- Very simple option: `netcat 127.0.0.1 4002` or `telnet 127.0.0.1 4002`
346
+
- More powerful: `socat -dd tcp:localhost:4002 -`, can forward data to many modules, not only stdin/stdout.
347
+
- Custom apps are easy to make with tcp too
348
+
#### Windows
349
+
- Graphical: Putty, just put in the IP+port and select Other - Raw as connection type.
350
+
- Terminal: netcat/telnet/socat can be installed separately
321
351
322
352
### Multi device connection
323
353
It is possible to connect several devices to a host simultaneously. Limiting factor is only the bluetooth baseband layer, which uses a Active Member Address (AMA, 3 bit). From these 8 possible values address zero is always occupied by the host, so it can be connected to (up to) 7 devices at the same time.
0 commit comments