-->
Page 1 of 10

"Basic" transparent serial/tcp bridge

PostPosted: Sat May 23, 2015 5:25 am
by eriksl
https://github.com/eriksl/esp8266-basic-bridge

This transparent bridge is based on the transparent bridge by beckdac (also active here), but a complete rewrite from scratch, with all redundant code removed. That's what you get from copy&paste ;-). There is only one source code file left, which is only ~200 lines long and a simple WORKING makefile (i.e. dependencies work, as opposed to the frankenstein makefile that is used for many projects).

For an end-user there won't be much difference (albeit the beckdac version can be configured over wlan), but for guys who want to have a solid example to base their own project on, I'd definitely recommend this one.

Re: "Basic" transpart serial/tcp bridge

PostPosted: Sat May 23, 2015 5:27 am
by eriksl
BTW I just added an optional "line buffered" mode where all data from the uart is "corked" until a line feed is seen. That way tcp segments will only have compete lines instead of parts of lines that need to be reassembled on the receiving side.

Re: "Basic" transpart serial/tcp bridge

PostPosted: Sat May 23, 2015 5:33 am
by eriksl
This version will allow just one connection at a time. I feel that is more appropriate. If you have multiple clients connecting, they may interfere if they can connect at the same time. If a connection is setup to the esp while there is already a connection active, it will just ignore the request (nothing sent back, no TCP RST ("connection refused")). This is actually good because a tcp connect will try for some time, so the second connect will get connected as soon as the actual connection is finished.

For the best/most robust interaction I'd recommend this interface: https://github.com/eriksl/libespif (includes a standalone executable), but it works just as well with telnet, netcat, etc.

With above lib/exec I've managed to make around five connections per second (+ exchange data) from two "competing" clients, without problems and without mixup of the data.

Re: "Basic" transpart serial/tcp bridge

PostPosted: Tue Jun 09, 2015 8:05 am
by janpsegers
It looks as if this is just what I need. One big problem : I have no idea how to use it. My experience on programming are good but not with Linux. So I should like to have an example for arduino .