
                    DMT-UX

           DSL MODEM TOOL FOR UNIX


GENERAL:

  dmt-ux is intended to be a unix-port of dmt (http://dmt.mhilfe.de),
  a DSL-diagnostics-tool.

  It can query certain Modems for data about the line-quality.
  DMT-UX should work with Thomson Speedtouch and compatible modems.
  Tested with:
  - Thomson Speedtouch 516i V6.
  - 

  Author:   Timo Boettcher (dmt-ux@spida.net)
  Homepage: http://www.spida.net/projects/dmt-ux


INSTALLATION:

  You need aap to compile dmt-ux using the provided aap-recipe.
  You can get aap from http://www.a-a-p.org

  The just run "aap" in the main directory.

  You can build dmt-ux without support for creation of graphics, too.
  The just run "aap GRAPHIC=no" in the main directory.


  If you don't want that, you can use gcc directly.

   $ gcc -c dslam-vendors.c
   $ gcc -c -I/usr/include/freetype2 graphic.c
   $ gcc -Dgraphic -lpng  -lm -lfreetype -I/usr/include/freetype2 -o dmt-ux dmt-ux.c dslam-vendors.o graphic.o

  You can build dmt-ux without support for creation of graphics, too.
   $ gcc -c dslam-vendors.c
   $ gcc -lm -o dmt-ux dmt-ux.c dslam-vendors.o

Usage:

  You can run dmt-ux as normal user, you just have to be able to reach
  the telnet-port of the modem you are trying to query.

  options:
   ./dmt-ux
   -d --daemon[$seconds]
                                daemon mode: keep running and check
                                every $seconds. Default is 5
   -H --hostname modem
                                hostname or IP where the modem is
                                reachable
                                Default is speedtouch.lan
   -P --port 23
                                telnet-port of the modem 
                                Default is 23
   -u --username root
                                username for logging into the modem
   -p --password secret
                                password for logging into the modem
   -I --imagefile file.png
                                create png imagefile with the supplied 
                                name containing the above three single 
                                graphs
      --image-bitalloc-file file.png
                                create png imagefile with the supplied
                                name containing bit allocation data
      --image-noise-file file.png
                                create png imagefile with the supplied
                                name containing noise data
      --image-chancharlog-file file.png
                                create png imagefile with the supplied
                                name containing charlog data
      --image-rrd-errorsecs-file file.png
                                create png imagefile with the supplied
                                name containing errorsec data
      --image-rrd-snr-file file.png
                                create png imagefile with the supplied
                                name containing snr data
      --pidfile
                                selects a file to write the pid to
                                enables daemon-mode
   -L --logfile
                                selects a file to write logs to
   -l --legend
                                print scales on the single graphs
   -l --legend
                                print scales on the single graphs
   -i --information
                                print out information on the console
                                and, if used with -I oder --imagefile
                                paint linestatistics in the iamge
      --dmt-compatible
                                prints dmt-compatible graphs
                                this doesn't display the first 16 tones
                                and the 
      --font Vera.ttf
                                font to use for graphics in images
      --rrd-errorsecs-file file.rrd
                                file with rrd-data for number of seconds
                                with errors
                                will be created if not existend
      --rrd-snr-file file.rrd
                                file with rrd-data for snr
                                will be created if not existend
   -h --help
                                print usage information
   -v --version
                                print version

  example
   $./dmt-ux -H modem -P 23 -u root -p secret --image-noise-file graphs/test-noise.png --image-bitalloc-file graphs/test-bitalloc.png --image-chancharlog-file graphs/test-chancharlog.png --image-rrd-errorsecs-file graphs/test-errorsecs.png --image-rrd-snr-file graphs/test-snr.png --imagefile graphs/test-all.png -l -i --font fonts/Vera.ttf --rrd-errorsecs-file errorsec.rrd --rrd-snr-file snr.rrd
   DMT-UX 0.154 (DSL Modem Tool for Unix)
   (C) 2006 by Timo Boettcher

   This is free software. You may redistribute copies of it under the terms of the
   GNU General Public License (Version 2) <http://www.gnu.org/licenses/gpl.html>.
   There is NO WARRANTY, to the extent permitted by law.

   http://www.spida.net/projects/dmt-ux
   Connecting to localhost (127.0.0.1) on port 23...
   Got asked for username
   Fetching Environment
   Fetching debug stats
   Fetching adsl info
   Fetching adsl data
   Closing connection
   Connection closed
   update errorsec.rrd 1158524977:8
   update snr.rrd 1158524977:13:43:56
   modemvendor=THOMSON
   modemname=SpeedTouch
   modemnumber=516
   modemboardname=BANT-V
   modembootloader=1.0.6
   modemfirmware=ZZQ0AA5.40E
   modemserial=0611DTDLM
   modemmacaddr=00-14-7F-29-D5-44
   modemoperationmode=G.992.5 Annex B (ADSL2+)
   modemchannelmode=interleaved
   modemstate=up
   downstream=17692
   upstream=1183
   modemattenuation up=5.5
   modemattenuation down=1.5
   modemmargin up=13.0
   modemmargin down=12.0
   modemoutputpower up=12.5
   modemoutputpower down=0.0
   revision=01
   vendor=Infineon Tech.
   vendorspecific=711c
   estimated line length 101m - 298m
   completed
   $

rrdtool fetch errorsec.rrd AVERAGE -r 600 -s -20h -e +0h
rrdtool graph test.png -a PNG --start end-24h --end now --step 300 --title "Test Graph" DEF:myerrorsecs=errorsec.rrd:errorsecs:AVERAGE:start=end-1h LINE1:myerrorsecs#00CC00:"Errored Seconds"

rrdtool fetch snr.rrd AVERAGE -r 600 -s -20h -e +0h
rrdtool graph test.png -a PNG --start end-24h --end now --step 300 --title "Test Graph" "DEF:mysnr_low=snr.rrd:snr_low:AVERAGE:start=end-1h" "DEF:mysnr_LQ=snr.rrd:snr_LQ:AVERAGE:start=end-1h" "DEF:mysnr_high=snr.rrd:snr_high:AVERAGE:start=end-1h" "LINE1:mysnr_low#00CC00:minimum Signal to Noise Ratio" "LINE2:mysnr_LQ#CCCC00:average Signal to Noise Ratio" "LINE3:mysnr_high#CC0000:maximum Signal to Noise Ratio3600"


License:

  This package contains software of different parties.
  Everything not explicitly mentioned is 
	(C) 2006 Timo Boettcher
	Licenced under GPL (see Licence.GPL in this package)
  The Makefile for pfsense (FreeBSD) is provided and copyrighted by
  	(C) 2006 Daniel S. Haischt
	Licenced under GPL (see Licence.GPL in this package)
  The Fonts Vera.ttf, VeraBd.ttf is
	(C) Bitstream Inc
	Licensed under a special Licence (see Licence.Bitstream in this
	package)
  The Images downstream-arrowhead.xpm, downstream-arrowsection.xpm,
  modem-local.xpm, modem-remote.xpm, upstream-arrowhead.xpm,
  upstream-arrowsection.xpm and world.xpm are
	(C) 2006 A. Matthoefer
	Used with friendly permission	

