Main Menu

Contact Andrew Quinn

jaquinn@ihug.co.nz http://twitter.com/jaquinn
Building a DLink DSL-502T Based IGate - The TNC
Written by Administrator   
Friday, 16 July 2010 00:00

In addition to configuring the DLink DSL-502T routers for the IGate project we also needed a TNC to connect between the radio and the serial port.

Our TNC selection was based on the following criteria:

  • The TNC board was to be installed inside the DSL-502T case
  • The DSL-502T serial port is used during the powerup sequence to display boot messages and will halt the boot process if it receives any characters so the ability to change the TNC code (or hardware) to not send or receive any data during the boot sequence was critical
  • Low cost
  • Accurate decoding
  • Monitor mode compatible with APRSD

We found the ATMega8 based TNC design from Henry Carl Ott (N2RVQ) which at first glance addressed the requirements and a prototype was built and tested.

In comparative testing of the N2RVQ reference design against an MFJ-1270C TNC using the WA8LMF APRS Test CD we found almost identical performance.  There were a small number of differences in the decode... sometimes the MFJ got packets the ATMega8 didn't and vice versa.

The source code for the ATMega8 TNC is very well written and was easily modified to handle the power on delay required for the DSL-502T boot process.

Long term performance testing of the ATMega8 TNC / DSL-502T / APRSD combination was performed with assistance for Ian ZL1AOX at his QTH overlooking Auckland.  The location of Ian's QTH provided excellent reception over the Auckland area and ensured plenty of traffic was gated through to the APRS-IS network.


After thirty days of continuous operation with no system errors or crashes we were happy enough with the design for Ian ZL1VFO to design a printed circuit board for the ATMega8 TNC that would fit into the DSL-502T case.

TNC Components

Because the DSL-502T would not be used as an ADSL router the telephone interface components were removed from the PCB providing space for the TNC to be mounted on the serial port pin header.

The next image shows the PCB before and after removing the telephone interface components.

DSL502T PCB Comparison

The final result with the TNC mounted on the serial port pin header is shown below.  +12V power for the TNC and available on the radio connector is provided by the red wire.  This connects to the DSL-502T PCB after the diode bridge rectifier and filtering capacitors. 

DSL502T and installed TNC

The current plan is to deploy many DSL-502T/TNC Igates around Auckland and the north Waikato to improve APRS-IS coverage.

 
Building OpenWRT for DSL502T Appliances - Removing Modules
Written by Administrator   
Monday, 05 April 2010 08:25

When building OpenWRT Kamikaze 8.09.2 for the DSL502T there are a number of mobiles included by default that are important if you are using the device as a modem but unnecessary if you plan to use the device as an appliance.

After some playing I have found the following modules can be excluded:

Kernel Modules = kmod-sangam-atm-annex-a, kmod-ppp, kmod-pppoa, kmod-pppoe, kmod-ocx

In my configuration the difference in after boot memory usage is as follows:

Before

Mem: 10268K used, 2492K free, 0K shrd, 1300K buff, 4168K cached

Modules

Module                  Size  Used by    Not tainted
tiatm                 151008  0
acx                   136704  0
nf_nat_tftp             1088  0
nf_conntrack_tftp       3760  1 nf_nat_tftp
nf_nat_irc              1856  0
nf_conntrack_irc        4768  1 nf_nat_irc
nf_nat_ftp              2432  0
nf_conntrack_ftp        6880  1 nf_nat_ftp
ipt_MASQUERADE          2080  0
iptable_nat             4240  0
nf_nat                 14624  5 nf_nat_tftp,nf_nat_irc,nf_nat_ftp,ipt_MASQUERADE,iptable_nat
xt_state                1600  0
nf_conntrack_ipv4      12064  3 iptable_nat,nf_nat
nf_conntrack           46592  11 pppoatm                 4320  0
ipt_REJECT              2976  0
xt_TCPMSS               3136  0
ipt_LOG                 6720  0
xt_multiport            2528  0
xt_mac                  1312  0
xt_limit                2016  0
iptable_mangle          2080  0
iptable_filter          2080  0
ip_tables              10064  3 iptable_nat,iptable_mangle,iptable_filter
xt_tcpudp               2624  0
x_tables               11504  11 ppp_async              10944  0
ppp_generic            26080  2 pppoatm,ppp_async
slhc                    5952  1 ppp_generic
crc_ccitt               1440  1 ppp_async
br2684                  7920  0
atm                    48912  3 tiatm,pppoatm,br2684

After

Mem: 7628K used, 5132K free, 0K shrd, 964K buff, 3180K cached

Modules

Module                  Size  Used by    Not tainted
acx                   136704  0
gpio_dev                3184  0
br2684                  7920  0
atm                    48912  1 br2684
 

 

 
Ubuntu 8.1 - Network Configuration Change Script
Written by Administrator   
Monday, 05 April 2010 07:54

Ubuntu 8.1 works really well as a build environment for OpenWRT and programming environment for the DSL502T. 

I have found that to make OpenWRT a network connection with Internet access is required but to program the DSL502T using adam2flash-502T.pl minimizing network traffic is important to prevent hangs during programming.

Also all the DSL502T units I have seen use 192.168.1.1 as the IP address for programming... but my internal network using 10.x.x.x network addresses.

So I needed a quick/easy way to switch between DHCP assignment of addresses for the internal network and STATIC assignment when programming.

Directly editing /etc/network/interfaces and restarting the network services works but gets old fairly quickly.... instead I wrote the following setnet script which is called passing DHCP or STATIC as the parameter.  It changes the network configuration and restarts the networking services.

#!/bin/sh

# Check if parameters are provided

if [ $# -ne 1 ]
then
    echo "Must specify STATIC or DHCP"
    exit 1
fi

INTERFACES="/etc/network/interfaces"
ETHMODE=`echo $1 | tr [:lower:] [:upper:]`

# Force both interface types to be off

sudo sed -i "s/#iface eth0 inet dhcp/iface eth0 inet dhcp/" $INTERFACES
sudo sed -i "s/#iface eth0 inet static/iface eth0 inet static/" $INTERFACES
sudo sed -i "s/iface eth0 inet dhcp/#iface eth0 inet dhcp/" $INTERFACES
sudo sed -i "s/iface eth0 inet static/#iface eth0 inet static/" $INTERFACES

# Now select the one that is required

if [ $ETHMODE = "STATIC" ]
then
    echo "setting STATIC"
    sudo sed -i "s/#iface eth0 inet static/iface eth0 inet static/" $INTERFACES
    sudo /etc/init.d/networking restart
elif [ $ETHMODE = "DHCP" ]
then
    echo "setting DHCP"
    sudo sed -i "s/#iface eth0 inet dhcp/iface eth0 inet dhcp/" $INTERFACES
    sudo /etc/init.d/networking restart
else
    echo "Unknown network mode"
fi
 

Probably no awards for great linux shell scripting but it works for me.

 
DSL502T + Ruby + Webrick + YAML = DIY Monitoring Appliance
Written by Administrator   
Friday, 02 April 2010 09:00

At the top of the hill on my rural property is a bore that provides stock water for my stock and three neighboring properties.

So what does this have to do with DLink DSL502T routers, Ruby, Webrick and YAML?

From time to time faults in the various farm system drain water from the header tank faster than the bore pump can pull water out of the ground.... so the pump runs continually.  Expensive on power but also potentially damaging.  Normal use is about 1 hour per day in summer, much less in winter.

The problem was how to know if the pump was running excessively without climbing the hill.... and even if I did check it was hard to know if the pump was running because it had just reached to refill point or had been running for three days.

A couple of years back I built a bore monitor that used an IR beam to determine of the bore pump was running and could be queried over the wireless network by a ruby application.  By querying every 5 minutes and storing the data in a MYSQL database I could graph daily usage over time and see when things had gone awry.

The network connection in the original design was performed using an AVR AT90S8515 and a Packet Wacker ethernet interface.  For 2 years this worked well and then the Packet Wacker died.

Around this time i had been playing with DSL502T's to provide Amateur Radio IGate services and had a build environment configured for the OpenWRT firmware.   Included in the OpenWRT packages is Ruby and I know I could easily write a ruby program with a web interface (using Webrick) and simple data storage (using YAML) so replace the original monitor board.

It took some playing but I was able to build OpenWRT with Ruby and the required modules for Webrick and YAML to operate with the following configuration:

make menuconfig

With the following options:

Target System = TI AR7 [2.6]
Target Profile = No WiFi
Target Images = squashfs

Base System = base-files, br2648ctl, busybox, dropbear, hotplug2, libgcc, libpthread, libstdcpp, mtd, opkg, uci, uclibc, udevtrigger

Network = atm-tools, wget
Library = (none)
IPv6 = (none)

Kernel Modules = kmod-ipt-core, kmod-ipt-nathelper, kmod-sangam-atm-annex-a, kmod-ppp, kmod-pppoa, kmod-pppoe, kmod-ocx

Utilities = gpioctl

Languages = ruby, ruby-core, ruby-erb, ruby-irb, ruby-openssl, ruby-webrick, ruby-yaml

The ruby-erb and ruby-openssl libraries are required in addition to ruby-webrick if you actually want webrick to work.  Not including these libraries will cause errors when you require 'webrick' in your ruby code.

I have not attempted a minimum size configuration here... it is highly likely when not used as a modem that modules such as kmod-pppoa, kmod-pppoe and kmod-sangam-atm-annex-a can be excluded.

It's not blindingly fast serving pages but as a stand alone monitoring appliance interfaced to data collection sensors via the onboard serial port and providing a simple web interface showing the current status and historical trends it does the job for me.

Another great use for $1 modems.  Time to buy a few more for the stockpile.

 
<< Start < Prev 1 2 3 4 5 6 7 8 9 Next > End >>

Page 1 of 9