tarpn_logo
 home    builders  


Initialize Raspberry PI for TARPN Node

This document is the initialization procedure for a Raspberry PI and TNCs of a couple of types. After going through the steps outlined here, and with the help of the scripts referenced by this document, the reader can produce a packet radio network switch (node) to be used in a TARPN. tnc_pi_ribbon_rpi_i6_07188x400
The node will have user access features permitting an operator to converse with other stations on the TARPN. Ports on the node are created by attaching TNCs (Terminal Node Controller) to the Raspberry PI. Supported hardware includes USB/serial adapter connected KISS TNCs, and TNC-PI units. Additionally, software running on the Raspberry PI may access the node, and vice versa, permitting network services and tools to be launched.

A linked document walks the operator through setting up the TNC-PI units which connect to the Raspberry PI using Insulation Displacement Ribbon cable connectors between TNC-PIs and the expansion header on the Raspberry PI. Serial-port connected TNCs must be separately initialized and that is not covered by this document.

The G8BPQ code configures the operating parameters of the serial port TNCs automatically. All the operator must do is set the baud rate of the TNCs (possibly abaud command?) to 19200 baud, and then set them into KISS interface mode as per the instructions from the manufacturer. (possible intfc or interface or kiss command?)


Unless you are sure you know how to work around some detail in this document, please follow it in-order else things can get very confusing.

The document assumes you have a desktop computer and know how to use command line tools like you might in MSDOS. Linux experience is a plus but I’m trying to make the document clear enough that any other computer user has a chance at going through this. I expect that if you have Linux experience, you can work around the MSWindows-centric and Mac-centric descriptions.

This document contains information sourced from G8BPQ, from Coastal Chipworks, and from AG6QO, KF4LLF. The scripts were written by KA2DEW with help from many others.


Summary of the procedures to configure your PI Linux G8BPQ TARPN node:

NOTE: Raspberry PI will not boot without an SDcard containing a bootable image.

Notes while reading the document

Sometimes I substitute Ø in place of 0 (zero). I did this because in some fonts a O and a 0 look the same. Sometimes I did not make the substitution because the intent to use zero is obvious. One case which is common in these instructions is the device “ttyAMA0”. This is AMAzero. I will write it as ttyAMAØ. If you copy and paste my instructions, you will see that Ø does not mean anything to the Raspberry PI. Please be careful.

Getting Started

BUY a Raspberry PI, TNCs, cables, power supplies

See the Node Shopping List

Format the SDCARD

Your SDCARD needs to be formatted for the linux file system. The format that comes on the card is not correct.

MSWindows users
Download SD Association Formatter for MSWindows
Install and run the tool on your workstation.
Click on the OPTIONS button and set format type to QUICK and Format Size Adjustment to OFF.
Check that the drive letter for the SD card you inserted matches the one selected by the Tool
Click the Format button
The name is not important. It gets changed in a later process anyway.

Mac Users
Download SD Association Formatter for Mac
Run SDFormatter
Quick Format is ok. The name is not important. It gets changed as part of the OS install process anyway.

Get NOOBS-lite

On your MSWIndows or MacOSX, use a web browser and go to https://www.raspberrypi.org/downloads/noobs/
Download NOOBS-LITE network install only zip file, expand it, and copy the files to the SDcard. You’ll want to open the folder that is NOOBS. Open the folder which is the card. Select and drag these files as seen below (all of the files and folders in the NOOBS folder) onto the card.
Now eject the card. On the MAC this is done by going to the left of the finder window, finding the card (possibly named RECOVER?) and clicking the eject icon. On MSWindows this means finding the icon in the tool bar for STOP device and stop the removable media device.
image_of_NOOBS_files

Boot the PI

Make sure power is removed from the Raspberry PI.
Attach a USB keyboard, USB mouse, monitor with HDMI connector (can be DVI monitor with adapter), Ethernet with Internet connectivity and DHCP (if the PI is plugged into a consumer router or cable modem or DSL router, it should just work)
The header connector must be clear. No TNCs attached. No ribbon cable. No shields of any kind.
Install the sd-memory card into the PI.
With all the needed accessories attached, and no serial cables, TNCs, or other options, NOW plug the power supply into the PI. The LEDs near the USB connector should light up. The HDMI monitor should light up.

On the PI

The HDMI monitor will light up with a graphics window and a dialog that says resizing partition. Then it will put up the NOOBS dialog. This dialog is used to select an operating system to be installed on the SD card.
Checkbox the Raspbian with PIXEL, then click Install.
You can do this operation with a keyboard by using the space bar to checkbox Raspbian with PIXEL. Then hit letter i to install.
Warning, this overwrites data on the card. Click yes/install/ok or whatever. This will now download about 2GB of data. That could take a while.
NOOBS_i4_0403
After complete, a dialog appears that says OS(es) Installed Successfully OK?
Click OK.
Before you clicked ok you might have seen a widget on the bottom of the screen that says the keyboard is set to something other than US. You can’t reach that with the mouse anyway so just forget it. Now a text scrolling window appears. This is what a Unix looks like when it is booting.
NOOBS_i4_0404

PI booted -- get IP address

The Raspberry PI will boot and will show you a graphical desktop display. In the upper left corner of the display is a set of icons that look like this:
pi_desktop_icons_i6_07242
Click once on the black icon, someplace in the upper left - it used to be the 4th icon from the left. That is the icon for the Terminal program.

The screen will change to show a new window which is the text display and entry area for Linux.
pi_desktop_with_terminal_i6_07242x5inches
The Terminal window allows you to type commands to Linux and to then display results. You can have more than one Terminal window open at a time. There are features of the window which you will eventually want to explore including changing the size of the text and adjusting the depth of the scroll buffer. The scroll buffer potentially lets you see and/or copy any or all of the text ever displayed on the Terminal since you opened the Terminal window. This is very handy during a long communications or debugging session.

For now we have a two simple jobs to do. We need to enable remote SSH access, and we want to know what the TCP/IP address of the Raspberry is. Finding the TCP/IP address could be done by inspecting your router or running a network sniffer program, but you need to enable SSH access anyway so we should probably do both from the Raspberry PI's desktop GUI.

Read out TCP/IP address

Click in the black area of the terminal window and type this command:
ifconfig

After you did the ifconfig command, the screen will show you results. Depending on the vintage of your Raspberry PI you may have to scroll the screen up to see the eth0 information. Scroll by clicking in the black field but over to the right side. The scroll widget is supposed to be obvious and there may be arrows to click in the upper right or upper left of the black field.

eth0 Link encap:Ethernet  HWaddr b8:27:eb:56:c4:32
     inet addr:10.0.0.2  Bcast:10.0.0.255  Mask:255.255.255.0 ⇐ Note:"inet addr"
     UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
     RX packets:2639 errors:0 dropped:0 overruns:0 frame:0
     TX packets:730 errors:0 dropped:0 overruns:0 carrier:0
     collisions:0 txqueuelen:1000
     RX bytes:364991 (356.4 KiB)  TX bytes:81274 (79.3 KiB)

lo   Link encap:Local Loopback
     inet addr:127.0.0.1  Mask:255.0.0.0
     UP LOOPBACK RUNNING  MTU:65536  Metric:1
     RX packets:0 errors:0 dropped:0 overruns:0 frame:0
     TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
     collisions:0 txqueuelen:0
     RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
We want to know the inet addr for the eth0 device. In the above screen the answer is 10.0.0.2. Yours will be different. Use that address to connect to the PI from your desktop computer. We'll call that number PI-INET-ADDR

Enable SSH access using RASPI-CONFIG

There is a GUI interface called raspi-config that we will run to enable remote PC access to your Raspberry PI.
Click in the black area of the terminal window and type this command:
sudo raspi-config and then hit ‹ENTER›, or return if you are on a Macintosh.

A window will open on the screen which has ‹Select› and ‹Finish› on the bottom and looks something like this: jessie_raspi_config_top_screen Use the cursor keys on the keyboard and move the select line (red in this image) down to Interface Options. Then hit ‹ENTER›, or return on your keyboard.

From now on, by the way, if I tell you to type a command, you can automatically assume that I mean for you to hit ‹ENTER›, or return after you are done typing.
Now use the cursor keys to select the line starting with SSH and again hit ‹ENTER›, or return.
Tell the computer you want SSH to be enabled, Yes.
The config program will accept your answer and then go back to the ‹Select› and ‹Finish› screen.
Now select ‹Finish›. If this offers to restart or reset the Raspberry PI, tell it yes.

Connect to your PI from your Workstation

From your MSWindows, get and launch PUTTY, or MacOS computer launch Terminal. (if Linux or other Unix then you probably know better than I how to get a terminal).
Make an SSH connection to pi@PI-INET-ADDR
ssh pi@10.0.0.2

Note that pi is your user name. The password to the pi account on the Raspberry PI, defaults to raspberry.

Use the Ethernet you discovered above, 10.0.0.2 is just an example. See previous subsection.

On PUTTY or Terminal, there may be question asked about connecting to a foreign server. Depending on your operating system you have different messages which will appear and different solutions to it. It's not hard. Don't be scared.
On the Mac, using Terminal, you may have to type
rm ~/.ssh/known_hosts
You can actually copy that text right from the web page, then paste it and hit return.
What that does is remove any previous knowledge the Mac had about any SSH host. For each SSH host you need to connect to, the computer will once ask you if you intended to connect to a new host. You just have to say Yes.

On PUTTY the question asked about connecting to this new host will be more of a pop-up dialog window. You just have to affirmatively tell it that yes you do intend to connect to this new host.

Now you have two ways to do text commands to the PI, using Terminal on the PI, or SSH from your workstation (using PUTTY or Terminal). Start one or the other and get a command prompt.

When prompted, enter the password
raspberry
Note that as you type the password the display may hide the text which looks like you didn't type anything at all. That's a feature!

Hopefully you now have an SSH connection to the Raspberry PI and you can do the Linux commands from your PC or Macintosh. This lets you log your traffic. If possible, try to set up PUTTY or Terminal to have a large scroll buffer.

You will see the command prompt for the Raspberry PI’s Linux shell.

pi@raspberrypi ~ $ 
The prompt contains some useful information. The username you are logged into the PI with is “pi”. The hostname of the device is “raspberrypi”. Later, on your system, it will be whatever you set the hostname to. The ~ symbol means that the directory/folder you are in is the home directory for the user who logged in, i.e. “pi”. The $ is gratuitous.

The PUTTY/Terminal session you have just started will be used to run the TARPN install scripts. During the install the Raspbery PI will have to reboot twice. Each time you will need to reconnect to the Raspberry PI, again with your choice of terminal program. You will need to connect with a terminal to adjust and configure your TARPN system.

More configurations using RASPI-CONFIG

The next process we need to complete is finish setting up the Linux and Raspberry PI features that cannot be configured by the automatic install scripts. As we did before, we will use the configuration tool: raspi-config.

raspi-config may be run from the Raspberry PI in its terminal program, or from PUTTY or MacOS's Terminal.

At the Linux command prompt type
sudo raspi-config

A Text User Interface (TUI) screen pops up in the terminal window

jessie_raspi_config_top_screen

Set user password

Use the keyboard cursor keys down to option Change User Password
jessie_raspi_config_top_screen_2
and then hit return.
This new screen pops up. Hit return again.
raspi_config_password
The screen will drop back to just a text terminal for the next few operations including showing where you typed the raspi-config command.
enter_password
You are being prompted to type your new password.
Change the password to one that you can afford to tell to other people. I use the same password, pika2dew, for all of the Raspberry PIs that come my way. These computers are not connectable from the Internet so having a password only keeps local people from messing things up on purpose.
The config program will ask you for the same password twice and then go to a Password changed successfully screen, and finally back to the home screen.

Set time-zone

Use the keyboard cursor keys down to option Localization Options and then hit return.
Select Change Timezone and then hit return.
raspi_config_internationalization_options
Go through the menus making appropriate choices for your packet node's location. Note that the screen will temporarily go back to the text display as if raspi-config had crashed. It hasn't.
Now back to the main raspi-config menu.

Change host-name

Use selection Advanced Options. raspi_config_main_screen_8 The menu will change to give you 10 more options.
Select the 2nd option Hostname and hit return. raspi_config_advanced_a2
Change the hostname to match your node-name with "-packet" tacked on the end
We're setting our node sites to our first name or last name, whichever fits and is more likely to be unique and recognized. If you are all alone in a small town, you might use your town name but as soon as you get your neighbor to join up, you have a problem. The hostname and the nodename can both be changed later. The reason to set your hostname to match your nodename is in case you get together with another packeteer and they have both their node and yours on the same Ethernet for configuration purposes. You might have two nodes on your workbench at the same time.
The reason to add "-packet" is that now you can find your node in the list of devices attached to your home router. Otherwise you could end up with a laptop and your node with the same hostname.
It is handy to have the prompts on Linux include the node-name.
raspi_config_i4_0410
Hit return and then type in your hostname.
Now back to the main raspi-config menu.

Force audio out through the 3.5mm jack

Go back into the Advanced Options menu. Select Audio     Force audio out through the HDMI or 3.5mm jack and hit return. This option lets you plug computer speakers into the Raspberry PI.
Answer, Force 3.5mm ('headphone') jack, and then OK

Turn on I2C support

Go into the Interfacing Options menu and then I2C     Enable/Disable automatic loading of I2C kernel module and hit return. This option turns on ARM(cpu) I2C support for the operating system.
Select Yes and OK where appropriate. We need I2C support to talk to the TNC-PIs.

Turn on VNC support

Go into the Interfacing Options menu and then VNC     Enable/Disable graphical remote access to your Pi using RealVNC and hit return. This option turns on ARM(cpu) I2C support for the operating system.
Select Yes and OK where appropriate. We need I2C support to talk to the TNC-PIs.

Turn off Serial ports

Go back into the Interfacing Options menu. Select Serial     Enable/Disable shell and kernel messages on the serial connection and hit return. This option lets us use the serial port for talking to uninitialized TNC-PIs.
Answer, yes, disable console use of the serial port

Finish with raspi-config

Use the keyboard to move to Right Arrow over to Finish.
jessie_raspi_config_top_screen_finish
hit RETURN.
Since you changed a few things that can only be set up at boot-time, it will ask you if you want to reboot now. Hit return for YES.
This saves your changes.

The Raspberry PI will again boot into the GUI logged in as user pi.
You could have, in the raspi-config screens, chosen that you would always be prompted for a password at boot. You can launch raspi-config any time you want the same way we did before. Your prior changes are saved.


Running the TARPN install scripts

After the Raspberry PI boots, open a Terminal or PUTTY session again. Copy these six lines from this web page and paste them into your PUTTY or Terminal session. Note, to paste into PUTTY, just do a right-click of the mouse. To paste into Terminal (on a Mac), click into the Terminal window, then use Command-V.
rm -f tarpn_start*
sudo chmod u+s /bin/ping
wget http://tarpn.net/2015oct/tarpn_start1.sh
chmod +x tarpn_start1.sh
./tarpn_start1.sh
ls
The script will run for about an hour (depending on your connection speed) and will stop three times for your input.
The first stop will require you to type letter q
The second stop will require you to hit the RETURN key.
The third stop will require you to type letter y.
The Raspberry PI will reboot.
Below is the dialog seen at the end of the run.
Note that a couple of error messages are expected along the way.
It would be ideal if you could retain and save the entire text window during this process for later debugging in case the node doesn't come up at the end.
#####



#####
#####
##### Get Change Keyboard to US version
#####
#####


#####
#####
##### Remove config for having tty-async-serial as console port from /boot/cmdline.txt
#####
#####


#####
#####
##### in /etc/modprobe.d/raspi-blacklist.conf, remove blacklisting of i2c
#####
#####

#####
#####
##### in /etc/modules, add i2c device
#####
#####
Hit http://mirrordirector.raspbian.org jessie InRelease
Hit http://archive.raspberrypi.org jessie InRelease
Hit http://mirrordirector.raspbian.org jessie/main armhf Packages
Hit http://archive.raspberrypi.org jessie/main armhf Packages
Hit http://mirrordirector.raspbian.org jessie/contrib armhf Packages
Hit http://archive.raspberrypi.org jessie/ui armhf Packages
Hit http://mirrordirector.raspbian.org jessie/non-free armhf Packages
Hit http://mirrordirector.raspbian.org jessie/rpi armhf Packages
Ign http://archive.raspberrypi.org jessie/main Translation-en_GB
Ign http://archive.raspberrypi.org jessie/main Translation-en
Ign http://archive.raspberrypi.org jessie/ui Translation-en_GB
Ign http://archive.raspberrypi.org jessie/ui Translation-en
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en
Ign http://mirrordirector.raspbian.org jessie/main Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/main Translation-en
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
 *** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
 *** Performing self-update
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 12022  100 12022    0     0  65353      0 --:--:-- --:--:-- --:--:-- 66419
 *** Relaunching after update
 *** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
 *** We're running for the first time
 *** Backing up files (this will take a few minutes)
 *** Backing up firmware
 *** Backing up modules 4.4.21-v7+
This update bumps to rpi-4.4.y linux tree
Be aware there could be compatibility issues with some drivers
Discussion here:
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=144087
##############################################################
 *** Downloading specific firmware revision (this will take a few minutes)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   168    0   168    0     0    821      0 --:--:-- --:--:-- --:--:--   823
100 51.8M  100 51.8M    0     0  3026k      0  0:00:17  0:00:17 --:--:-- 1439k
 *** Updating firmware
 *** Updating kernel modules
 *** depmod 4.4.31-v7+
 *** depmod 4.4.31+
 *** Updating VideoCore libraries
 *** Using HardFP libraries
 *** Updating SDK
 *** Running ldconfig
 *** Storing current firmware revision
 *** Deleting downloaded files
 *** Syncing changes to disk
 *** If no errors appeared, your firmware was successfully updated to df920175ee832a3cf4367e9ba3bddd919bed96d2
 *** A reboot is needed to activate the new firmware


######
######
######
######
######      Raspberry PI will now reboot.  All is going well so far.
######      When we come back up, reconnect and do the command   tarpn
######      as per the TARPN node bringup instructions document
######
######
Connection to 192.168.0.18 closed by remote host.
Connection to 192.168.0.18 closed.
Octopussy:~ tadd$

When the PI has booted, connect to it again with SSH.
Note that most commands you will type to the Raspberry PI will be in lower case.
Type this command:

tarpn‹ENTER›
The tarpn command will tell the PI to finish configuration. NOTE! this part of the install will add a new service to the Linux OS which will look for your installation to be complete. Your installation is NOT complete so that service will generate a logged error message saying that NODE.INI is not found. We'll fix that in a later step.

When you have typed tarpn and return the Raspberry PI will output the text shown below and then will reboot. Continue below.


Octopussy:~ tadd$ ssh pi@10.0.0.2
pi@10.0.0.2's password:
Linux tadd 3.10.25+ #622 PREEMPT Fri Jan 3 18:41:00 GMT 2014 armv6l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Apr  7 03:00:50 2014 from 10.0.0.179
pi@tadd ~ $ tarpn
#### =TARPN vJ010 =
##### TARPN startup incomplete.  I will run TARPN_START2 which will
##### complete the installation.   This will also reboot again.
######
######
###### =TARPN START 2 JESSIE-102
######
######
######
#####
#####
##### Add PI as a user to the i2c group
#####
#####
The user `pi' is already a member of `i2c'.
#####
#####
##### Set up minicom port linkage so minicom can find host port
#####
#####

##### Turn up the volume to max.  You can adjust amixer cset numid=1 -- 100%
numid=1,iface=MIXER,name='PCM Playback Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=-10239,max=400,step=0
  : values=400
  | dBscale-min=-102.39dB,step=0.01dB,mute=1

######
######
######
######
######  Adding service for tarpn background operations

##### TARPN SERVICE file installed
Created symlink from /etc/systemd/system/multi-user.target.wants/tarpn.service to /etc/systemd/system/tarpn.service.
##### starting TARPN service  pause 10 seconds
● tarpn.service - tarpn background service--see /usr/local/etc/tarpn.log
   Loaded: loaded (/etc/systemd/system/tarpn.service; enabled)
   Active: active (running) since Sun 2015-10-18 11:50:37 EDT; 10s ago
 Main PID: 4936 (tarpn_backgroun)
   CGroup: /system.slice/tarpn.service
           ├─4936 /bin/bash /usr/local/sbin/tarpn_background.sh
           └─4941 sleep 180

Oct 18 11:50:37 wilson-packet systemd[1]: Started tarpn background service--see /usr/local/etc/tarpn.log.
###########################################################

tarpn_background j101 start:Sun 18 Oct 11:50:37 EDT 2015
 11:50:37 up 15 min,  3 users,  load average: 0.08, 0.04, 0.05
source URL is http://tarpn.net/2015oct
ERROR0: NODE INIT file not found.
ERROR0: Aborting in 180 seconds
Sun 18 Oct 11:50:37 EDT 2015
###########################################################
#####
##### Done.  After reboot you will be ready to test and/or
##### configure your TNC-PI boards and to start BPQ node.
#####
#####
######
######
######
######
######      Raspberry PI will now reboot.  All is going well so far.
######      When we come back up, reconnect and try the  tarpn  command
######      as per the   Initialize Raspberry PI for TARPN Node    web page
######
######
Connection to 10.0.0.6 closed by remote host.
When that completes, you are ready to set-up your TNCs.

TNC Setup

The TARPN configurations are prepared to deal with two different TNC connection busses and 12 total TNCs at once. Six must be USB and six must be I2C. USB can be used to connect to a KISS TNC that has a USB port, or to a USB/serial converter which ties into a serial TNC, like the Kantronics KPC-3.

I2C TNCs

As far as I know there is only one kind of I2C TNC available that is compatible with the Raspberry PI. This device is called the TNC-PI. I2C is a mastered multi-station bus where one station (actually there can be more than one but that isn’t important right now) where one station is the master, and the rest of the stations have addresses which are 7-bits long. (actually there are rare implementations where a 10-bit address is used) The address range can be from 1 to 127, I think. The G8BPQ code and TNC-PI only support addresses 3 through 119 decimal. I2C addresses are often refered to by their base 16 hexidecimal value which in this case is 03 through 77. See FAQ:Hexadecimal
If properly configured, the Raspberry PI will automatically detect all of the connected I2C devices at boot-up time. If there are address conflicts because more than one device is given the same address, it is possible that the master, the Raspberry PI, will recognize the failure, but whether it does or not, the two devices are unlikely to be useable. Please be careful to not connect multiple devices to the PI having the same I2C address.

The I2C TNCs are operated by the G8BPQ node software but some of the configuration options must be set by you on the TNC itself using the provided commands.

If you are using TNC-PI TNCs, click here for the TNC-PI Setup and Configuration

Come back here after you have configured your TNC-PIs to have unique, and known, I2C addresses and after you set the TNC-PI details.

USB/serial TNCs

The way the system works now, the first four USB/serial devices, ports 7, 8, 9, and 10, will assume that the device is a USB/serial adapter. They will have sequential ttyUSB addresses 0 through 3 and will assume 1200 baud radio behavior. You will be prompted only for serial baud rate, TXDELAY and neighbor callsign. Ports 11 and 12 will prompt you for the /dev name and will also prompt for serial baud rate, FRACK, TXDELAY, and neighbor connection.

All TNCs connected to the Raspberry PI under the TARPN configurations must be already set to KISS mode before the G8BPQ node program is launched. You can use Minicom or Picocom to test the TNCs in some other mode but you must convert them to KISS mode before starting the G8BPQ node if the ports are enabled in the tarpn configuration. If they are not, then the G8BPQ node software will complain and may be difficult. The assignment of USB/serial devices to G8BPQ ports is done sequentially starting with port 7. If a USB device is removed from the system, and then the system is restarted, the port numbers will be re-assigned, again starting with port 7. This can cause problems with the neighbor assignments in the G8BPQ node software. Please be careful to not let this happen by accident after the node is established.


Running the tarpn command

A more comprehensive document about the tarpn command is here.

The next setup operation you need to do is to tell the G8BPQ node software what your system's configuration is.
There are some details we need to set to know before we go any further. These details are going to be placed in a file called node.ini located in the home/pi directory on the Raspberry PI. I wrote a tool to put them there. This section of the document explains how to use that tool.
Run this TARPN command:
tarpn config
You will be prompted for some of the details specific to your installation. This command may be run over and over to polish your results. If you use Control-C to quickly exit this command, none of your changes will be saved.

Here is a brief on each element you will be prompted for:

Nodecall
Each G8BPQ node is identified by a callsign with ssid extention, and a node name. The callsign must be the person or one of the people legally responsible for the proper operation of the node. The ssid extention is a number which allows there to be more than one node with the same callsign. For instance: KA2DEW-2 is different from KA2DEW-3. The -2 or -3 is the ssid extention. The allowable values are -0 through -15 but -0 and -15 are usually reserved. So set a nodecall as your callsign with an ssid of -1 or up to 14. If you have never used a packet SSID, then chose -2. Callsign should be uppercase and numbers and a dash and a one or two digit number. As of this writing, every node in the lone North Carolina TARPN uses -2 to identify the node's callsign.

Nodename
Every G8BPQ node has a 6 character or shorter node-name. The North Carolina TARPN is using first or last names as the nodename. Initially we started with town names and then regions of towns but once you have a DURHAM node, what does the 2nd node, just down the street, get named? So we went with first names. People with especially common first names may want to try last names instead.
The nodename should be specified as all lower case. No spaces or punctuation characters.

Madenheadlocator
Also called Grid Square. This is available from qrz.com under the Detail tab for any callsign search.
It is also available here: http://qthlocator.free.fr/index.php Just navigate with the zoom-in zoom-out and click-and-drag until you find your street and house. Then click on the map.
A madenhead locator will be a six character item, 2 upper chars, 2 numbers, 2 lower chars.
Mine is FM05pv
Make sure you use the same upper case and lower case used in the result.

Infomessage1 thru Infomessage8
This multi-line message is given to the connected user if they type INFO. Because of the limitations of my script, I can’t deal with real multiline messages. Instead, I provide 8 different configuration elements for your INFO message. Use upper or lower case letters, any punctuation except double-quote.
The INFO message should say something like this:

infomessage1: Linda's node at the north end of Spongotown.
infomessage2: Yagi pointing at FRED and quad-band-vertical for the other 4 ports.
infomessage3: port1 Icom IC1271A   1292.1 to FRED
infomessage4: port2 Icom IC228     145.53 to DEXTER
infomessage5: port3 Kenwood TM3530 223.42 to SIMON2
infomessage6: port4 GE Master II   50.120 to BILLM
infomessage7: port5 Icom IC4AT used to go to GERRY -- anybody want to link to me?
infomessage8: Linda is usually on the CROWD node at LVLTWR -- feel free to ring at PIUSER as well. 
Any unused infomessage lines can be left with a period or with not_set

Ctext
This text gets sent when the user connects. Say something short here. Make this one line.

Local-op-callsign
This is the callsign of the station who runs the node, or who is at the local console. This is used as the log-in ID for telnet connects, and also for setting up the HOST mode feature which lets node users connect to the local operator. This should be lower case. If there is not to be a local operator, this can be set to none. If this is none the local user commands host and tx will also be disabled. If desired, host mode can be re-enabled at any time by re-running tarpn config, changing the value of this figure, save, then restart the node.

port# enable/disable
There are six port-enables for i2c (TNC-PI units) four port enables for USB/serial connected TNCs and two port enables for special USB TNCs. These last two could be used for USB/serial TNCs as well. They are named port01 through port06 for TNC-PI and port07 through port10 for USB/serial connected TNCs, and ports 11 through 12 for the special USB TNCs. Each port should have either ENABLE or DISABLE. If the port is set to ENABLE, you must specify correct answers for additional details related to that port.
Each port represents a TNC. If you only have one TNC-PI, then set port 1 to ENABLE. If you have three, then set ports 1 through 3 to ENABLE. Set the remainder to DISABLE. The same goes for USB TNCs. Use ports 7 and on for your USB connected TNCs. If you unplug one of the TNCs and restart, you will have to reassociate the ports with TNCs. The port order is created by the Raspberry PI the first time it sees your particular USB situation. Don’t enable ports for which you have no TNCs. These settings can be changed later in this process, or any time you change what your TNC configuration.

port#i2caddress
This figure is critical if you have set this port to ENABLE. The I2C address is a number assigned to each TNC-PI. If you have not yet set the I2C addresses for your TNC-PIs, you will be doing that shortly. In that case, set the first port to address 5 and the following ports (for which you will have TNCs) to 6, 7, etc… Leave the ports for which you do not have TNCs set to 99.

neighbor
Every port has a station it is intended to talk to. Enter the callsign and ssid of the neighbor here. If you don’t have an intended neighbor, set this to something interesting, like W1AW or something.

txdelay
For USB/serial KISS TNCs, this value sets the transmit keyup delay, i.e. how long the TNC sends start-up-sync beeps while waiting for the transmitter to come on-line. This number is in milliseconds. 1000 = 1 second. Usually this number should be between 100 and 350. Start with 350 and then make it shorter until it doesn’t work anymore, then make it 50 or so longer.

baud rate
For USB/serial KISS TNCs, this is the serial baud rate used between the USB/serial adapter and the TNC. This must match what the TNC is configured with. This baud rate is only used in the G8BPQ node software.

FRACK
For USB/serial KISS TNCs, this is Frame Acknowledge Delay. This is how long after beginning of a transmission the G8BPQ node software will wait for the other end of the link to respond to a transmission. If this is too short, the node will immediately retry its transmission without waiting for an answer at all. If this is too long, then we'll wait extra long if the other end never answers. Error on the side of too long because we expect the other end will answer appropriately most of the time. Set for about 4000mS on a 1200 baud link, or 1000mS on a 9600 baud link.

The output during config of a single port TNC-PI node looked like this:

pi@fred-packet ~ $ tarpn config
TARPN v078
#####
#####
##### CONFIGURE_NODE.SH  version 011
#####
#####
You will be prompted with the name of a setting and the current value of that setting.
Press enter to keep the value, or enter a new value and then hit enter.

NODE CALLSIGN
The node callsign is probably your callsign dash 2, for instance: w1aw-2
The software limitations are that it can be -0 through -15 but convention
has it that you not use -0 or -15.  -2 is sort of a standard around here.

Node Callsign = n0tset -->kq7qrm-2
Node Name, max 6 chars, no spaces or punctuation = notset -->fred

MAIDENHEADLOCATOR:  This is the 6 character locator for
your gridsquare.  You can look on qrz.com under your
callsign if your node is located at home.  If it is distant
from your home then you can look at this site:
http://www.cantab.net/users/john.wiseman/Documents/BPQNodeMap.htm

maidenheadlocator = not_set -->EN54aa

This next value is the INFO message text.  This is what the user gets if
they use the I or INFO command.  This text can be several lines long.
Each line is in a separate field.  infomessage1 is the 1st line.
infomessage8 is the last line.  not_set lines are removed from the INFO response.
This is the current output for the INFO text:
--------------------------------------------------------------------------------
not_set
not_set
not_set
not_set
not_set
not_set
not_set
not_set
--------------------------------------------------------------------------------
Now you can change any lines.  I recommend you copy and paste from a text
file as you go through this so you can get the result you want.

Any line that is not to be used should be left as    not_set  or may be set to
have just a period.  Lines with a period in the first character will be replaced
with not_set and not_set lines will not be included in the INFO response.
Note: No double quotes.
infomessage1 = not_set --> Fred's new node.
infomessage2 = not_set --> West Overshoe Minn. near Downtown
infomessage3 = not_set --> Established June 4, 1931
infomessage4 = not_set --> port1 - 144.37 to SARGE
infomessage5 = not_set -->
infomessage6 = not_set -->
infomessage7 = not_set -->
infomessage8 = not_set -->

The Connect-Text is sent to a station that connects to the node.
keep it short and sweet.  Town name, or neighborhood and town.

Connect-Text = not_set -->West Overshoe Minn. Downtown

local op callsign is used by the node when an operator controls the node locally.
This is used as the telnet username, and to set up the nodename which will be PIUSER.
Connecting to PIUSER or using command HOST gets a visitor to the local operator.

This should either be set to your legal callsign, with no SSID, or to the word 'none'.
If this is set to none, then telnet and host mode are disabled.

local_op_callsign = none -->kq7qrm

SYSOP password is for answering the PASSWORD challenge which requests 5
specified letters from the password.
See http://www.cantab.net/users/john.wiseman/Documents/Node%20SYSOP.html
You should probably leave set this to the group password or discuss it with
who-ever is helping you set routes and parameters etc for your node.
The password is only used when connecting to the node over packet from another station.
Local users won't need to use it.

SYSOP password = not_set -->thequickbrownfoxjumpedoverthelazydogsbackagainandagainuntilhewasdead
-----------------
The next part enables and configures individual enabled ports.
The first 6 ports are always TNC-PIs.
The other 6 ports are used for serial TNCs.
Each TNC-PI has an I2C address.
All ports have neighbors.
The neighbor should be the callsign dash SSID of the node faced by the port
and the radio attached to that port.
Only that callsign will be accessed by that port and radio.
If you don't know the neighbor yet, set it to w1aw-2.
Note that other parameters, including TxDelay, are set on the TNC-PI itself
using the SETPARAMS command.
See the documentation.

TNC-PI port 01  enable or disable = DISABLE -->enable
I2C address for port 01 TNC-PI = 98 -->3
Neighbor node faced by port 01 = not_set -->w1aw-2
TNC-PI port 02  enable or disable = DISABLE -->
TNC-PI port 03  enable or disable = DISABLE -->
TNC-PI port 04  enable or disable = DISABLE -->
TNC-PI port 05  enable or disable = DISABLE -->
TNC-PI port 06  enable or disable = DISABLE -->

Now configure the USB-serial ports.
These ports have TxDelay parameters set in the G8BPQ node as read from
the value you are setting for each of these enabled ports.

USB TNC port 07  enable or disable = DISABLE -->
USB TNC port 08  enable or disable = DISABLE -->
USB TNC port 09  enable or disable = DISABLE -->
USB TNC port 10  enable or disable = DISABLE -->
USB TNC port 11  enable or disable = DISABLE -->
USB TNC port 12  enable or disable = DISABLE -->
-------------------------------------------------------------------
#### Done.  Now to overwrite the node.ini file with the new configuration.

Make sure you use tarpn test to test the node before making it auto.  The new
configuration will be used the next time G8BPQ is loaded. 
You can run tarpn config over and over again and each time it will save your changes and let you continue editing.
If you control C out before you are done, the changes will NOT be saved.

tarpn test

After you have configured the node, use tarpn test to run the G8BPQ node. The output should look like this:
pi@fred-packet ~ $ tarpn test
#### =TARPN vJ008 =
#####
##### TEST --  Starts BPQ node immediately and runs it in the foreground until
#####          a control C is issued in this window, or until a   tarpn stop
#####          command is issued in another window.

##### Starting BPQ Node.
#### =RUNBPQ vJ001 =
piminicom: no process found
#### =MAKE LOCAL v045 =
tncpi-port01 enabled
tncpi-port02 disabled
tncpi-port03 disabled
tncpi-port04 disabled
tncpi-port05 disabled
tncpi-port06 disabled
usb-port07 disabled
usb-port08 disabled
usb-port09 disabled
usb-port10 disabled
usb-port11 disabled
usb-port12 disabled
local-op-callsign is specified.  Enable HOST mode
SUCCESS...
#####
#####  Launching G8BPQ node software.  Note, this script does not end
#####  until the node is STOPPED/control-C etc..
#####
G8BPQ AX25 Packet Switch System Version 6.0.10.16 April 2015
Copyright ? 2001-2015 John Wiseman G8BPQ
Current Directory is /home/pi/bpq

Configuration file Preprocessor.
Using Configuration file /home/pi/bpq/bpq32.cfg
Conversion (probably) successful

PORTS 15eba4 LINKS 1605d4 DESTS 161484 ROUTES 1665c4 L4 166aa4 BUFFERS 16cfe8

Route/Node recovery file BPQNODES.dat not found - Continuing without it
Initialising Port 01     I2C Bus 1 Addr 3 Chan A
Initialising Port 32     Telnet Server
slave device: /dev/pts/2. symlink to /home/pi/minicom/com4 created
TNC Emulator Init Complete

The important thing about this test is that the Node did start and it stabilized. If there were a failure you would see other output. A common failure is turning on a TNC-PI with the wrong I2C address, or having one too many USB TNCs turned on. The first of these would result in a repetitive output of an error message: polling error. In the case of this kind of error, send a control C to stop the node's operation and then compare the node.ini file created with tarpn config against the output printed when the node starts.

Another common failure is making one of the configurations an illegal value.

After the node comes up and runs with no error messages, you should launch bpq-term on your workstation or on the Raspberry PI and connect up to your node. See BPQ Terminal for MSWindows or find the Mac or Android versions on the Builder page. Try out some of the BPQ node commands described in the Packet Node Operators Manual.

At this point the G8BPQ node is up and running, but only in test mode. If you were to shutdown and restart the computer, the node would not automatically start. Now that you know that the node will start up, you can quit the node using control-C and then use the tarpn service start command and set it to automatically start.
Note: To send a control-C to the terminal window, click into the window, then hold down the control key on your keyboard and tap the c key.
See the full suite of tarpn subcommands here.

Control-C is used to cancel many functions including the node if you started it withtarpn test.

© Tadd Torborg, 2014↝2017 -- all rights reserved