Connect to a modified router

From Embedded Xinu
Jump to navigation Jump to search

Summary

This will explain how to connect to the serial ports on a modified LinkSys WRT54G using serial communication software such as the open source Kermit.

Before Starting

Expose a serial port on the router

You must have successfully modified a LinkSys WRT54G to expose at least its first serial port in such a way that you can connect it to another machine with serial communications software. If you have not done so yet, please see HOWTO:Modify the Linksys hardware

Acquire serial communication software

A solid open source suite of communication software known as Kermit has served us well as a method of communicating with the WRT54G. C-Kermit, the UNIX compatible implementation, is available for download at their website [1]. Alternatively, if you are building multiple backends to be made available as a pool, our suite of XINU Console Tools includes a basic serial console utility called tty-connect.

Steps to Connect to the Router

Task One: Power up the Router

Yes, that means plug it in.

Task Two: Connect Serial (& Optionally Network) Cable(s)

Ensure that the connection is going from UART0 (the first serial port--you did label them didn't you?) as this is where the console will be running. If you are connecting a standard PC serial port (a DTE) to your router, use a straight serial cable. Other arrangements may require a Null Modem; check your transmit/receive line polarities to be sure.

Also, because the goal is to upload custom code to the router, it would be a good idea to connect the router to your network by wiring it up via one of the numbered LAN ports on the back of the router (NOT the Internet/WAN port).

Task Three: Configure your Serial Communication Software

The connection used by the router's serial port is fairly standard: 115200bps, with 8 data bits, no parity bit, and 1 stop bit, or 8N1.

In our setup, once running Kermit on the external machine, we connected by typing in:

set line /dev/tty000      to select the serial device that is connected to the router.
set serial 8n1      which is not really necessary since this is default.
set speed 115200      as given to us in the router specifications.

Task Four: Connect to the OpenWRT Console

In Kermit, after the configuration commands have been entered, it was as easy as typing connect. Once connected, press Enter to get a console from OpenWRT. This should function just about identically to the ssh console, and if it works correctly, it means that the serial port has been correctly installed.

Task Five: Access the Common Firmware Environment CLI

This will be filled in, but here's the basics:

  • Make sure boot_wait is on (this should be added to the Install OpenWRT HOWTO)
  • Reboot the router (reboot or power cycle).
  • Hit CTRL+C on your serial console.
  • You're in.

What to do next?