This page will eventually describe the setup I put together to install ppp on my Balloon board and to start networking to the board from my Macbook. If this page reads more like a blog post than a wiki entry, that's only because I can't imagine anybody would ever read a blog post that I wrote, but they might stumble across this page whilst wandering through the Balloon wiki.

These notes are current as of 06/06/2011 (a date which works equally well on either side of the pond). If you're reading them more than a few months or years after I wrote them, then they are probably woefully out of date. Caveat Emptor!

Background

I recently obtained a Balloon board with a default set of software installed on it;1 however I did not have any sort of breakout board with which I could obtain network access (such as via a usb-gadget interface). All I had was a serial/power combination cable. Fortunately, I'm old enough that I recall connecting to the Internet using dialup modems and PPP. I figured I could set up the board as a PPP server;2 set up my development host as a PPP client, and access the board as if I had once of those fancy USB gadget connections (albeit a very slow connection).

I do my development on a MacBook (actually, on a Debian Squeeze installation running in a VMWare virtual machine on my MacBook). I use a RadioShack USB<->RS232 cable that works on the MacBook, but which I cannot get to work within the Debian VM. So having a network connection from the Debian VM through the MacBook, to the BalloonBoard simplifies things for me. Otherwise, I would have to transfer files from the VM to the MacBook, and then from the MacBook to the BalloonBoard. It also enables me to do things like apt-get install <somepackage> from the BalloonBoard in order to install or update software on the board (once I got my MacBook set up properly as a NAT router).

This page documents what I did to get the BalloonBoard set up to do this.

Say something here about how host$ represents a prompt on my MacBook and balloon# represents a prompt on the target board in the descriptions below.

Very Coarse Notes

  1. Obtain ppp and it's dependencies.
    Hint: http://www.emdebian.org/grip/search.php will point you at http://www.emdebian.org/grip/pool/main/p/ppp/ppp_2.4.5-4em1_armel.deb and will indicate that you should also probably get http://www.emdebian.org/grip/pool/main/libp/libpcap/libpcap0.8_1.1.1-2em1_armel.deb
    So I downloaded those

    host$ wget http://www.emdebian.org/grip/pool/main/p/ppp/ppp_2.4.5-4em1_armel.deb
    host$ wget http://www.emdebian.org/grip/pool/main/libp/libpcap/libpcap0.8_1.1.1-2em1_armel.deb
  2. Transfer the debs to the board.
    I use kermit and sz/rz to transfer files via the serial port, (a somewhat cumbersome process which is what led to my desire to switch over to using scp over PPP). In the past I've used minicom and sz/rz, but, for whatever reason, right now I've got things set up for kermit & sz/rz.
    Here is my .kermrc file:

    set line /dev/tty.usbserial
    define sz !sz \%1 > /dev/tty.usbserial < /dev/tty.usbserial
    define sx !sx \%1 > /dev/tty.usbserial < /dev/tty.usbserial
    Set speed 115200
    set carrier-watch off
    set prefixing all
    set parity none
    set stop-bits 1
    set modem none
    set file type bin
    set file name lit
    set flow-control none
    set prompt "MacBook Kermit> "
  3. Install the .debs you downloaded and copied over to the board.

    balloon# dpkg -i libpcap0.8_1.1.1-2em1_armel.deb ppp_2.4.5-4em1_armel.deb
  4. Edit/etc/ppp/config
    Here is what I changed in mine:

    --- options.orig        2011-06-16 13:25:30.000000000 -0400
    +++ options     2011-06-16 13:25:16.000000000 -0400
    @@ -32,11 +32,11 @@
     # Please do not disable this setting. It is expected to be standard in
     # future releases of pppd. Use the call option (see manpage) to disable
     # authentication for specific peers.
    -auth
    +#auth
     
     # Use hardware flow control (i.e. RTS/CTS) to control the flow of data
     # on the serial port.
    -crtscts
    +#crtscts
     
     # Use software flow control (i.e. XON/XOFF) to control the flow of data
     # on the serial port.
    @@ -53,7 +53,7 @@
     #escape 11,13,ff
     
     # Don't use the modem control lines.
    -#local
    +local
     
     # Specifies that pppd should use a UUCP-style lock on the serial device
     # to ensure exclusive access to the device.
    @@ -70,7 +70,7 @@
     # Use the modem control lines.  On Ultrix, this option implies hardware
     # flow control, as for the crtscts option.  (This option is not fully
     # implemented.)
    -modem
    +#modem
     
     # Set the MRU [Maximum Receive Unit] value to <n> for negotiation.  pppd
     # will ask the peer to send packets of no more than <n> bytes. The
    @@ -81,7 +81,7 @@
     
     # Set the interface netmask to <n>, a 32 bit netmask in "decimal dot"
     # notation (e.g. 255.255.255.0).
    -#netmask 255.255.255.0
    +netmask 255.255.255.0
     
     # Disables the default behaviour when no local IP address is specified,
     # which is to determine (if possible) the local IP address from the
  5. Start the PPP server on the target board:

    balloonboard# pppd /dev/ttyS2 115200 10.0.0.1:10.0.0.2 defaultroute -detach
  6. Start the PPP client on the development host:

    host$ sudo pppd /dev/cu.usbserial 115200 nodefaultroute -detach
  7. ssh into the board

    Oops... can't do that yet.

    This is where I discovered that no SSH server had been installed by default. So I headed back to http://www.emdebian.org/grip/search.php and found that openssh-server depended upon a whole slew of other packages. Since I didn't really want to download all of those packages (and especially didn't want to do manually what apt-get does automatically), I grabbed dropbear instead...(shutting down the ppp connection and dropping back into kermit)...

    host$ wget dropbear...
    host$ sz dropbear...
    target# dpkg -i dropbear...


    Now dropbear was running. But I still couldn't log in. It turns out that /etc/shells didn't contain /bin/bash, the default login shell for root. Once I added /bin/bash to /etc/shells I could log in, set up port forwarding, and do all the sorts of fancy stuff OpenSSH allows me to do.

  8. Set up /etc/resolv.conf
    I'm still working on figuring out the best way to do this. I just copied it from my MacBook to the BalloonBoard, but that only works when I'm at MIT (and using MIT's nameservers). I need to figure out a more robust solution here).

  9. Set up NAT on your development host so you can get to the Internet from the BalloonBoard.
    There are all sorts of tutorials on the web that describe how to set up NAT on a Linux host. I'll write a page here on this wiki in the next day or so that describes how I got it working on my Mac host. (Once I've worked out the rest of the kinks.) If you're working on a Windows host, you're on your own.
    Once you've got a network connection between the BalloonBoard and your development host, and you've got NAT set up on your development host, (and, presumably, your development host has access to the Internet), you can do things like:

    target# apt-get install openssh-server

    If you really would prefer to use the OpenSSH server instead of dropbear. You could even install Emacs and X, if you don't mind waiting hours or days for everything to download over your puny 115200 bps link. Mostly though, I just wanted to be able to use scp to copy files from my Debian VM box to the BalloonBoard.
    Unfortunately, the Debian VM box was on one unroutable network (192.168.x.y) while my BalloonBoard was on another (10.x.y.z). I should go back and put the BalloonBoard on the same subnet as the VMWare boxes. Otherwise, I'd have to use SSH's port forwarding feature (e.g.

    host$ ssh -L 9000:localhost:22 root@10.0.0.1


    and use

    debian$ ssh -p 9000 root@localhost


    to get from my Debian VM to the BalloonBoard.

Clearly, some work still needs to be done here. Also, it wouldn't kill me to clean up this page a little bit more.

Footnotes

  1. Unfortunately, my board arrived with a kernel that did not match the set of modules installed on the board. Once I installed a compatible set of kernel & modules, the procedures I described above started going much more smoothly and actually started to work. (1)

  2. Technically, since PPP is a symmetric protocol, there is very little difference between a PPP server and a PPP client. But it's simplest to describe the Balloon board as the PPP server and my development host as the client. (2)