Dies ist eine alte Version des Dokuments!
Die Ericsson C9000 Paging Sender wurden in den 90er Jahren bis ca. 2002 an über 200 Standorten für Amateurfunk umgebaut. Nötig war neben einer Zusatzplatine, welche die nicht angeschlossene Endstufe simulierte, eine Schaltung, um die POSAG Signal zu erzeugen. Dazu gab es zunächst die RPC Karte (ein Europakarten großer Rechner mit diskreter CPU, RAM, ROM, EEPROM usw.) Der AATiS e.V. hat dann eine Variante herausgebracht, die auf einem mittlerweile nicht mehr verfügbaren Mikrocontroller basierte. Der Anschluss an das Verwaltungsnetz basierte auf der KISS-Schnittstelle und AX.25.
Weder die RPC-Karte noch die AATiS Platinen sind noch beschaffbar. Da wir noch unumgebaute Ericsson C9000 hatten, wurde kurzerhand die Hardware des RasPagers modifiziert, um mit dem C9000 kompatibel zu sein. Die Entwicklung stützt sich auf http://akafunk.faveve.uni-stuttgart.de/pocsag/.
Die Software UniPager erzeugt die encodierten POCSAG Signale und sendet sie über die Onboard UART eines Raspberry Pi an einen Mikrocontoller ATMega 8. Dieser arbeitet als FIFO und gibt die Daten im festen Takt von 1200 Baud zum C9000 mit der Bezeichnung MDL aus. Auch das zusätzliche Steuersignal MDE wird erzeugt.
Die Hardware ist fertig entwickelt, getestet und funktioniert. Es wurden eine Kleinserie von professionellen Platinen bestellt. Diese können zum Selbstkostenpreis erworben werden. Bitte dazu Ralf DH3WR kontaktieren.
Als Software empfehlen wir UniPager.
You need the following hardware to modifiy your C9000:
There is a RJ45 jack on the backplane of the C9000. It was formerly used to connect a landline telephone connection to the transmitter, so it could make a call if something bad had happend. There is a way to re-use this jack to bring an 100 MBit/s ethernet connection inside the C9000 without mechanical modification of the housing.
On the backside of the plugin-PCB you will find two multiport connectors. On the left side of the right connector, there is the telephone signal coming in passing through two inductors. As we want you use this pins for ethernet, remove the inductors or „park“ them on the PCB.
Then take a 30 cm long ethernet patch cable whose color you don't like any more and cut of one connector. Keep in mind to leave enough cable so you can connect easily the RasPi which will be hot glued in its bottom housing part to the plugin board afterwards. Solder the important pins on a ethernet cable for 100 MBit/s 1,2,3 and 6 to the PCB pads of the inductors and on the connector pins. The colors assignments are normally:
Pin Number | Color |
---|---|
1 | orange/white |
2 | orange |
3 | green/white |
6 | green/ |
This may differ from your patch cable.
As there are only pins 3 and 6 of the RJ45 jack routed on the backplane PCB (remember: former use was landline telephone), you have to connect the pins 1 and 2 by yourselves to the backplace-to-plugin-board connector. Unfortunately, you have to remove and disassemble the backplane completly in order to do so. So take a deep breath and remove all the SUB-D connector threaded sleeves on the backplane. Also remove the four screws holding the backplane and unplug the ribbon cable. Then remove the back plane shield from the backplane PCB.
Solder two wired as indicated on the following pictures:
The new cables have to connect from one side of the backplane PCB to its other. Reassemble everything and hope for the best. If you own a network cable tester, it may be a good idea to check the proper connection of the RJ45 jack to the connector of your patch cable, if you just plug the backplane and the plugin board together before you reassemble everything. The line 1,2,3 and 6 must be connected with no shortcut or mix up of the lines.
There is a connector on the RasPagerC9000 PCB with pin numbers 1 to 4. This connector is the one to connect the RasPagerC9000 to your C9000.
If you have an already modified C9000 with the RCP card formerly used, the 10 kOhm resistor will be already in place. Just add cables from the RasPagerC9000 PCB to the PCB of the personality module and fit it again. Be aware, that not all vias on the personality module are GND, although it might look like this.
The PCB can be ordered in three different versions:
Picture after final integration
There is an ATMega 8 on the PCB which has to be programmed before the RasPagerC9000 can work. If is is properly programmed, the green LED will be on if the device is powered on. Fortunately you do not need a separate programmer to get the firmware into the ATMega8. This also applies for possible updates of the firmware. The PCB is designed in a way that you can use the RasPi to program the ATMega8 directly by the RasPi. In order to do so, login to an SSH console on the RasPi and download the github-Repository with the firmware:
git clone https://github.com/rwth-afu/RasPagerC9000.git cd RasPagerC9000/software/atmega
There is a Makefile available that does all the needed steps for you. Read the programming README to know the commands. Just a hint:
sudo make install_dependencies make make fuses make program
After successful programming of the flash and the fuses, the green LED on the PCB should be on.
There are three LEDs on the RasPagerC9000. Their meaning is:
Color | OFF | ON |
---|---|---|
Green | No Power or ATMega8 not programmed | ATMega8 programmed and power on |
Yellow | No data transfer from RasPi to ATMega8 | Data is received by ATMega8 from RasPi |
Red | Transmitter is off | Transmitter is on-air |
As stated above, the only existing software for the RasPagerC9000 which is still under support is the UniPager. Have a look here.
A common pitfall on installing the UniPager is not to read the README of the github repository. As the communication of the RasPagerC9000 ATMega8 and the RasPi is done by the onboard UART interface, the config of the RasPi has to be altered in order to prevent the Linux kernel to send its console messages on the UART.
So first edit /boot/config.txt
sudo nano /boot/config.txt
and add
enable_uart=1
to the file. If you use a Rasberry Pi Version 3, also disable the bluetooth hardware, in order to free the UART interface claimed by the bluetooth chip. Add in a new line
dtoverlay=pi3-disable-bt
Second file to edit is /boot/cmdline.txt
. Delete the entry console=ttyAMA0,115200
from the line.
sudo nano /boot/cmdline.txt
After done so, reboot the RasPi. If the ATMega8 is already programmed, the yellow and red LED may not be on or blinking during the boot process. Otherwise, the RasPi is still sending its kernel output to the ATMega which does not make any sense and will prohibit the correct function of the setup.
The RasPagerC9000 PCB is already prepared for easy implementation of a temperature monitoring of the C9000. It is done by cheap DS18x20 OneWire temperature sensors. In order to activate the built-in support for OneWire temperature sensors in the Raspbian software, add the following line tho /boot/config.txt
sudo nano /boot/config.txt
dtoverlay=w1-gpio,gpiopin=18,pullup=on
The DQ-Pin of the OneWire pin assigment is routed to GPIO18
.
Reboot your RasPi to activate the changes.
Here a picture of the temperature sensor placed with hot glue next to the PA transistor
A second temperauture sensor the measure the temperature in the inside of the C9000 can be soldered directly on the PCB connector:
Munin is a easily extendable software package to graph values over time. So it is ideal to provide us with temperature-over-time figures based on the measurements of the sensors.
First install a web server on your RasPi to provide access to the figured over http. Respect this order of installing, so the munin installation process will automatically add the apache configuration files for apache.
sudo apt-get install apache2
Install munin and munin-node on your RasPi:
sudo apt-get install munin munin-node
The URL to all your munin graphs is http://YOURIPORDOMAIN/munin.
Munin consists of two parts:
munin
which gathers information from munin-nodes
which can be on other hosts, too. Here we just need the localhost on the RasPi to be fetched.munin-node
which is a daemon listing by default on port TCP/4949 for connections, invoking plugins to collect the data and provide it to the munin
core.
First adapt the config of the munin
:
sudo nano /etc/munin/munin.conf
By default, munin generates all graph images every 5 minuted, independent if someone is looking on them or not. As the write cycles of the SD card in your RasPi are limited, change this to „on-demand-rendering“ by commenting out #graph_strategy cron
with a #
in front and adding graph_strategy cgi
#graph_strategy cron graph_strategy cgi
Change the part where the localhost entry is given a a useful name of your C9000. The example here is c9000.db0sda.ampr.org
.
# a simple host tree [c9000.db0sda.ampr.org] address localhost use_node_name yes
Change the munin-node config:
sudo nano /etc/munin/munin-node.conf
Set the hostname to whatever you entered just before:
# Set this if the client doesn't report the correct hostname when # telnetting to localhost, port 4949 # host_name c9000.db0sda.ampr.org
Store your changes.
Plugins are activated or deactivated by placing a symlink in /etc/munin/plugins
to the plugin executable or script. The default installation of munin has a lot of overhead which we don't need. So let's clean up a bit:
cd /etc/munin/plugins ls -l sudo rm <whatever you don't need>
It's easy to monitor remote hardware with the nagios nrpe server. It's a local execution agent to run commands on the remote maschine and provide the gathered data back to a main nagios instance.
An example plugin for nagios to check 1Wire temperature sensors is given here:
#!/bin/bash # Adapted from check_nagios_latency # Prints usage information usage() { if [ -n "$1" ] ; then echo "Error: $1" 1>&2 fi echo "" echo "Usage: check_rasp_temp [-h?] -w warning -c critical" echo "" echo " -i 1Wire ID" echo " -w warning threshold" echo " -c critical threshold" echo " -h, -? this help message" echo "" exit 3 } # Checks if a given program is available and executable check_prog() { if [ -z "$PROG" ] ; then PROG='which $1' fi if [ -z "$PROG" ] ; then echo "TEMPERATURE UNKNOWN - cannot find $1" exit 3 fi PROG="" } # Main # check progs check_prog awk check_prog bc # process command line options while getopts "h?i:c:w:" opt; do case $opt in i ) ID=$OPTARG; ;; c ) CRITICAL=$OPTARG; ;; h | \? ) usage ; exit 3; ;; w ) WARNING=$OPTARG; ;; esac done shift $(($OPTIND - 1)) # Check options if [ -z "${WARNING}" ] ; then usage "No warning threshold specified" fi if [ -z "${CRITICAL}" ] ; then usage "No critical threshold specified" fi if [ -z "${ID}" ] ; then usage "No sensor ID specified" fi # Check number formats if ! echo $WARNING | grep -qE '^[0-9]+(\.[0-9]+)?$' ; then echo "TEMPERATURE UNKOWN - Wrong number: $WARNING" exit 3 fi if ! echo $CRITICAL | grep -qE '^[0-9]+(\.[0-9]+)?$' ; then echo "TEMPERATURE UNKOWN - Wrong number: $CRITICAL" exit 3 fi #if ! echo $ID | grep -qE '^[0-9][a-f]+(\.[0-9][a-f]+)?$' ; then # echo "TEMPERATURE UNKOWN - Wrong sensor ID: $ID" # exit 3 #fi # Perform the checks TEMP='tail -n 1 /sys/bus/w1/devices/10-$ID/w1_slave | awk -F" " '{ print $10 }' | awk -F"=" '{ print $2 }'' TEMP='bc <<< "scale = 2; $TEMP / 1000"' PERF="temp=${TEMP};${WARNING};${CRITICAL};;" COMPARISON='echo "if($TEMP>=$CRITICAL) 1 else 0;" | bc' if [ $COMPARISON -eq 1 ] ; then echo "TEMPERATURE CRITICAL: $TEMP | $PERF" exit 2 fi COMPARISON='echo "if($TEMP>=$WARNING) 1 else 0;" | bc' if [ $COMPARISON -eq 1 ] ; then echo "TEMPERATURE WARNING: $TEMP | $PERF" exit 1 fi echo "TEMPERATURE OK: $TEMP | $PERF" exit 0;
Install nagios nrpe server
and the package bc
:
sudo apt-get install nagios-nrpe-server bc
and paste the given file into /usr/lib/nagios/plugins/check_1wire
. Then make it executable
sudo chmod 755 /usr/lib/nagios/plugins/check_1wire sudo chown root:root /usr/lib/nagios/plugins/check_1wire
The configure the nrpe commands in /etc/nagios/nrpe.d/1wire_temp.cfg
:
command[check_PA_temp]=/usr/lib/nagios/plugins/check_1wire -i 000800c312bf -w 50 -c 60 command[check_C9000_temp]=/usr/lib/nagios/plugins/check_1wire -i 000800c34c66 -w 50 -c 60
The IDs of the sensors after the -i paramter have to be adapted to your lokal used sensors. Check them out with
ls -l /sys/bus/w1/devices/
Also change the 50
and 60
values to your desired warning and critcal temperature level thresholds.
Edit /etc/nagios/nrpe.cfg
to allow your nagios main instance to access the nrpe server.
Restart the nrpe server to activate the changes:
sudo service nagios-nrpe-server restart
On your main nagios instance you create a configuration file with the following content. You also have to have a define host
section for your host. Change host_name
accordingly.
# Define a service to check the PA Temperature define service{ use generic-service-rwthafu host_name c9000.db0sda.ampr.org service_description PA Temperature check_command check_nrpe_1arg!check_PA_temp } # Define a service to check the C9000 Temperature define service{ use generic-service-rwthafu host_name c9000.db0sda.ampr.org service_description C9000 Temperature check_command check_nrpe_1arg!check_C9000_temp }
The result can look like this: