section1:
par1 = value1
par2 = value2
section2:
par3 = value3
The radiorouter package helps toconfigure a radio link network system with mail (UUCP/BSMTP), transparent TCP/IP and webpropy support. It uses a soundcard as digital/analog converter.
It has been succesfully used on VHF (9600 bps, up to 70km) and HF (2500 bps, up to 1000km) links.
You need a radio transceiver that supports these basic features:
Ability to get/send analog on baseband audio.
An external digital PTT (Push-to-Talk) line.
Some radios also permit to control ignition and channels switching. If available, these features can be also configured.
You have to build a hardware board to interface these options with the computer (a soundcard and a serial/parallel port). Take a look on this documentation from the asterisk-phonepatch project: Simple interface boards
The most efficient way to send e-mails through radio-links is using the old UUCP (Unix-to-Unix Copy) protocol. The path that a e-mail follows is the following:
Email-Client: You send a mail from the client to the router (using any e-mail client).
Postfix: The Postfix daemon is listening on port 25 and receives the mail. It checks the transport file (/etc/postfix/radiorouter.transport) to decide what to do with this e-mail. Radiorouter configured tranport to be 'rrbsmtp (Radiorouter BSMTP, already configured in /etc/posftix/master.cf). - The mail is delivered to /usr/share/radiorouter/mail/rrbsmtp.py, which takes care of queue limitations and, if conditions are fulfilled, it sends the mail to BSMTP.
BSMTP: rites uncompressed mail to /var/spool/bsmtp/UUCPNAME
UUCP: When a UUCP call is started (normally using uucico), it runs /usr/lib/bsmtps/sbsmtp UUCPNAME, this program takes the files from de bsmtp spool, creates the compressed batches and pass them to the UUCP queue (/var/spool/uucp/UUCPNAME)
Radiorouter: You launch a UUCP call to the default server using the script rrcall. It simply checks what is the default server and calls it: uucico -D -p PORTNAME -S SERVERSYTEMNAME. Check /etc/uucp/ports to see how ports ara managed.
TODO
TODO
Configuration files are located at /etc/radiorouter:
radiorouter.conf: Main configuration file, where you configure all the network preferences of the station (hostname, DNS, radio interfaces, TCP/IP interfaces, board configuration (for radio interface), mail and tcptunnel.
board.conf: This file is automatically configured (taking info from radiorouter.conf), so you shouldn't edit it manually.
mail/queue_max_message.': Messages to be used when a mail exceeds maximum queue size. Available for English and Spanish. Add files for your locale if needed.
mail/rrbsmtp.conf: Generated automatically from radiorouter.conf, contains configuration regarding to UUCP/BSMTP.
services/: Scripts that can be accesed through inetd (port 541), used by gnome-tools-ehas package (router-applet and grrcall).
/etc/init.d/radiorouter: Service resposible for starting:
radioboardd: Controls radio-board (PTT, datachannel, ignition). (configuration file /etc/radiorouter/board.conf)
soundmodem: vhf/hf modems (configuration file: radiorouter.conf)
mixer: set mixer values (configuration file: radiorouter.conf)
axdigi: simple ax25 digipeater (no configuration needed)
ax25d: ax25 daemon, controls uucp and tcptunnel incoming calls (configuration file /etc/ax25/ax25d.conf)
tcptunnel: Uses tcptunnel package to multiplex TCP connections on a unique AX25 conection. It usually redirects local 8080 port to remote 3128 (squid) for webproxy access.
This file uses a syntax where indentation (tabs or spaces, do not mix them) marks the structure. An example file:
section1:
par1 = value1
par2 = value2
section2:
par3 = value3
There is no limit is sections nesting. Note that string values are surrounded by '.
Taken from /usr/share/radiorouter/radiorouter.template, you can automaticcaly generate a help file:
/usr/share/radiorouter/pyconfig -t /usr/share/radiorouter/radiorouter.template --generate-help
After the configuration file has been modified, you have to ran an update:
rrconfig --write
Let's imagine we have a two stations, client (client.pe.ehas.org) and server (server.pe.ehas.org), and two VHF transceiver to connect them. The server station has a internet connection and it's able to send/receive mails and connect to the WWW. We want to enable UUCP e-mail, a standard TCP/IP network and the webproxy to navigate from client. The server connects to otherserver to send/received all the e-mails (from client and from itself the server) using also UUCP:
hostname: server
full name: server.pe.ehas.org
AX25 IP: 10.0.0.5
AX25 modem: vhf-newfsk (rate 1)
UUCP nodename: server
general:
hostname = 'server'
domain = 'pe.ehas.org'
dns = '80.58.0.33'
locale = 'es_ES'
timezone = 'Europe/Madrid'
ntp_servers = 'ntp.debian.org'
grunt_public_key = '/etc/grunt_public.gpg'
interfaces-radio:
radio0:
radiomodem:
state = on
modem = 'vhf-newfsk'
newfsk_rate = 1
callsign = 'SERVERV'
ptt_txdelay = 150
ptt_txtail = 40
slottime = 100
ppersist = 128
soundcard = '/dev/dsp0'
soundcard_samplerate = 0
soundcard_mixer_output = 'vol: 80'
soundcard_mixer_input_device = 'mic'
soundcard_mixer_input = 'mic: 50'
board:
ptt_on = 'serial:/dev/ttyUSB0 rts 0'
ptt_off = 'serial:/dev/ttyUSB0 rts 1'
ptt_maxontime = 30
datachannel_policy = 'always'
datachannel_on = 'serial:/dev/ttyUSB0 dtr 0'
datachannel_off = 'serial:/dev/ttyUSB0 dtr 1'
radio_on = 'serial:/dev/ttyUSB0 dtr 0'
radio_off = 'serial:/dev/ttyUSB0 dtr 0'
power_radio_with_interface = on
tcpip:
state = on
address = '10.0.0.5'
netmask = '255.255.255.0'
interfaces:
eth0:
tcpip:
state = off
dhcp = off
address = '192.168.1.2'
netmask = '255.255.255.0'
gateway = '192.168.1.1'
tcptunnel:
mail:
postfix:
mydestination = '$myhostname'
myorigin = '$myhostname'
mynetworks = '127.0.0.0/8'
relayhost =
message_size_limit = 100k
bounce_size_limit = 1000
mailbox_size_limit = 1M
queue_minfree = 1M
uucp:
local:
node_name = 'server'
node_password = 'uuserver'
system_options = "protocol=y\ncommands=mail rbsmtp rsmtp cbsmtp rcsmtp rgsmtp"
remote:
client:
ax25_paths = 'radio0: CLIENTV'
password = 'uuclient'
connect_crontab_entry = 'radio0: 14,45 0-23'
email_addresses = 'client.pe.ehas.org'
connect_interfaces = 'radio0, tcpip'
connect_on_queued = off
queue_max_size = 100k
otherser:
password = 'password'
tcpip_address = 'otherserver.pe.ehas.org'
connect_crontab_entry = 'tcpip: 14,45 0-23 * * *'
email_addresses = '*'
connect_interfaces = 'tcpip'
connect_on_queued = on
queue_max_size = 1000k
hostname: client
full name: client.pe.ehas.org
AX25 IP: 10.0.0.6
AX25 modem: newfsk (rate 1)
UUCP nodename: client
general:
hostname = 'client'
domain = 'pe.ehas.org'
dns = '80.58.0.33'
locale = 'es_ES'
timezone = 'Europe/Madrid'
ntp_servers = 'ntp.upm.es, ntp.debian.org'
grunt_public_key = '/etc/grunt_public.gpg'
interfaces-radio:
radio0:
radiomodem:
state = on
modem = 'vhf-newfsk'
newfsk_rate = 1
callsign = 'CLIENTV'
ptt_txdelay = 150
ptt_txtail = 40
slottime = 100
ppersist = 128
soundcard = '/dev/dsp'
soundcard_samplerate = 0
soundcard_mixer_output = 'vol:80'
soundcard_mixer_input = 'mic:50'
soundcard_mixer_input_device = 'mic'
board:
ptt_on = 'serial:/dev/ttyS0 rts 0'
ptt_off = 'serial:/dev/ttyS0 rts 1'
ptt_maxontime = 30
datachannel_policy = 'always'
datachannel_on = 'serial:/dev/ttyS0 dtr 0'
datachannel_off = 'serial:/dev/ttyS0 dtr 1'
radio_on = 'serial:/dev/ttyS0 dtr 0'
radio_off = 'serial:/dev/ttyS0 dtr 0'
power_radio_with_interface = on
tcpip:
state = on
address = '10.0.0.6'
netmask = '255.255.255.0'
#gateway = '10.0.0.5'
interfaces:
eth0:
tcpip:
state = on
dhcp = off
address = '192.168.1.1'
netmask = '255.255.255.0'
webproxy:
ax25_path = 'radio0: SERVERV'
tunnel_timeout = 60.0
redirs = "8080:localhost:3128, 8081:localhost:110"
mail:
postfix:
mydestination = '$myhostname'
myorigin = '$myhostname'
mynetworks = '127.0.0.0/8'
message_size_limit = 100k
bounce_size_limit = 1000
mailbox_size_limit = 1M
queue_minfree = 1M
uucp:
local:
node_name = 'client'
node_password = 'uuclient'
system_options = "protocol=y\ncommands=mail rbsmtp rsmtp cbsmtp rcsmtp rgsmtp"
remote:
server:
ax25_paths = 'radio0: SERVERV'
password = 'uuserver'
connect_crontab_entry = 'radio0: 0-23 14,45'
email_addresses = '*'
connect_interfaces = 'radio0'
connect_on_queued = true
queue_max_size = 100k
Finally, we update all configuration files and restart the services:
rrconfig --write /etc/init.d/radiorouter restart
You can test that services are working as expected:
# test UUCP exchange rrcall # test TCP/IP ssh 10.0.0.5 # test webproxy http_proxy=localhost:8080 wget www.test.com
You may can be checked real-time with:
tail -f /var/log/syslog tail -f /var/log/uucp/Log tail -f /var/log/mail.log tail -f /var/log/squid/access.log listen -ta (AX25 trace)
conf/: Configuration files
radiorouter.template: Template file (sytax needed by pyconfig.py) for radiorouter.conf
radiorouter.conf.example: Base example for radiorouter.conf
board/: Radioboard scripts
portiface.py: base clases to interface a generic port
iserial.py: interface a serial port (uses portiface.py)
iparallel.py: interface a parallel port (uses portiface.py)
boardiface.py: access a radioboard (configuration file: /etc/radiorouter/board.conf).
radioboardd.py: daemon to control a board radio. Waits for connections on UNIX socket /tmp/radioboard.INTERFACE.
hfcat.py: controls a HF radio (CAT interface) using a serial port. Support for Kenwood (tested on TK-80) and Icom (untested) radios.
config/: Configuration scripts
general: Manages grunt keys (/root/.gnupg, /root/.grunt), timezone (/etc/timezone), hostname (/etc/hostname), language environment (/etc/environment), the Network Time Protocol (/etc/ntp.conf, /etc/default/ntp), UUCP and serviced in inetd (/etc/inetd).
interfaces: Configure standard TCP/IP interfaces (ethernet and WiFi). Modifies /etc/network/interfaces.
radiointerface: Configures radio-soundmodem interfaces (radioX). Modifies /etc/radiorouter/board.conf, /etc/ax25/ax25d.conf, /etc/ax25/ax25d.conf and /etc/ax25/soundmodem.SOUNDCARD.conf.
mail: Configure Postfix/UUCP/BSMTP mail system. Modifies /etc/postfix/main.cf, /etc/postfix/master.cf, /etc/uucp/{config,sys,passwd,call,port}, /etc/postfix/radiorouter.transport, /etc/radiorouter/mail/rrbsmtp.conf, /etc/cron.d/radiorouter.
cfgagent.py: Provides generic functions for config facilities.
rrconfig.py: User executable to control radiorouter configuration.
mail/: Postfix, UUCP and BSMTP related scripts.
messages/: Messages of queue size limits exceeded. -rrbsmtp.py: Wrapper to be used from /etc/postfix/master.cf (replaces /usr/lib/bsmtp/bsmtp).
rrcall.py: calls the default UUCP system to exchange emails. On radio links shows a communication trace (with listen)
uucpq.py: Show BSMTP/UUCP queue state.
misc/: Miscellaneous scripts.
bridge.py: Used on /etc/ax25/ax25d.conf, needed to limit package size up to radio interface MTU.
configobj.py: Module to manage INI-compatible configuration files
daemonize.py: Used to daemonize python scripts (used by radiorouterd and rrcall)
dsplevel.py: Shows a vu-level from recorded audio on a soundcard.
pyconfig.py: Module to manage tabbed configuration files (/etc/radiorouter/radiorouter.conf)
servicesd.py: Access /etc/radiorouter/services scripts for remote control (see services/ directory)
soundcard.py: Generic soundcard module (used by dsplevel.py)
services/: Scripts accesible from inetd (port 541)
battery: return battery level using lm-sensors.
rrcall: execs a radiorouter call (uses misc/rrcall)
uucpq: show uucp queue (uses mail/uucpq)
uucpqm: show mail-info on uucp queue (uses mail/uucpq -m)
doc/: This documentation
image-testing/: Infraestructure to simulate a radio station with QEMU.
image_generation_radiorouter.txt: How to create a image able to rum in QEMU for testing radiorouter.
alsa_bridge.py: creates a ALSA audio bridge using aoss.
client-bridge.sh/server-bridge.sh: Scripts to start client/server alsa bridge.
radiorouter_qemu.sh: Starts a QEMU radiorouter image.
local/: Accesory scripts
save-etc.sh: simple script to save /etc on a tarball
test_ax25.sh: sends pings to test a AX25 link
test_board.sh: tests a radioboard (ptt, datachannel and ignition)
webconf/: Web configuration (uses cherrypy library) for radiorouter
cherrypy.conf: Configuration file for cherrypy web-framework
layout.css: CSS file
logo.png: Radiorouter logo displayed on the web
webconf.py: Uses cherrypy to dinamically show the web-configurator