PROJECT - CONNECT TO INTERNAL LINUX SYSTEM ON NETGEAR DGN2000 WIRELESS ROUTER

You will need: Raspberry Pi with a serial terminal emulator, four Dupont patch leads, multi-meter, Netgear DGN2000 or something similar, a T8 or T8H Torx driver, though the screws in your router may be different.

INTRODUCTION

Netgear DGN2000 wireless router

I bought a second-hand Netgear DGN2000 for £1 so I didn't expect it to work - and it didn't! Or at least it only recognised a network device connected to port 1. I decided to open it up and see whether I could find a serial connection and access it from a Pi.

You will need a serial terminal emulator to communicate with the router - I used screen. You can install it by entering:

sudo apt-get install screen

If you haven't already used screen, you should check that your serial pins are available:

There's a good explanation of the Pi's serial capabilities on the Raspberry Pi website. The serial pins on your Pi are shown in the pinout diagram here: physical pins 8 and 10, GPIOs 14 and 15.

Netgear DGN2000 rubber foot

On first glance the case seems impenetrable with nothing willing to open up and no screws visible. There's no screw hidden under the self-adhesive label, even though a dip in the centre of the label where the moulding sprue was removed could suggest otherwise. However, the rubber feet are not stuck on as you might expect but are attached to rubber hinges so that you can pull them out of their holes and they remain captive by the hinge. These reveal four Torx screws that can be removed with a suitable driver. The top, bottom and clear plastic parts all separate and leave the rear panel fitted with the two aerials attached by coaxial wire to the system board.

Netgear DGN2000 serial

On examining the system board, there are four unused connection points in a row - this suggests a serial connection and I'll refer to the connections as pins from now on, even though they are holes. They have the reference J521, which probably confirms that it's a JTAG point. On my router they were partially covered by an adhesive label. You now need to identify which of these pins does what.

Step 1

Ensure that the router is switched off,

Step 2

Connect the ground on the router to pin 6 on the Pi and the pin you've identified as being transmit on the router to pin 10 on the Pi. Connect one of the other pins on the router to pin 8 on the Pi.

Step 3

Start the terminal emulator and specifiy the serial port associated with GPIO14 and GPIO15 and an educated guess at a baud rate (speed). There's a range of standard serial port speeds (1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 128000 and 256000 bits per second) and a subset of these that tend to be used most often. Whether you use /dev/ttyAMA0 or /dev/ttyS0 depends upon how your Pi is set up. The link to the UART documentation above should help you choose which.

screen /dev/ttyAMA0 115200

Step 4

Switch on the router and you will see the transmitted data. If it is garbled, then the speed is wrong - try a lower speed from the list. If you see readable text then you have accessed the router and are waiting for it to boot version of Linux.

The output from this router is shown in a separate page due to its length.

Once running, you can enter commands like ifconfig and ps -eg.

On this particular device and at the end of the start-up messages you are prompted to press Enter to start an interactive session. Try this by pressing Enter or Return. If this results in a prompt for input then it works and you chose the correct pin. If not, connect the unused pin on the router to pin 8 on the Pi and repeat from Step 3.

Once you have an interactive session running you can type help to see the available subset of Linux commands. These will vary between different routers and possibly between different version of the software.

Step 5

Over to you! The router runs the BusyBox version of Linux and it's specially designed for embedded systems and runs a single image for all commands. To see the full list of commands that have been enabled, type busybox at the prompt.

The picture of the PCB shows the 3.3V regulator and the four holes/pins for the serial connection.

Netgear DGN2000 PCB