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
+12-11Lines changed: 12 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -5,19 +5,20 @@ Open a TCP connection to a server from the Arduino using just serial. No Etherne
5
5
Quickly communicate with other servers and make network apps using minimal hardware.
6
6
See [this](https://github.com/RoanBrand/SerialToTCPBridgeProtocol) for more information on the protocol and for the **Protocol Gateway** you will need to run on the host PC the Arduino is connected to serially.
-[PubSubClient](https://github.com/knolleary/pubsubclient) v2.8.0 - Needed for the included **MQTT Client Example**
15
16
16
-
After installing the dependencies and this library, make sure you have all 3 present inside your **libraries** sub-directory of your sketchbook directory.
17
+
These should install automatically when installing this library through the Arduino *Library Manager*.
17
18
18
19
## How to
19
20
- Get the [Protocol Gateway](https://github.com/RoanBrand/SerialToTCPBridgeProtocol) and build it.
20
-
- Change the gateway's config to listen on the COM port connected to your Arduino and start it.
21
+
- Change the gateway's config to listen on the Serial port connected to your Arduino and start it.
21
22
- Your Arduino app can then use the `ArduinoSerialToTCPBridgeClient` API which is similar to the `EthernetClient` API to make tcp connections to servers as long as they are reachable from the host PC and the gateway service is running.
22
23
23
24
## Web Client Example
@@ -28,12 +29,12 @@ After installing the dependencies and this library, make sure you have all 3 pre
28
29
- On other boards with more hardware serial ports than the Uno the example can be modified to use those instead (Serial1,2,etc.) and remove the software serial lib.
29
30
30
31
## MQTT Client Example
31
-
1.Install [PubSubClient](https://github.com/knolleary/pubsubclient) - Manually, or from the Arduino *Library Manager*.
32
-
2.Get a MQTT Broker running on your host PC, listening on `localhost`. I used [HiveMQ](www.hivemq.com).
33
-
3.Open and upload the example from the Arduino *Examples menu*.
34
-
4.Run the **Protocol Gateway** on the same PC, with the right COM port configuration.
35
-
5.When the Arduino is connected to the MQTT broker, it will publish a message and subscribe to the `led` topic.
36
-
6.You can use another MQTT client like [MQTT.fx](http://mqttfx.jfx4ee.org) to publish characters `0` and `1` to the topic `led` to toggle the led on and off on the Arduino board.
32
+
1.Open and upload the example from the Arduino *Examples menu*.
33
+
2.Run the **Protocol Gateway**on the same PC, with the correct Serial port configuration.
34
+
3.After a short time, the Arduino should connect to the MQTT broker `mqtt.eclipseprojects.io`.
35
+
4.Using a MQTT client, like [MQTTX](https://mqttx.app/), connect to the same broker and subscribe to the `ArduinoOut` topic.
36
+
5.While the Arduino is connected to the MQTT broker, it will publish a message to the `ArduinoOut` topic every 5s.
37
+
6.Using the client, publish characters `1` and `2` to topic `LedIn` to toggle the led on and off on the Arduino board.
37
38
38
39
### Details
39
40
- Tested only on Arduino Uno. It would probably not work for the Arduino Due.
sentence=Open a TCP connection to a server from the Arduino using just serial. (No Ethernet/WiFi shields necessary)
6
-
paragraph=Quickly communicate with other servers and make network apps using minimal hardware. INSTALL DEPENDENCIES! The Protocol Gateway service runs on the host, listens on a COM port connected to the Arduino, and opens TCP connections on behalf of the Protocol Client runnning on the Arduino, forwarding traffic bi-directionally. The protocol provides the app an in order, duplicates free and error checked byte stream by adding a CRC32 and simple retry mechanism.
5
+
sentence=Open a TCP connection to a server from the Arduino using just Serial. (No Ethernet/WiFi shields necessary)
6
+
paragraph=Quickly communicate with other servers and make network apps using minimal hardware. The Protocol Gateway service runs on the host, listens on a Serial port connected to the Arduino, and opens TCP connections on behalf of the Protocol Client runnning on the Arduino, forwarding traffic bi-directionally. The protocol provides the app an in order, duplicates free and error checked byte stream by adding a CRC32 and simple retry mechanism.
0 commit comments