Freesco has integral support for dial-in modems but this can be perverted to allow you to “dial-in” with a null modem, thus allowing simple, cheap TCP/IP networking for up to two computers or adding up to two computers temporarily to an established Ethernet network.
Using null-modem cables it is possible, by clever use of Windows Dial-up Networking and some changes to the default Freesco configuration, to allow you to take advantage of such a system.
Advantages of such a system are:
Some uses for this would be:
The Freesco machine already should have one spare serial port. Connect the null-modem cable between this and your client machine. Firstly, we should run through how to configure the Freesco machine.
The entire process works by making Freesco “pretend” it is a modem which is achieved by answering the Windows modem drivers AT commands until such time as the PPP process starts, after which Windows and Freesco communicate directly and allow TCP/IP access across the cable.
For this, we need to have a script which simulates the replies to such commands that a real modem would send back.
We will call this script nullscript :
connect '/sbin/chat -v ATH OK AT OK ATE0V1 OK AT OK ATDT CONNECT' -detach persist modem crtscts :192.168.10.97
(A downloadable version is available here: nullscript )
The various AT and OK commands in the script are the send / expect pairs that will negotiate us through the Windows modem initialisation far enough to satisfy Windows that what it is connecting to is a modem.
The IP address at the bottom is the IP that the remote client will be given once it is connected (this should not conflict with any IP addresses on your network). /bin/spawnnull is the script below.
Now we need to run the PPP server on the Freesco machine that will use the above script to connect and then take over and use PPP over the connection. We will call this script spawnnull:
#!/bin/sh
fork pppd /dev/cua1 115200 file /bin/nullscript
(A downloadable version is available here: spawnnull )
Note that the /bin/nullscript should be the location of the above script, /dev/cua1 should be the serial port of the Freesco machine that the null-modem is on (in this case cua1, a.k.a. COM2) and 115200 is the speed that that serial port will operate at. Now execute this program.
Now we need to set up the client machine. Basically, this involves adding a driver for a “Standard 28,800 bps Modem” on the port that the null-modem is connected to on the client machine, then creating a new Dial-Up Networking connection which uses this modem. This new connection can dial any phone number (it will be ignored) and can use any username and password (they will be ignored too, unless you wish to have authentication. See below).
If the machines are connected, the above scripts working, and the client machine configured, double-clicking the DUN connection for the null-modem should have you up and running! The standard Windows “flashing green boxes” item will appear in your taskbar, showing a 115200 connection (and, incidentally, providing you with a handy transmit / receive status indication).
You'll now be able to access the network as if it were local. Network machines should be able to access you as if you were connected to the network in the usual way and all TCP/IP programs should work.
If your network is connected to the Internet (e.g. using the same Freesco machine to dial-out or route an Ethernet connection), you should also be able to run any standard Internet program and connect to the Internet as normal.
If you are using just Ethernet (i.e. not the usual dial-out modem which would take up the second serial port of the Freesco machine), you can create copies of both of the above scripts with different names, different serial ports and different IP addresses to connect two computers to the Freesco machine over null-modem cables, both of which will be able to access each other and the network (for a quick blast of Quake, maybe?).
Authentication of the connecting user can be added by putting the line:
login
inside the nullscript. This will authenticate users against the standard system password database
Now that we've successfully tested the system, if you need to make it permanent a few changes may need to be made. Firstly, the scripts should be put where they can survive a reboot (e.g. /mnt/router/fix, /mnt/router/packages /pkg, etc.). Secondly, the spawnnull script will need to be run on startup, by placing it's command into /rc/rc_user.
This HOWTO isn't yet finished. There are still several problems to iron out, apart from the above. Firstly, it needs to be properly integrated so that it doesn't get affected by the firewall. Sometimes, if you have made the null-modem connection before your usual modem dial-out connection, it will steal ppp0 and so will be subject to a Freesco firewall between the Freesco machine and the client (and when the modem does dial-out, it will not be subject to the firewall. A dangerous situation!).
Sometimes, it may be necessary to add a:
netmask 255.255.255.0
line (or similar) to the nullscript, to prevent the null-modem receiving every packet sent across the network.
Also, some Windows modem drivers don't use the same initialization sequence and these will need to be manually inserted into the nullscript (the minicom program supplied with Freesco is a great tool for finding out the Windows' AT command- sequence for a particular modem, along with the modem's .INF files). Future developments might include an .INF file for a dummy modem which does not require specialist scripts to dial-in to the Freesco machine.
If you can solve any of these problems, or add comments to make this sequence easier to follow, please contact ledow