|
1 | 1 | # SerialToTCPBridgeProtocol |
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. |
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. |
7 | | -The goal of the project is to have the means to connect the simplest and cheapest devices to the internet, albeit indirectly. |
| 4 | +PC side service written in Go that listens on COM ports for serial clients. |
| 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. |
| 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 | 9 |
|
9 | 10 |
|
10 | | -See [STM32SerialToTCPBridgeClient](https://github.com/RoanBrand/STM32SerialToTCPBridgeClient) for an example of a client, written in c, that connects to a MQTT broker from a STM32 Nucleo F334R8 development board. |
| 11 | +See [STM32SerialToTCPBridgeClient](https://github.com/RoanBrand/STM32SerialToTCPBridgeClient) for an example of a client, written in c, that connects to a MQTT broker from a STM32 Nucleo F334R8 development board (ARM Cortex-M4). |
11 | 12 |
|
12 | 13 |
|
13 | 14 | #### Details |
14 | 15 | - The Go service opens a real TCP connection to a set destination on behalf of the serial client. |
| 16 | +- The client specifies the destination IPv4 address and port. |
15 | 17 | - 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. |
16 | 18 | - The service forwards traffic bi-directionally, as long as tcp connection is open and serial line is good. |
17 | 19 |
|
18 | 20 | #### Future plans |
19 | | -- Add config. Turn into os service. |
20 | | -- Sort out timeout bugs |
21 | | -- Add ping to periodically test serial line |
22 | | -- Multiple connections for clients to servers |
23 | | -- Unit tests |
| 21 | +- Add config. Turn into OS service. |
| 22 | +- Add ping option to periodically test serial line and drop upstream connection if timeout. |
| 23 | +- Separate connection and com interface concepts in code in preparation of 'multiple connections per client to servers' capability. |
| 24 | +- Unit tests. |
24 | 25 | - PC side service to listen to all COM ports and concurrently spawn new connections for clients |
25 | | -- Create a Arduino lib/client that extends the [Arduino Client class](https://www.arduino.cc/en/Reference/ClientConstructor) so that libraries for existing Ethernet/Wifi shields can theoretically work. |
| 26 | +- 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