Alphamonkey
this is alphamonkey dot org.
main.
where's mike.
photo gallery.
media library.
arkiv archive.
google calendar.
mobile photos.



My status-->
search for stuff.

Search:


older stuff.
July 10
Wedding Bands: Ordered
July 5
Happy Fourth!
June 30
Weird
Oh man
June 29
Best FD QSO so far...
June 20
Pre Cana Tomorrow
June 14
Etching my own PCB
June 13
I've always liked Adam Sessler
June 3
Soldering On
June 1
Berries and Cream

useful stuff.
gnutls on OS X - This is a step by step guide outlining the procedure for getting gnutls up and running under Mac OS X.
serial port internet - If you've got an old computer with no expansion slots or ethernet port, this is one way to give it a connection to the 'net.
The Coolest Thing I Have Ever Done
[prev] Sat, 17 Nov 2001 20:27:00 -0500 [next] [computing] - [comment]

Today I accomplished something both very interesting and at the same time, sort of unnecessary. However, it made for a very interesting project. Today, I added Jason's old Compaq 486 to the Radio House network. However, Jason's computer has no Ethernet card. How, you ask, is that possible? Read on, and i'll explain.
So Jason's computer is unexpandable, it's one of those one-size-fits all jobbies that Compaq put out in the mid 1990's. However, I noticed one day that it had an auxiliary serial port, and I thought, we might be able to hook Jason up.. Here's how I did it (and how you can do it too.)

Client Side

Jason's computer was running Windows 95, which was a little bit of a relief. I've heard that 95 is a little more Linux friendly than it's siblings. First, I set up a "Standard 192000 Modem" device on Jason's PC -- attached to COM1 -- his serial port. Bear in mind there's no modem, I'm just telling Windows that there is. I set it's maximum transmission rate to 38400 bits/sec. Earlier in the week I had bought a serial data transmission cable (9 and 25 pin) aka a LapLink cable. I plugged that in to the back of Jason's machine and into the /dev/cua0 port on my Linux box. I set up a Dial Up networking connection, with "1" as the number to dial, to connect at 38400 with 8,N,1. I turned on FIFO compression and cranked it all the way up, both buffers as high as they can go. I also turned on Software Flow Control (XON/XOFF). Set the server type to PPP and didn't specify the machine's IP or anything. Turned log on to network off, as well as requiring an encrypted password. Set it up to open a terminal window before dialing. Okay, client side is done.

Server Side

The Linux box was a little more complex to set up. First, I added this line to my /etc/inittab:

s1:12345:respawn:/sbin/agetty 38400 ttyS1 vt100

This starts an agetty process waiting for anything to happen. I did an init q to reread inittab. Then I created a user jason, with home directory /home/jason, shell /usr/sbin/pppd, and the file .ppprc in it. Here's how to set up your .ppprc:

connect '/usr/sbin/chat -v AT OK ATE0V1 OK AT OK ATDT CONNECT'
-detach
192.168.0.1:192.168.0.10
local
xonxoff
proxyarp
debug

Okay, so here's how it all shakes out. Clicking connect on Jason's machine opens a terminal window, and tapping enter once or twice presents a login prompt. Loggin in as jason causes agetty to spawn a pppd process with jason's .ppprc as the settings (pppd must be suid root for this to work). Basically, the connect function uses 'talk' to mimic the responses of a modem. It took me a little while to figure out what the windows default 19.2 modem wanted to hear from my linux box, but after a few attempts, this was the sequence that works. Windows sends an AT to the modem. Modem responds OK. Windows sends ATEOV1 to the modem, modem responds OK. Windows sends another AT, then an ATDT or ATDT# to connect. Doesn't matter. Chat replies with connect, and everything goes from there. The options set up in the .ppprc are pretty standard, you can see what they do using man pppd.


So 192.168.0.1 is eth1 on my linux box, the card that takes requests from the "normal" 10Base-T network and shoots them out through eth0 which is hooked up to RoadRunner, my ISP. I run a DHCP and Proxy server on eth1, so this is how Jason's computer accesses the internet. I simply put 192.168.0.1 as a proxy for his web browser and instant messenger, and he's on the net! Now granted, he can't do some pretty standard things like FTP, but once I find a way to send a little more configuration data when he connects, he might have an honest to goodness connection. But hey, the way I look at it, an $8 33.6 connection that's rock solid is better than no connection at all. Now I just have to figure out how to get compression to work and squeeze every bit of bandwith we can out of this serial cable.

Here's a sample of a connect/disconnect from /var/log/messages:

Nov 17 22:24:26 loogham pppd[459]: pppd 2.4.1 started by jason, uid 1002

Nov 17 22:24:26 loogham chat[478]: expect (AT)
Nov 17 22:24:27 loogham chat[478]: AT
Nov 17 22:24:27 loogham chat[478]: -- got it
Nov 17 22:24:27 loogham chat[478]: send (OK^M)
Nov 17 22:24:27 loogham chat[478]: expect (ATE0V1)
Nov 17 22:24:27 loogham chat[478]: ^MATE0V1
Nov 17 22:24:27 loogham chat[478]: -- got it
Nov 17 22:24:27 loogham chat[478]: send (OK^M)
Nov 17 22:24:28 loogham chat[478]: expect (AT)
Nov 17 22:24:28 loogham chat[478]: ^MAT
Nov 17 22:24:28 loogham chat[478]: -- got it
Nov 17 22:24:28 loogham chat[478]: send (OK^M)
Nov 17 22:24:28 loogham chat[478]: expect (ATDT)
Nov 17 22:24:28 loogham chat[478]: ^MATDT
Nov 17 22:24:28 loogham chat[478]: -- got it
Nov 17 22:24:28 loogham chat[478]: send (CONNECT^M)
Nov 17 22:24:28 loogham pppd[459]: Serial connection established.
Nov 17 22:24:28 loogham pppd[459]: Using interface ppp0
Nov 17 22:24:28 loogham pppd[459]: Connect: ppp0 <--> /dev/ttyS1
Nov 17 22:24:32 loogham pppd[459]: found interface eth1 for proxy arp
Nov 17 22:24:32 loogham pppd[459]: local IP address 192.168.0.1
Nov 17 22:24:32 loogham pppd[459]: remote IP address 192.168.0.10
Nov 17 22:24:35 loogham pppd[459]: CCP terminated by peer
Nov 17 22:24:35 loogham pppd[459]: Compression disabled by peer
Nov 17 22:51:53 loogham pppd[459]: LCP terminated by peer
Nov 17 22:51:56 loogham pppd[459]: Connection terminated.
Nov 17 22:51:56 loogham pppd[459]: Connect time 27.5 minutes.
Nov 17 22:51:56 loogham pppd[459]: Sent 528286 bytes, received 60934 bytes.
Nov 17 22:51:56 loogham pppd[459]: Exit.

As you can see, for some reason the Win95 box disables compression. Why? Haven't gotten that far yet.

Happy hacking!


<Anthem> i hate it when you're making out with girls and they slip their finger around back to have a little fun with the corn hole
<mstyne|wk> and that is why we need police ops
<mstyne|wk> to dispense frontier justice
<Paco-Paco> what the crap
<mstyne|wk> Paco-Paco: hand me the stick
<mstyne|wk> the whomping stick
--- ChanServ gives channel operator status to mstyne|wk
--- mstyne|wk sets ban on *!*Panda@*.mclnva23.dynamic.covad.net
<-- mstyne|wk has kicked Anthem from #gaim (mstyne|wk)
* mstyne|wk hands the stick back to Paco-Paco
--- ChanServ removes channel operator status from mstyne|wk
<khc> haha
<robert42> sweet

(CC) 1996 - 2008 alphamonkey dot org // done in 0.053 - powered by monkey allen v0.2