TCP/IP over Serial Line using pppd (Linux)

Using TCP/IP allows data to be sent as packets, instead of a byte stream as per serial. The advantage is that this prevents mis-interpreting messages sent, when bytes are dropped, or the definition of the message is different.

Suppose we have:

Computer1 -> USB-Serial Converter -> Serial Cable -> Serial->USB Converter ->  Computer 2

On computer 1 we type :

pppd /dev/ttyUSB0 115200 lock nodetach noauth debug 195.0.0.12:195.0.0.13

On computer 2 we type:

pppd /dev/ttyUSB0 115200 lock nodetach noauth debug

And watch it connect!

You should see a new device (usually ppp0) when you type:

ifconfig

See full pppd documentation here: http://linux.die.net/man/8/pppd

Increasing Connection Re-tries

Should you need the pppd to keep trying to connect, you can add the following flag at the back of your command – lcp-max-configure

So,

pppd /dev/ttyUSB0 115200 lock nodetach noauth debug lcp-max-configure 1000000 195.0.0.12:195.0.0.13

where 1000000 is number of times pppd tries to connect to the other party.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s