Installation of DXSpider on a Raspberry Pi

android, raspberry, arduino - in connection with HamRadio

Moderatoren: Redaktion, FT-817

Benutzeravatar

Topic Author
admin
Administrator
Administrator
Beiträge: 23
Registriert: Do 31. Dez 2020, 00:09
Wohnort: Stuttgart
Call/Rufzeichen:
    Macintosh Safari
Kontaktdaten:

Installation of DXSpider on a Raspberry Pi

Beitrag von admin »

Note: Installation of DXSpider on a Raspberry Pi
1. change to root

Code: Alles auswählen

sudo su
2. Setup system to install DXSpider

Code: Alles auswählen

$ groupadd spider
$ useradd -m sysop -G spider
$ usermod -g spider sysop
- follow the instructions to set the full name and password
- if you are not prompted for a password enter the following and add a password:

Code: Alles auswählen

$ passwd sysop
$ adduser sysop sudo
Code:
$ hostname dx-pi
- any hostname will do

3. Begin downloading perl libraries.

Code: Alles auswählen

$ apt-get install libtimedate-perl libnet-telnet-perl libcurses-perl libdigest-sha-perl libdata-dumper-simple-perl
- Adds the necessary perl modules for DXSpider
4. Finalize the Sysop setup and restart the RPi.

Code: Alles auswählen

# cd ~sysop
# ln -s /home/sysop/spider /spider
# shutdown -r now
- after restart login as sysop
► Text zeigen
---
[External Link Removed for Guests] | HamRadio Operator
Benutzeravatar

Topic Author
admin
Administrator
Administrator
Beiträge: 23
Registriert: Do 31. Dez 2020, 00:09
Wohnort: Stuttgart
Call/Rufzeichen:
    Macintosh Safari
Kontaktdaten:

Re: Installation of DXSpider on a Raspberry Pi

Beitrag von admin »

at least you need a cron and a connect script to connect to the nodes automatically

for examble - your node parter is: dl1dl-3

become root

Code: Alles auswählen

sudo su
cron

Code: Alles auswählen

touch /spider/local_cmd/crontab
nano /spider/local_cmd/crontab
the cron like this:

Code: Alles auswählen

# Check every 10 minutes to see if xxxx is connected and if not
# start a connect job

0,5,10,20,30,40,50 * * * * start_connect('dl1dl') unless connected('dl1dl-3')
connect script

Code: Alles auswählen

touch /spider/connect/dl1dl-3
nano /spider/connect/dl1dl-3

Code: Alles auswählen

timeout 60
abort (Busy|Sorry|Fail)
# don't forget to chmod 4775 netrom_call!
connect telnet dl1dl.org 7300
'login' 'do7psl-3'
client dl1dl-3 telnet
Remember: you should ask your node partner for his node-Call (with SSID) and your node partner must register your node-Call (with SSID) in his configuration. otherwise your DXSpider does not
---
[External Link Removed for Guests] | HamRadio Operator
Benutzeravatar

Topic Author
admin
Administrator
Administrator
Beiträge: 23
Registriert: Do 31. Dez 2020, 00:09
Wohnort: Stuttgart
Call/Rufzeichen:
    Macintosh Safari
Kontaktdaten:

Re: Installation of DXSpider on a Raspberry Pi

Beitrag von admin »

Note: Cluster application is writing a lot of data taking a large disk space.
In order to remove regularly old data in /spider/data/log, /spider/data/debug and /spider/data/spots a symbolic link has been created toward /NULL device and a script in /etc/cron.daily will clean up old cluster data automatically.

Code: Alles auswählen

sudo su
create the scripts:

Code: Alles auswählen

touch /etc/cron.daily/spider
nano /etc/cron.daily/spider
with this content: (think on the actually year!)

Code: Alles auswählen

#!/bin/sh

# We need to delete old files.

spiderdir="/spider/data/spots/2015"

if [ -n "$spiderdir" ] && [ -d "$spiderdir" ]; then
    # only keep three days' depth of these
    find "$spiderdir" -type f -mtime +3 -exec rm {} \;
fi
spiderdir="/spider/data/debug/2015"

if [ -n "$spiderdir" ] && [ -d "$spiderdir" ]; then
    # only keep a couple of day's depth of these
    find "$spiderdir" -type f -mtime +2 -exec rm {} \;
fi
spiderdir="/spider/data/log/2015"

if [ -n "$spiderdir" ] && [ -d "$spiderdir" ]; then
    # only keep a week's depth of these
    find "$spiderdir" -type f -mtime +7 -exec rm {} \;

fi

Code: Alles auswählen

touch /etc/cron.weekly/clear_log.sh
nano /etc/cron.weekly/clear_log.sh

Code: Alles auswählen

#!/bin/sh

# We need to delete old files.

logdir="/var/log"

    rm $logdir/*.gz
clear_log.sh must be executable (chmod a+x clear_log.sh) in order to clean up old log data and recover free space on SD disk.

Code: Alles auswählen

chmod a+x /etc/cron.weekly/clear_log.sh
---
[External Link Removed for Guests] | HamRadio Operator
Benutzeravatar

Topic Author
admin
Administrator
Administrator
Beiträge: 23
Registriert: Do 31. Dez 2020, 00:09
Wohnort: Stuttgart
Call/Rufzeichen:
    Macintosh Safari
Kontaktdaten:

Re: Installation of DXSpider on a Raspberry Pi

Beitrag von admin »

Note: don´t forget to backup your partition
check your hard drives and removal drives
In this example sda is your USB drive i choose/root folder for store the file

For instance, to make an exact clone of the complete partition to a backup file, you could use:

Code: Alles auswählen

dd if=/dev/sda of=/root/partition.img
The file can be compressed after the copy, or during by piping the input to gzip or bzip2:

Code: Alles auswählen

dd if=/dev/sda | bzip2 -9f >/root/partition.img.bz2
-f --force
Force overwrite of output files. Normally, bzip2 will not overwrite existing output files. Also forces bzip2 to break hard links to files, which it otherwise wouldn't do.

bzip2 normally declines to decompress files which don't have the correct magic header bytes. If forced (-f), however, it will pass such files through unmodified. This is how GNU gzip behaves.

bzip2 compresses large files in blocks. The block size affects both the compression ratio achieved, and the amount of memory needed for ompression and decompression. The flags -1 through -9 specify the block size to be 100,000 bytes through 900,000 bytes (the default) respec-
tively. At decompression time, the block size used for compression is read from the header of the compressed file, and bunzip2 then allocates itself just enough memory to decompress the file. Since block sizes are stored in compressed files, it follows that the flags -1 to -9 are irrelevant to and so ignored during decompression.


Likewise, partitions can be restored from these backup copies:

Code: Alles auswählen

dd if=/root/partition.img of=/dev/sda
or

Code: Alles auswählen

bunzip2 -dc /root/partition.img.bz2 | dd of=/dev/sda
---
[External Link Removed for Guests] | HamRadio Operator
Benutzeravatar

Topic Author
admin
Administrator
Administrator
Beiträge: 23
Registriert: Do 31. Dez 2020, 00:09
Wohnort: Stuttgart
Call/Rufzeichen:
    Macintosh Safari
Kontaktdaten:

Re: Installation of DXSpider on a Raspberry Pi

Beitrag von admin »

to add a DX spider node it must be declared as a spider type.

This is done in file scripts/startup

In this example you want let the node dl1dl-3 connected to your DXSpider (do7psl-3)

Code: Alles auswählen

nano /spider/scripts/startup

Code: Alles auswählen

#
# startup script example
#
# set maximum no of spots allowed to 100
set/var $Spot::maxspots = 100
set/spider dl1dl-3
The other step is to connect your spider to another node

1) you want to check regularly that a node is connected by adding a dedicated command line in file:

Code: Alles auswählen

nano /spider/local_cmd/crontab
For example if want above node do7psl-3 exchange Dx spots with dl1dl-3

Code: Alles auswählen

# check every 10 minutes to see if f1oyp-8 is connected and if not
# start a connect job going
0,10,20,30,40,50 * * * * start_connect('dl1dl-3') unless connected('dl1dl-3'
)

2) you need a connect script

Code: Alles auswählen

touch /spider/connect/dl1dl-3
nano /spider/connect/dl1dl-3
connect script for each call present in crontab

Code: Alles auswählen

timeout 30
abort (Busy|Sorry|Fail)
connect telnet dl1dl.dyndns.org 7300
'login' 'do7psl-3'
client dl1dl-3 telnet
---
[External Link Removed for Guests] | HamRadio Operator
Benutzeravatar

Topic Author
admin
Administrator
Administrator
Beiträge: 23
Registriert: Do 31. Dez 2020, 00:09
Wohnort: Stuttgart
Call/Rufzeichen:
    Macintosh Safari
Kontaktdaten:

Re: Installation of DXSpider on a Raspberry Pi

Beitrag von admin »

Note: I recommend the raspberry pi 1x to reboot the day. It is strange - but does not go beyond a simple cronjob that. I have a script written that I will then run a cronjob

Code: Alles auswählen

sudo su
touch /home/pi/rboot.sh
nano /home/pi/rboot.sh
rboot.sh

Code: Alles auswählen

#!/bin/bash
#reboot the raspberry pi
sudo reboot
make it executable

Code: Alles auswählen

chmod a+x /home/pi/rboot.sh
edit the crontab

Code: Alles auswählen

crontab -e

Code: Alles auswählen

0 0 * * *  sh /home/pi/rboot.sh
0 0 * * * means daily reboot
---
[External Link Removed for Guests] | HamRadio Operator
Antworten