|
1 | 1 | # Serial to TCP Bridge Protocol |
2 | 2 | An error tolerant serial UART to TCP connection, raw data bridge. |
3 | 3 |
|
4 | | -PC side service written in Go that listens on COM ports for serial clients. |
| 4 | +Host side gateway service written in Go that listens on COM ports for serial clients. |
5 | 5 | This is meant to bridge the gap between tcp connections and serial devices using UART/RS-232/Virtual COM over USB, etc. |
6 | | -Clients implementing the protocol have a tcp like api that they can use to make connections to real servers. |
| 6 | +Clients implementing the protocol client have a tcp like api that they can use to make connections to real servers. |
7 | 7 | The goal of the project is to have the means to connect the simplest and cheapest devices to the internet, albeit indirectly. |
8 | | -For now, I use this to connect microcontrollers on development boards to servers running on localhost through the Virtual COM port over USB, without requiring any Ethernet/Wi-Fi hardware. |
| 8 | +For now, I use this to connect microcontrollers on development boards to servers running on localhost through the Virtual COM port over USB, without requiring any Ethernet/Wi-Fi hardware. |
9 | 9 |
|
10 | | -An implementation of the Protocol Gateway and Client, written in Go, is included here. |
11 | | -See [STM32SerialToTCPBridgeClient](https://github.com/RoanBrand/STM32SerialToTCPBridgeClient) for an example of another Client, written in c, that connects to a MQTT broker from a STM32 Nucleo F334R8 development board (ARM Cortex-M4). |
| 10 | +Included in this repo is an implementation of the Protocol **Gateway** and **Client**, written in Go. They work on Windows, Linux and even Raspbian. |
| 11 | +The following clients are also available: |
| 12 | + |
| 13 | +| Client | Platform | Language | |
| 14 | +| ---------------------------------------------------------------------------------------------- |:--------:| --------:| |
| 15 | +| [ArduinoSerialToTCPBridgeClient](https://github.com/RoanBrand/ArduinoSerialToTCPBridgeClient) | Arduino | C++ | |
| 16 | +| [STM32SerialToTCPBridgeClient](https://github.com/RoanBrand/STM32SerialToTCPBridgeClient) | STM32 | C | |
12 | 17 |
|
13 | 18 | #### Use |
14 | | -- Open a terminal, then run `go get -u github.com/RoanBrand/SerialToTCPBridgeProtocol` |
15 | | -- Run the binary in `$GOPATH/bin` |
| 19 | +- Open a terminal, then run `go get -u github.com/RoanBrand/SerialToTCPBridgeProtocol`. |
| 20 | +- Run the binary in `$GOPATH/bin`. |
16 | 21 |
|
17 | 22 | #### Details |
18 | 23 | - The protocol provides the app an in order, duplicates free and error checked byte stream by adding a CRC32 and simple retry mechanism. See [this](https://en.wikibooks.org/wiki/Serial_Programming/Error_Correction_Methods) for background. |
19 | 24 | - The **Protocol Gateway** opens a real TCP connection to a set destination on behalf of the Protocol Client. |
20 | | -- The **Protocol Client** connects to the Protocol Gateway over serial-like connection. |
21 | | -- The Client specifies the destination IPv4 address and port. |
22 | | -- The Gateway forwards traffic bi-directionally, as long as tcp connection is open and serial line is good. |
23 | | - |
| 25 | +- The **Protocol Client** connects to the Protocol Gateway over a serial-like connection, which can possibly corrupt data. |
| 26 | +- The client specifies the destination IPv4 address and port. |
| 27 | +- The gateway forwards traffic bi-directionally, as long as tcp connection is open and serial line is good. |
24 | 28 |
|
25 | 29 | #### Tests |
26 | | - - Open a terminal, then run `go get -u github.com/RoanBrand/goBuffers` |
27 | | - - In the terminal, change directory to the `protocol` folder inside the repository |
28 | | - - Run `go test -v` in the terminal |
| 30 | + - Open a terminal, then run `go get -u github.com/RoanBrand/goBuffers`. |
| 31 | + - In the terminal, change directory to the `protocol` folder inside the repository. |
| 32 | + - Run `go test -v` in the terminal. |
29 | 33 |
|
30 | 34 | #### Future plans |
31 | 35 | - Add config. Turn into OS service. |
32 | 36 | - Add ping option to periodically test serial line and drop upstream connection if timeout. |
33 | 37 | - Multiple connections per client to servers. |
34 | 38 | - Capability to scan system and listen on all found COM ports for clients. |
35 | | -- Create a Arduino lib/client that extends the [Arduino Client class](https://www.arduino.cc/en/Reference/ClientConstructor) so that libraries for existing Ethernet/Wi-Fi shields can theoretically work. |
|
0 commit comments