Main Menu
My Other Sites
Contact Andrew Quinn
jaquinn@ihug.co.nz http://twitter.com/jaquinn| Building a DLink DSL-502T Based IGate |
| Written by | ||||||||||||
| Friday, 22 January 2010 09:20 | ||||||||||||
|
This project came about because a group of amateur radio operators in Auckland wanted to improve the APRS receive coverage by using IGates to add receive only coverage around South Auckland. We found that a really low cost way of doing this (both initial investment and ongoing operational costs) was to use DLink DSL-502T ADSL routers with customized firmware. The DLink DSL-502T is very common in New Zealand. It was the router of choice for many first time ADSL users who signed up with the large ISP's. Over time many users want devices with more capability (wireless or more ports) so the routers are available at very low cost (or free). For those who care about the technical details.... the official specification for a DSL-502T is
In it's IGate implement we don't use the ADSL modem or the USB-B port. What the specification doesn't say is that there is an onboard serial port (even provided with soldered pin headers) which is perfect (with level conversion from RS-232 to 3.3V TTL) for connect to an TNC. Using a DSL-502T as an IGate is as much an exercise of configuring software as it is connecting hardware. The standard operating software makes the device an ADSL router.... we need to replace this so it becomes an IGate. This article is written for those who are interested in how to build their own operating system image for the device and outlines the steps I followed. It isn't hard if you have a Linux installation (real or in a VM).... I used Ubuntu 8.1 which work really well as a platform for building the operating software and flashing it into the routers. If you don't want to get into the details and just want an image to flash visit the guys at WetNet who have prebuilt images available for download - for the DSL-502T you need an image compiled for an AR71xx. Before going into the detail of how to we built and configured the firmware it is worth explaining what we wanted to achieve.
We achieved all these objectives using a custom OpenWRT build. It must be said that this project would not have been possible without the efforts of all those involved in the OpenWRT project (for creating the build scripts and environment), those who make it work on AR71xx based routers and those involved with the WebNet project who ported APRSD for the OpenWRT platform. We are thankful to all these people and hope that the notes here benefit others wanting to package these components to build IGates. The following outlines the process and scripts we used to configure the DSL-502T as an IGate to meet these objectives. A suitably configured environment is required to build the OpenWRT firmware. Assuming you are using Ubuntu 8.1 1. Install the packages required by the OpenWrt Kamikaze buildsystem 2. Checkout and prepare Kamikaze and the packages. We built out image based on Kamikaze 8.09.2 mkdir ~/openwrt 3. I installed the minicom and ntpclient packages in the image. Minicom is useful for checking the serial port works..... and ntpclient to keep the time correct. Without ntpclient the box doesn't keep very good time. ./scripts/feeds install minicom 4. By default the serial ports are configured as serial consoles. This needs to be disabled to use them to connect with a TNC. Disabling the ports requires a customized /etc/inittab to be included in the flash image. Any files in the ./files folder of the build will be added to the flash image when it is built. Create the following ./files/etc/inittab to configure the serial ports so they can be used. ::sysinit:/etc/init.d/rcS S boot 5. The default configuration for OpenWRT (at least for the version I built) is to bring the network up with a static IP address. I wanted DHCP so a customized /etc/config/network needs to be included in the flash image. Create the following ./files/etc/config/network to configure the network for DHCP. # Copyright (C) 2006 OpenWrt.org 6. While we are making changes to /etc/config it is a good idea to configure the system name and timezone. Create the following ./files/etc/config/system to configure the system name and timezone (in this case New Zealand). config system 7. We installed the ntpclient package earlier but this still needs to be configured so it connects to an appropriate time server. The configuration details are in /etc/init.d. Create the following ./files/etc/init.d/ntpclient to start the ntpclient with an appropriate time server (or pool in this case). #!/bin/sh 8. OpenWRT uses symbolic links between /etc/rc.d and /etc/init.d so we need to create these in ./files to reference the updated ntpclient start script. Create the following symbolic link in ./files/etc/rc.d ln -s ../init.d/ntpclient S55ntpclient 9. Time to build OpenWRT for the AR7 based DSL-502T. First it is necessary to configure the build: make menuconfig With the following options: Target System = TI AR7 [2.6] Base System = base-files, br2648ctl, busybox, dropbear, hotplug2, libgcc, libpthread, libstdcpp, mtd, opkg, uci, uclibc, udevtrigger Network = atm-tools, wget Kernel Modules = kmod-ipt-core, kmod-ipt-nathelper, kmod-sangam-atm-annex-a, kmod-ppp, kmod-pppoa, kmod-pppoe, kmod-ocx Utilities = terminal/minicom, gpioctl 10. We wanted to default the Minicom configuration so it opened port /dev/ttyS0 at 9600 baud, did not send the default initialization string but instead sent the "VER" command to the TNC. This is done by creating the file minirc.dfl in ./files/etc with the following contents: pu port /dev/ttyS0 11. The aprsd package (or other amateur radio packages) is not included in the OpenWrt source tree at the time of writing. The packages can be downloaded from www.wetnet.net. The OpenWrt-AX25.tgz that you download doesn't match the the folder structure required by the OpenWrt build (at least for version 8.09.2) so it is easiest to uncompress to a different location and then copy the files to the locations as shown in the following table:
12. Ensure the aprsd and required libraries are flagged to be built: make menuconfig With the following additional options: Library = libax25
13. If you are going to flash a single DSL-502T you can set the aprsd configuration by adding appropriately configured aprsd.conf, aprsd.config, INIT.TNC, RESTORE.TNC and welcome files to the ./files/etc/aprsd folder. Because we were going to install multiple DSL-502T IGates and were trying to create a standard image that could be flashed to all units it was important to have a more flexible configuration process for aprsd. We went with the approach of storing the aprsd.config file for each unit on a central web server. The files are named with the Ethernet MAC address of the router. The startup script downloads the appropriate config file on startup of the router and updates the version in flash if it has changed. The script we used is an extension to the standard aprsd startup script and is as follows: #!/bin/sh /etc/rc.common There are a few interesting things in the script.
14. With all the modules selected the OpenWRT image is ready to build. make This could take a while. Everything going well you will see a string of make messages, the last few messages if all went well being: make[2] package/rootfs-prepare Your image is now built and available at ./bin/openwrt-ar7-squashfs.bin This is the image that you flash to your DSL-502T with the command: ./scripts/adam2flash-502T.pl 192.168.1.1 -setmtd1 ./bin/openwrt-ar7-squashfs.bin Note: Depending on the version of your DSL-502T the default IP address may be 10.1.1.1 (rather than 192.168.1.1) Once the firmware is installed the DSL-502T will restart.... the restart process can take up to 60 seconds. An operational IGate will be flashing the Status LED (like a heartbeat) and have Ethernet and USB LED's on. Check your IGate appears using APRS.FI but note that your NetBeacon is not sent immediately on startup.... it will only be sent after the specified time. Setting the NetBeacon interval to 1 minute initially to check the IGate appears and once you are properly communicating with the APRS-IS server update the NetBeacon interval to something more reasonable - we use 60 minutes.
|


