Ero sivun ”OH2RDY” versioiden välillä

Radioamatööriwikistä
Siirry navigaatioon Siirry hakuun
>Oh2mqk
p (typoja)
>Oh2mqk
(Säätöryhmän nimeäminen)
Rivi 458: Rivi 458:
   
   
  #end
  #end
== Säätöryhmä ==
Tähän säätösuoritukseen osallistuivat huhtikuussa 2007:
* OH2MQK: Kone ja sen rautamuutokset, Linux-asennus
* OH3BK: ''aprsd'' ja ''aprsdigi'' -softien asennus
* OH2KKU ja OH3GNU: ''aprsd'' ja ''darkice'' softien bugifiksaus

Versio 22. huhtikuuta 2007 kello 17.09

OH2RDY on Viestikallion (OH2MOH / OH2Z) paikallinen APRS i-gate laite.

Tämä artikkeli kertoo muillekin vihjeeksi miten sen uusittu versio tehtiin mahdollisimman pitkäikäiseksi.

Aiemman laitteiston murheet:

  • Nälkäinen räkki-PC 230V sähköillä
  • Pyöriviä kovalevyjä ankarissa ympäristöoloissa
  • Pyöriviä tuulettimia
  • Ei käynnistynyt sähkön palatessa, vaan piti käydä käsin käynnistämässä

Aiempi kone oli Pentium-MMX 200 MHz, jossa kyllä koneteho riitti, mutta ikivanha BIOS ei ymmärtänyt uusia kovalevyjä... Kyllähän se levykeasemasta boottasi ja Linux-2.2 löysi uudenkin kovalevyn, mutta isollakaan hiellä ei saatu Linux-kernelin versiota päivitettyä.

Uusi palvelinkone

Säätäjät sitten kyllästyivät tapaukseen käytyään ties kuinka monennetta kertaa käynnistämässä koneen käsin ja ottivat hyllyltä "sulautetun" koneen:

  • 12V DC käyttösähkö (toimii myös OH2RAY-ripiitterin 13.8 Voltin pääsähköillä)
  • 4x RS232 D9M liittimiä
  • 2x LPT D25F liittimiä
  • 1x RJ45 10/100 Base-T ethernet
  • audio: mic in, line in, line out
  • Prosessorina VIA Samuel 2, noin 1100 Bogomips (valitettavasti tässä on pyörivä tuuletin)
  • 128 MB PC133 SDRAM
  • CD-ROM asema
  • paikka 3.5" kovalevylle jossa sovitinpalikan kanssa 2.5" kovalevy.

Kovalevy otettiin pois ja sen tilalle laitettiin gizmo-varastosta löytynyt 3.5" CF-kortin adapteri. Kaupasta haettiin vielä 1.0 gigatavun CF kortti.

Tuo Compact Flash näkyy IDE-kovalevynä koneelle ja jopa 512 MB kokoinen yksilö olisi todennäköisesti riittänyt. CF kortin suhteen merkittävä juttu on että sille ei saa kirjoittaa jatkuvasti, kuten Linuxeilla ja Windowseilla on tapana touhuta kovalevyjensä kanssa. Tästä tarkemmin jäljempänä.

Jos sopivia "sulautettuja" PC-koneita ei satu olemaan takataskussa, tässä olisi muutama viite mahdollisesti käyttökelpoisiin:

Uusissa koneissa sarjaportit alkavat olla kovin harvinaisia, mikä tekee kytkennän sarjaportilliseen TNC:hen hieman haastavaksi. Tilalla on kuitenkin USB-portteja joihin voi laittaa USB-RS232 sovittimen.

Parempia vaihtoehtoja löytyy teollisuus-PC puolelta. Tärkeitä tavoitteitahan ovat:

  • Ei tuulettimia
  • Kohtuullisesti laskentavoimaa
  • Ethernet-liitäntä
  • D9M sarjaportti (tai pari), printteriportti
  • Tasavirta käyttösähkönä ja vähäruokaisuus
  • Flash-muisti "kovalevynä"

Uuden koneen softat

Debian 4.0 oli juuri ilmestynyt ja siitä asennettiin minimaalinen asetelma tuolle "levylle":

  • 2.6.18 kernel ( + mitä se haluaa )
  • ssh, openssh-server, openssh-client
  • aprsd, aprsdigi
  • ax25-tools, ax25-apps, libax25
  • ntp, ntpdate
  • darkice

Näistä aprsd ja darkice ovat omia versioita, aprsd:stä on korjattu joitakin erityisesti mic-e:hen liittyviä virheitä ja darkice on käännetty tukemaan mp3 striimien tuotantoa. APRS i-gate:en tarvitaan vain aprsd, mutta ajatuksia on myös striimata samassa räkissä olevaa OH2RAY-ripiitteriä nettiin.

Compact Flash levyn aiheuttamat erikoisuudet

Compact Flash "levylle" ei saa olla jatkuvasti kirjoittamassa, vaan sitä pitää mieluiten käyttää pelkästään luettavana. Kirjoittaminen on ylipäätään hidasta ja lisäksi siinä tapahtuu "kulumista" jonka takia muutaman 100 tuhannen tai miljoonan kirjoituksen jälkeen bittiä ei enää saakaan nollattua.

Tähän on Linuxilla helpohko ratkaisu: mountataan koko filesysteemi "read-only (ro)" muodossa. Valitettavasti systeemissä kaivataan myös hieman kirjoitettavia tiedostoja/hakemistoja.

Hyväksymällä kirjoittamisen paikkaan jossa tieto ei säily sähkökatkon yli, saamme ratkaistua tuon ohjelmistolevyn read-only käyttötilan aiheuttaman ongelman. Tästä toki seuraa sellainen, ettei koneessa itsessään säily mitään logeja sähkökatkojen yli, mutta jos jotain on pakko kerätä jonnekin, sen voi lähettää syslog:lla verkon yli.

/etc/fstab

# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/dev/hdc1  /       ext2    defaults,ro                   0     1
proc       /proc   proc    defaults                      0     0
tmpfs      /tmp    tmpfs   defaults                      0     0
/dev/hda   /media/cdrom0   udf,iso9660 user,noauto       0     0

Yllä näkyvin järjestelyin systeemin /tmp hakemisto on kirjoitettavissa ja systeemin oletuksin sen maksimikooksi muodostuu tässä koneessa 64 megatavua. (Kyseessä on keskusmuistia kuluttava resurssi, joten sitä ei saa mennä tuhlaamaan!)

Muutamia hakemistoja symbolisiksi linkeiksi

Systeemilevyllä on tyypillisesti useampia paikkoja jonne kirjoitetaan, niiden hakemistoja ja/tai tiedostoja on muutettu käsin osoittamaan /tmp:hen:

/etc/network/run -> /tmp
/var/lib/dhcp3 -> /tmp
/var/lock -> /tmp
/var/log/aprsd -> /tmp  (säätyy kai myös konfiguraatiotiedostolla)
/var/run -> /tmp
/var/tmp -> /tmp
/var/ax25/mheard -> /tmp (ei säädy konfiguraatiolla)

/etc/motd.tail

Sisään kirjautuville säätäjille on pääbannerissa heti muistutus perusasioista:

/etc/motd.tail:

Kilo (rev.3) of  viestikallio.fi  -  alias   MOH-Pakettiperkele

In normal operation the "hdc1" disk (Compact Flash) is mounted
READ ONLY, and it can remounted for writing for the maintenance
by issuing command:

   mount -t ext2 -o remount,rw /dev/hdc1 /

AFTER THE MAINTENANCE IS DONE, REMOUNT AS __RO__ OR REBOOT !

/etc/syslog.conf

Tiedostosta /etc/syslog.conf kommentointiin kaikki pois!

/etc/init.d/aprsdigi

Tämä joko puuttui, tai piti muuten tehdä käsin:

#!/bin/sh
#
# Start aprsdigi daemon.

PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/sbin/aprsdigi
NAME=aprsdigi

test -f $DAEMON || exit 0

case "$1" in

start)
   echo -n "Starting APRSdigi: "
#looks like aprsdigi gives a shit about this start-stop-daemon thing
#so we do it like the old farts used to do:
   /usr/sbin/aprsdigi \
  --logfile /tmp/aprsdigi.log \
  --trace "WIDE" \
  --trace "TRACE" \
  --kill_dupes \
  --kill_loops \
  --keep 30 \
  --subst_mycall \
  --nomice_xlate \
  --nox1j4_xlate \
  --nobud "ax25:NOCALL" \
  --nobud "ax25:N0CALL" \
  --nobud "ax25:ZM0DEM-9" \
  --nobud "ax25:UA1ATI-0" \
  --tx \
  --idinterval 0 \
  --interface ax25:1:RELAY,WIDE,TRACE,KYMI,ITUUSI,OH2MOH,OH2Z,OH2,OH5 \
  --notx \
  --notxsame \
  --tag "MPRS from OH2RAY 434.775" \
  --interface ax25:4:RELAY,WIDE,TRACE \
  &
   echo "$NAME."
   ;;

stop)
   echo -n "Stopping APRSdigi: "
   start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/$NAME.pid /usr/sbin/aprsdigi
   echo "$NAME."
#aprsdigi doesn't seem to give a fuck about the start-stop-daemon shit, so 
#there komes the long-awaited shot in the head:
   pkill aprsdigi
   pkill kissattach
#(talk about getting fascinated about kicking a dead horse)
   ;;

force-reload|restart)
   $0 stop
   $0 start
   ;;

*)
   echo "Usage: /etc/init.d/$NAME {start|stop|restart}"
   exit 1
   ;;

esac

exit 0

Tämän lisäksi piti tehdä muutama symbolinen linkki, jotta ohjelmisto käynnistyy koneen käynnistyessä:

 # ln -s /etc/init.d/aprsdigi /etc/rc2.d/S20aprsdigi
 # ln -s /etc/init.d/aprsdigi /etc/rc3.d/S20aprsdigi

(sammuttamisesta ei tässä tapauksessa ole niin väliä, kyllä ne putoaa pois koneen bootatessa..)

/etc/init.d/aprsd

Tätä tiedostoa ei ole ollenkaan Debianin aprsd -jakelussa, vaan sen joutui kirjoittamaan itse:

#!/bin/sh
#
# Start aprsd daemon.

PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/sbin/aprsd
NAME=aprsd

test -f $DAEMON || exit 0

case "$1" in

start)
   update-inetd --disable ftp
   echo -n "Starting APRS gateway: "
   /sbin/modprobe mkiss
   # Viestikallio specials:
   /usr/sbin/kissattach /dev/ttyS0 1 10.0.0.10 
   /usr/sbin/kissattach /dev/ttyS1 2 10.0.0.10
   /usr/sbin/kissattach /dev/ttyS2 3 10.0.0.10
   /usr/sbin/kissattach /dev/ttyS3 4 10.0.0.10
   # The daemon itself
   start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON -- -d
   # and more viestikallio specials:
   /usr/sbin/mheardd
   echo "$NAME."
   ;;

stop)
   echo -n "Stopping APRS gateway: "
   start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/$NAME.pid --exec $DAEMON
   pkill kissattach
   pkill mheardd
   echo "$NAME."
   ;;

force-reload|restart)
   $0 stop
   $0 start
   ;;

*)
   echo "Usage: /etc/init.d/$NAME {start|stop|restart}"
   exit 1
   ;;

esac

exit 0

Tämän lisäksi piti tehdä muutama symbolinen linkki, jotta ohjelmisto käynnistyy koneen käynnistyessä:

 # ln -s /etc/init.d/aprsd /etc/rc2.d/S30aprsd
 # ln -s /etc/init.d/aprsd /etc/rc3.d/S30aprsd

(sammuttamisesta ei tässä tapauksessa ole niin väliä, kyllä ne putoaa pois koneen bootatessa..)

AX.25:n konfiguraatiot

# /etc/ax25/axports
#
# The format of this file is:
#
# name callsign speed paclen window description
#
1       OH2RDY          9600    255     2       144.800 MHz (1200 bps)
# reservations for further use
2       OH2RDY-1        9600    255     2       reserved for further use
3       OH2MOH          9600    255     2       test port with unique call
4       OH2RAY          9600    255     2       434.775 MHz (MPRS)

APRS:n konfiguraatiot

#aprsd 2.2.5 server configuration file
#
#This file is read ONCE on server startup.
#You must restart aprsd for changes to take effect.
#eg: /etc/rc.d/init.d/aprsd.init stop (then start)
#
#Lines starting with "#" are comments and are ignored
#Key words such as "mycall" and "maxusers" are NOT case sensitive.
#MyCall is the same as mycall.
#
#*** There is no error checking so be careful ******

#Servercall is the ax25 source call used in packets
#sent from the server to Internet users. (9 chars max)
#Note: Does not go out on the air.
#
servercall OH2RDY

#MyCall will be over written by the MYCALL string in INIT.TNC
#if "tncport" has been defined.
#
MyCall OH2RDY
MyLocation Viestikallio, Artjarvi, Finland KP30CR

#This email address will be sent in replies to ?IGATE? queries.
# Also, it will be on the status web pages on port 14501.
#
MyEmail oh2rdy@viestikallio.fi

#Set MaxUsers and MaxLoad to values that your Internet connection can support.
# Set MaxLoad in bytes/sec.   If either value is exceeded
# new users can't connect.
#
MaxUsers 10
MaxLoad 100000

#Define beacon text. The server will supply the ax25 path header.
#The first number after "NetBeacon" is the time interval in minutes.
#Comment out the line or set time interval to 0 to disable beacon.
#The rest of the line can be any aprs protocol conforming packet.
#
NetBeacon 10 !6044.06N/02612.79E# Viestikallio APRS digipeater and igate

#Define the TNC beacon. The TNC will supply the ax25 path header.
#It's optional and you may use the TNC BTEXT in the INIT.TNC file instead.
#
TncBeacon 19 !6044.06N/02612.79E#PHG5536/R,W,Tn,Wn,i OH2Z Artjarvi

#Send 2 extra message acks is addition to each received ack to TNC
#Range 0 to 9
#
ackrepeats 2

#Send extra acks at 5 second intervals
#Range 1 to 30 seconds
#
ackrepeattime 5

#Set history list items to expire in 35 minutes
#
expire 35

#Define the TNC serial port and baud rate.
#Note: This device must have write permissions
#If undefined all TNC related functions are disabled.
#Permissable baud rates are 1200,2400,4800,9600 and 19200.
#
tncport 1

#Define the path for transmitted packets
#This is only used when using Linux sockets, not the TNC.
#For the TNC, set this in INIT.TNC. Note the format is
#slightly different to the TNC command.
#
aprspath APD225 v TRACE2-2

# Allow Internet to RF message passing. (needed also for TNC beacons)
#
rf-allow yes

#Set filterNoGate "yes" to block RFONLY and NOGATE packets
#
filterNoGate yes

#Set history-allow to NO if you do not want users to get history dumps.
#
history-allow no

#TRACE causes the server to append its own callsign to the end
#of the AX25 path of every packet processed.  
#To conserver bandwidth this should only be
#done for short periods to track sources of problems.
#
Trace yes

#Set this to 'yes' if you want to log ALL PACKETS heard on RF to /home/aprsd2/rf.log
#If 'no' then only packets with your callsign will be logged.
#
logAllRF no

# Allow the insecure aprs passcodes to be used
# Note: "no" means all users need Linux user names and passwords
#       and aprsd must be run as root for that to work.
# This must be "yes" to allow two-way connection to an APRS hub or 
# server (if set to "no" the passcode won't be delivered and you'll 
#         get a receive-only connection)
aprsPass yes

#Set the minimum time between TNC transmit packets in milliseconds
#
TncPktSpacing 1500

# Disallow packets transmitted from our own TNC from 
# being igated back to the Internet after being digipeated.
#
igateMyCall no

#This determines if Mic-E packets are converted to classic APRS packets.
#Put 'no' unless you have a very good reason to do conversions. 
#This option must also be enabled in the SOURCE CODE. To turn it on
#you must edit "constant.h" and change CONVERT_MIC_E from FALSE to TRUE.
#then recompile aprsd. 
#
ConvertMicE no

#The PASS command.  The callsign supplied in MyCall and this
# passcode allow you to send data to distant servers.
# PASS can be computed from MYCALL with the aprspass program.
# Note: This example is invalid. Use your passcode.
# 
pass 9999999999

#-------------------------------
#Server connection definitions
#
#usage: <Server> <host name> < host port> <TYPE-DIR> <optional OmniPort filter command>
#
#The TYPE-DIR field sets the connecton type and data flow.
# TYPE is  either "SERVER" or "HUB"
#  SERVER connections attempts to maintain a connection to the designated host
#  HUB connections maintain a connection to only ONE hub and rotate to the next
#  if the connectin fails.
# DIR is either "RO" or "SR"  RO is Receive Only. SR is Send and Receive.
#Examples: HUB-RO   HUB-SR  SERVER-RO SERVER-SR
# If you select -SR to send data you must also supply a passcode
# using the "PASS" command. See above.
#
#These commands are NOT case sensitive.
# ** Defaults to Server-RO if TYPE-DIR not specified. **
#
#
#
server aprs.sral.fi 2345 server-sr

#---------------------------------
#
#Define server listen ports
#Read ports.html for more info.
#
rawtncport 0
localport 0
mainport 0
mainport-nh 0
linkport 0
msgport 0
udpport 0
sysopPort 0
httpport 0
ipwatchport 0
ipwatchport 0
omniport 0

#define trusted users of the UDP port.
#usage: trust <ip address> <subnet mask>
#
#trust 208.148.145.151
#trust 208.148.145.144 255.255.255.240

#Selected call signs which are always gated to RF
#if they are not seen locally. All packets from
#these are gated in real time. Do not use unless
#you really need real time data.  Consider posit2rf below.
#They are case sensitive! Use upper case. Up to 64 may be defined.
#As of version 2.1.5 the * wild card character is supported.
#All characters beyond the * are ignored.  
#ie: WA4* would match ALL call signs beginning with "WA4"
#
#gate2rf K4HG* N4NEQ* KA7PBI* WE7U* 
#gate2rf W7LUS-14
#gate2rf KG4IJB-5
#
gate2rf OH3BK-9 OH3BK-10

#Call signs of stations whose posits are gated
#to RF every 15 minutes.  Only posit packets are
#gated.  Posits are taken from the history list.
#They are case sensitive! Use upper case.
#
#posit2rf K4HG-8

#Define a list of message destination call signs or aliases 
#to gate to RF full time.  Note: the CQGA example 
#below is CQ GA (Georgia). Edit to suite your locale.
#Up to 64 of these may be defined. They are case sensitive.
#
msgdest2rf APRS PEPA VAPEPA OH2Z

#end

Säätöryhmä

Tähän säätösuoritukseen osallistuivat huhtikuussa 2007:

  • OH2MQK: Kone ja sen rautamuutokset, Linux-asennus
  • OH3BK: aprsd ja aprsdigi -softien asennus
  • OH2KKU ja OH3GNU: aprsd ja darkice softien bugifiksaus