Raspberry Pi Setup

A. Prepare Raspbian SD card

  1. Download Raspbian Stretch image (the version with recommended software): https://downloads.raspberrypi.org/raspbian_full_latest (1.9GB)
  2. Download and install Etcher: https://etcher.io/
  3. Run Etcher: select downloaded Raspbian zip file and drive with SD card (8, 16, or 32GB) then click on Flash! (takes a few minutes)

B. Start up Raspbian

  1. Insert SD card in Raspberry Pi.
  2. Connect monitor (or TV), keyboard, mouse, and router.
  3. Connect power adapter.
  4. Follow on-screen prompts.

C. Configure Raspbian

  1. System tab: set password and hostname, choose "wait for network at boot".
  2. Interfaces tab: enable SSH.
  3. sudo apt-get purge python-pygame # to get rid of ALSA underrun error messages

D. Enable static IP

  1. Determine desired local IP address for server (e.g., 192.168.1.101) and gateway address (e.g. 192.168.1.1).
  2. Edit /etc/dhcpcd.conf as follows (substituting actual addresses):
# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private

# static IP configuration:
interface eth0
static ip_address=192.168.1.101/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1 8.8.8.8

E. Install web server

sudo apt-get install lighttpd

sudo chown www-data:www-data /var/www
sudo chmod 775 /var/www
sudo usermod -a -G www-data pi
mkdir /var/www/logs

edit /etc/lighttpd/lighttpd.conf:

server.document-root = "/var/www"
server.port = 80 (or 8080)
server.dir-listing = "enable"

to start or stop service:

sudo /etc/init.d/lighttpd start
sudo /etc/init.d/lighttpd stop
sudo /etc/init.d/lighttpd restart

F. Install KOB server

  1. Copy KOBserver.py and pins.py to home directory.
  2. Copy info.html and associated image file(s) to /var/www.

G. Install feeds

  1. Load morsekob and pykob packages, feed applications, data files, run script, and system maintenance scripts.
  2. Add the following lines to the end of the startup file /etc/rc.local (before exit 0):
# Run KOB server and feeds
su pi -c 'cd ~; ~/run.sh'

H. Configure network

  1. Enable port forwarding on router for SSH (port 22, TCP), MorseKOB (port 7890, UDP) and HTTP (port 80, TCP).
  2. Add server name (mtc-xx.dyndns.org) to morsekob account at Dyn.
  3. Install and configure ddclient to automatically update Dyn database if server IP address changes:
sudo apt install ddclient

I. Create backups

  1. Use Win32 Disk Imager to save an image of the final configuration.
  2. Use Win32 Disk Imager to create a duplicate SD card.