The LB000021 Linux Router Mod

In order to get a new linux operating system into the router and for our projects to communicate with it, it is necessary to mod the router to add serial cable.

The router has pads for an 8 pin header with 3v, 0v, TX and RX. As my intention is to 'Mod' the router as little as possible, and most of the applications I have in mind will use very little power, I will use the 3v to power any addon board. If you are going to be using more power, or need higher voltages, then it is possible to pick up the routers power in and regulate that with a 7805 or 78L05 3 pin regulator.

Signal Levels

The routers TX and RX pins are 3v/0v and come directly from it's processor. These cannot be directly connected to a 12v/-12v or 5v/0v source! An inverting buffer must be used on each line. For simplicity, MAX232 style chip is recomended. I have never had a problem with simple transistor inverters connected to usb-serial ports, Be sure to double check the wiring as forcing 12v or 5v down a 3v input or output prevent you from re-flashing the software using then serial port and render the router useless.

We need to be able to hook a PC serial port up to the router in order to flash it with the new operating system. It is also nice to be able to program the PIC Processor using a boot loader. In operation, the PIC Processor will be powered and communicate directly with the router - no lever shifters required.

It makes sense to put the level shifter on a seperate board and use a header to connect the serial ports as needed.

Software

When I got my router, I tried several linux variations, before settling on software from the Midge OpenWRT-like mini-distribution for ADM5120 based routers. As I don't (yet) want to get into writing linux software, concentrating on the PIC side of things at the moment, I use the 'stable' download. This provides (and limits) me to a fairly complete set of command line tools with the option of downloading and installing things like an easy to use text editor (nano) - I could never get by with 'vi', updates over the web, and a mini web server and other network related tools.

Installing the Router Software

Midge can be installed by downloading a binary file containing the base software, hooking up the level shifter board and using 'Hyper Terminal' on a Windows PC set to communicate at 115,200 with no handshake, press 'return' to get 'Hyper Terminal' to 'connect' and switch on the router.

You should see the Boot loader start - if you don't, switch off and double check the connections - (I found that when the router is switched off, Windows/Hyper Terminal looses connection to the usb/serial port I use and have to re-boot windows to get things working (Doh!) when you are sure things are connected properly, the way around this 'hang up' is to tell 'Hyper Terminal' to 'Disconnect' before powering down the router.

If you are sure things are connected ok and you see the routers startupo messages when you power it up, 'disconnect' Hyper Terminal and power down the router. Reconnect (hit return) and power up the router - quickley pressing 'space' three times as the boot loader starts.

You should now see a menu with 3 options. Choose the first - upload linux - and use the Hyper Terminal to (using the Transfer menu) send the downloaded linux binary using the Xmodem protocol. You should see the transfer start, the process will take about 5 minutes.

When the transfer is done, the software will install (this will take a few minutes) and the boot loader menu will return. Select the last option to see the router run it's new software - the first time boot up will take another few minutes.

You should now be able to log into the router with username 'root' and password 'midge'

Experimenting with Microchip PIC Processors and Networks

A PIC, Linux and a Router
Modding The Router
Modding The Router - USB/Hard Drives
Modding The Router - Software & Filesystem
New Sunspot/Midge Packages
Extra Packages for Midge/Sunspot

PIC Links


Google
 
Web