Raspberry Pi Setup
A. Prepare Raspbian SD card
A. Prepare Raspbian SD card
- Download Raspbian Stretch image (the version with recommended software): https://downloads.raspberrypi.org/raspbian_full_latest (1.9GB)
- Download and install Etcher: https://etcher.io/
- 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
B. Start up Raspbian
- Insert SD card in Raspberry Pi.
- Connect monitor (or TV), keyboard, mouse, and router.
- Connect power adapter.
- Follow on-screen prompts.
C. Configure Raspbian
C. Configure Raspbian
- System tab: set password and hostname, choose "wait for network at boot".
- Interfaces tab: enable SSH.
- sudo apt-get purge python-pygame # to get rid of ALSA underrun error messages
D. Enable static IP
D. Enable static IP
- Determine desired local IP address for server (e.g., 192.168.1.101) and gateway address (e.g. 192.168.1.1).
- 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
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
F. Install KOB server
- Copy KOBserver.py and pins.py to home directory.
- Copy info.html and associated image file(s) to /var/www.
G. Install feeds
G. Install feeds
- Load morsekob and pykob packages, feed applications, data files, run script, and system maintenance scripts.
- 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
H. Configure network
- Enable port forwarding on router for SSH (port 22, TCP), MorseKOB (port 7890, UDP) and HTTP (port 80, TCP).
- Add server name (mtc-xx.dyndns.org) to morsekob account at Dyn.
- Install and configure ddclient to automatically update Dyn database if server IP address changes:
sudo apt install ddclient
I. Create backups
I. Create backups
- Use Win32 Disk Imager to save an image of the final configuration.
- Use Win32 Disk Imager to create a duplicate SD card.