13. PPP from the netBook

Read the Linux PPP howto: http://www.linux.org/docs/ldp/howto/PPP-HOWTO/index.html. When setting up PPP on the netBook, be sure that the ppp kernel modules are loaded and that any desktop firewalls are set up (or disabled) to allow the ppp connection. The ppp kernel modules are: ppp_generic, ppp_async, ppp_deflate, zlib_inflate, zlib_deflate.

The netBook's possible devices are /dev/ttySA0 (ordinary on-board serial), /dev/ttySA1 (on-board infrared serial), and /dev/ttyS0 (likely any serial port from PCMCIA, either modem, dedicated serial card, or GPS). Any one of which can be connected to a modem (except infrared for now, since that doesn't work yet).

13.1. Connecting to the desktop with PPP

Before beginning, note that most modern desktops have a networking firewall set up. Such a firewall needs to be either configured to allow the desktop to netBook connection, or disabled altogether (temporarily when it is necessary to connect the desktop to the netBook - a firewall is generally a good thing.) The symptoms of a firewall issue are being able to ping between netbook and desktop - an apparent healthy network connection -, but not able do make any kind of connection by tools such as ssh, rsh, or ftp.

To set up PPP, first configure something like this for the /etc/ppp/options file on the netBook:

      -detach
      defaultroute
      noauth
      nocrtscts
      lock
      lcp-echo-interval 5
      lcp-echo-failure 3
      /dev/ttySA0
      115200
(or use /dev/ircomm0 for IRDA)

Then add the ppp user to your Psion's /etc/passwd file: echo "ppp:*:101:101:PPP User:/etc/ppp:/usr/sbin/pppd" >> /etc/passwd

And make sure pppd is executable for user ppp and executes as root: "chmod a+x /usr/sbin/pppd" and then suid root: "chmod +s /usr/sbin/pppd".

You will need to run a getty, e.g., on /dev/ttySA0, to enable logins to the Psion by ppp. The getty gives you the login prompt when you connect over the serial port. The command "getty 115200 /dev/ttySA0" - or /dev/ircomm0 - will start a getty on the serial port. It may be preferrable to start the getty on the serial port in the /etc/inittab file. After editting /etc/inittab, "init q" will restart init and get any getty going. You can test that the getty is working o.k. using minicom from the desktop.

On your desktop computer have something like this for a /etc/ppp/peers/psion file:

      -detach
      noauth
      nocrtscts
      lock
      local
      connect '/usr/sbin/chat -v -t3 ogin--ogin: ppp'
      /dev/ttyS0
      115200
      192.168.1.100:192.168.1.101
Then just type "pppd call psion" on your computer to connect to the Psion. [You may prefer to start up the ppp connection from the psion, rather than from the desktop computer - but that might not be a security risk you want to take.] You should then be able to ping the desktop from the netBook, and vice-versa, and then use your favorite internet tools over this network.

Edit the /etc/hosts files on the desktop and netBook to include lines such as

192.168.1.101     openpsion
192.168.1.100     desktop
so the IP addresses don't have to be remembered.

To access the internet from your Psion through the desktop computer, you need to add routing, masquerading, and NAT [I don't know what these are either...but it works, so who am I to complain?] to your desktop:

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE
then you can browse the internet from your psion using dillo or lynx. Be aware that your desktop kernel must be compiled to support these things; default RedHat or SuSE kernels support this. Any firewalls must be disabled or otherwise set up to allow this forwarding. You will have to make an entry to /etc/resolv.conf to enter a proper domainname nameserver (you can use "nameserver 63.240.76.4" if you like, but you should really use an IP address provided by your internet provider).

13.2. Telnet/rsh/ssh

PPP can used with telnet, rsh, ssh, etc. rsh may be preferable to telnet, because then you can efficiently copy things between the psion and desktop using rcp. Install the rsh client and servers if you want rsh. rsh is preferable to ssh for psion-computer connections because it does not have the overhead of ssh encryption. You will likely have to edit /etc/hosts.allow to let in telnet, rsh or ssh connections.

NOTE: installing packages with shells, daemons and so on with dpkg, will sometimes make a directory /etc/pam.d; you are to delete this directory, because if it exists you will not be able to login!! Boot to single user mode if you forget, and delete the directory.

To get telnetd running, add the required entry to the /etc/passwd file: echo "telnetd:*:101:101::/usr/lib/telnetd:/bin/false" >> /etc/passwd

Then add the telnetd entry to the /etc/inetd.conf file:

echo "telnet stream tcp nowait telnetd.telnetd /usr/sbin/tcpd \
      /usr/sbin/in.telnetd" >> /etc/inetd.conf

Finally add your computer's PPP IP address to /etc/hosts on the Psion to make telnet login happen faster:

echo "# This makes the telnet login to psion faster
192.168.1.100 gateway" >> /etc/hosts

13.3. Connecting to the internet using an external modem

Either a standard external modem or most PCMCIA modems will work in the netBook. (Psion's own Dacom 56K+ethernet PCMCIA modems DON'T seem to work!) Bear in mind that if you use an external modem on the netBook's internal serial port, you will need to also use a null modem adapter, because the Psion's cable is a null-modem cable. You can find commercial versions of null modem adapters on-line (e.g., expansys.com), or at such places as Radio Shack.

AT PRESENT THE INFRARED SERIAL PORT IS NOT SUPPORTED - information below relating to infrared is kept here for future purposes. An external infrared modem (e.g., Psion's nifty external travel modem - the Diamond Mako travel modems are apparently identical to the Psion travel modems) will work for using your psion to connect to the internet over the telephone lines. You might be able to pick up an infrared Psion (or Diamond Mako) travel modem from ebay.com for US$55-US$70); it works just fine wit the linux netBook (probably) with very little fuss - relink /dev/modem to /dev/ircomm0 and use baud rate 115200.

With its installation via dpkg (or ipkg?), PPP is pretty much all set up and ready to go with the modem. First try setting up PPP with just the "pppconfig" utility. Alternatively and manually, edit the files /etc/chatscripts/provider (requires chat to be installed), /etc/ppp/peers/provider, and /etc/ppp/pap-secrets to include your own ppp information, or run the script pppconfig, which should come with PPP. PPP is started and stopped using pon and poff. (I made a script "ppp-on" that starts pon, dumps its messages to /dev/null, and puts it in the background.) You may also need to modify the /etc/resolv.conf file, to give your nameserver IP numbers.