maccslinux

Installing the Transport Network

These are the instruction for setting up the transport network to use with the innd news server. The guide I used can be found at http://transport.sri.com/TransportDevel/Docs/INSTALL.


1) Go to http://transport.sri.com/TransportDevel/Resources/Download and download transport-2.0.48.tar.gz. Or, if you already have this file, be sure to copy it onto the computer.


Then, in a terminal window, cd to the directory it downloaded to. Now type:

tar zxvf transport-2.0.48.tar.gz
cd transport-2.0.48
sudo /usr/sbin/adduser transport


when prompted for a password, type in the new user's password (I used "transport").


2) Type:

./configure \
--with-sitename=maccslinux \
--with-sitedesc="maccslinux, Augsburg College, MN"

Or, for remote sites, change the site name and description.


3) Type:

make
sudo make install


4) Type:

sudo update-rc.d transportd defaults


5) cd to the directory in which transport-2.0.48.tar.gz is located (~).

Then cd to this directory:

~/transport-2.0.48/support

Now type:

sudo cp S61transport /etc/init.d/transportd


6) Check the permissions on these files. Type:

cd
ls -al /opt/transport/bin/transportd

If the permissions string looks like -rwxr-xr-x then the permissions are already correct. Otherwise, type:

sudo chmod 755 /opt/transport/bin/transportd

Next, type:

ls -al /opt/transport/log/transportd.log

If the permissions string looks like -rw-rw-rw- then the permissions are already correct. Otherwise, type:

sudo chmod 666 /opt/transport/log/transportd.log

Finally, type:

ls -al /etc/init.d/transportd

If the permissions string looks like -rw-rw-rw- then the permissions are already correct. Otherwise, type:

sudo chmod 755 /etc/init.d/transportd

REBOOT


7) To check if transportd is running, type:

ps -elf | grep tranportd

or

cd /etc/init.d
./transportd status


8) If the process is running, you are ready to test everything else. Type:

cd /opt/transport/bin/
./viewlog Servermonitor

This will show that transportd has started and is running. Then type:

./transportctl status

This will show the status of transportd as "True."

Now type:

transportctl list

This should list the group called SeverMonitor

If not, wait a few minutes and try again.
Once ServerMonitor shows up as a group, type:

transportctl list ServerMonitor

It will display the processes running within ServerMonitor (namely Watchdog and ResourceMonitor).

Now you are finished and ready to use the transport network!

0 comments

GPS and ntp setup

The GPS box (an Ashtech unit and a chip to output the 1 Hz signal from the unit) should be connected both to the USB (for the 5V power) and to the B serial port (on the IBM ThinkCentre boxes, this is the upper serial port) for communications. Additionally it should be connected to an antenna, and the 1 Hz output should be connected to the front of the Narod Blue Box.

The serial port will appear as /dev/ttyS1 in the Ubuntu OS, and we want to be able to talk to it through the alias /dev/gps0, so a link needs to be placed in /lib/udev/devices/ (since /dev is recreated dynamically based on visible hardware, other devices are placed by udev) using (while in the /lib/udev/devices/ directory): 

cd /lib/udev/devices
sudo ln -s /dev/ttyS1 gps0.

The GPS unit should be outputting only the NMEA GPGGA code once a second to the serial port, at 4800 baud, in order for the ntp daemon to read it. By default, Ashtech units come online talking at 4800 baud, but some units may have been set to 9600. To change the speed, write the "$PASHS,SPD,A,4\r\n" to the serial port after connecting at the current speed. For example, using python:

import serial
gps = serial.Serial(1) # Connects to /dev/ttyS1 at 9600, could use serial.Serial('/dev/gps0',19200)
gps.open()
gps.write("$PASHS,SPD,A,4\r\n")

In order to initialize the unit (so it won't output anything) use the "$PASHS,INI,4,4,,,1,\r\n" command (to leave the almanac, position, and time in the memory, use a 5 instead of a 1 as the fifth parameter to INI)
In order to start the position (GPGGA) command going, use "$PASHS,NME,GGA,A,ON\r\n".
In order to disable all NMEA messages, either initialize or use "$PASHS,NME,ALL,A,OFF\r\n".


In order to set the computer clock using ntp, install the ntp software from the following packages:

ntp_4.2.4 and ntp-doc_4.2.4

Then edit the /etc/ntp.conf file, removing any other server lines and adding (or editing) the following:

restrict default ignore restrict 127.0.0.1 server 127.127.20.0 mode 2 # Local GPS: /dev/gps0 -> /dev/ttyS1 fudge 127.127.1.0 stratum 10 driftfile /var/lib/ntp/drift broadcastdelay 0.008

In order to set the computer's timezone to UTC, invoke tzselect, and tell it to set the raw timezone with "GMT-0"

The clock should be set close to the correct time so that ntp will correct it. This can be done with the date command:

sudo date 072916482008.20

which is in the format mmddHHMMyyyy.SS.

In order to start and stop the ntp service, use "/etc/init.d/ntp stop" (or start, or nothing to get a list of options). One may want to do this in order to free up /dev/gps0 to talk to the gps directly.


0 comments

INND - News Server Setup

These setup instructions are derived from http://transport.sri.com/TransportDevel/Docs/INSTALL. Some steps, however, are modified for Ubuntu.

1. Using the following packages: exim4, exim4-base, exim4-config, exim4-daemon-light, inn2, inn2-news, libdb4.4
With an internet connection, you can just type

sudo apt-get install inn2

The installation of inn2 will fail with a message like.

innconfval: hostname does not resolve or domain not set in inn.conf

So you'll need to edit /etc/news/inn.conf, and change the line

#domain:

to

domain: <computer's name>

where <computer's name> is the name you gave the computer during Ubuntu setup. For example:
domain: maccslinux1

After saving, reinstall inn2.



2. Change the following lines in /etc/news/inn.conf:

organization: "Maccs Transport Network"
maxartsize: 50000000
localmaxartsize: 50000000

Add these lines to /etc/news/readers.conf:

# Allow access to the transport groups

auth "transport" {
hosts: "meteor.sri.com, 192.101.148.*, *.sri.com"
default: "<transport>"
}

access "transport" {
users: "<transport>"
newsgroups: "*"
}

and change

access "localhost" {
users: "<localhost>"
news groups: "*"
access: RPA
}

to

access "localhost" {
users: "<localhost>"
news groups: "*"
access: RPAN
}

3. In /etc/news/storage.conf, change

method tradspool {
class: 0
newsgroups: *
}

to

method tradspool {
class: 1
newsgroups: *
}

4. In /etc/news/control.ctl, change the default newgroup/rmgroup action to log:

newgroup:*:*:log=newgroup

rmgroup:*:*:log=rmgroup


Then add these lines following the defaults:

## Added for Data Transport Network
newgroup:*:transport.*:doit=newgroup
rmgroup:*:transport.*:doit=rmgroup

5. In /etc/news/expire.ctl, change the line

*:A:1:10:never

to

*:A:1:2:never

6. In /etc/syslog.conf, change the line

news.notice -/var/log/news/news.notice

to

news.=notice /var/log/news/news.notice

REBOOT.

7. Type the following commands:

cd /usr/lib/news/bin
sudo -u news ./makehistory
sudo -u news ./makedbz -i -o
sudo chown news:news /var/lib/news/history.*
sudo chown news:news /var/spool/news/tradspool.map

8. Create a new file called /etc/event.d/inn2 and type the following in it:

start on runlevel 2
start on runlevel 3
start on runlevel 4
start on runlevel 5

stop on runlevel 0
stop on runlevel 1
stop on runlevel 6

respawn
exec /usr/lib/news/bin/innd

REBOOT. Then type the command

top -b

followed by

<CTRL-C>

If innd is in the list, everything up until now is working. Otherwise start over.

9. The last part of setup (part I) is connecting to the server. Type:

telnet localhost 119

it should respond with:

Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
200 meteor.sri.com InterNetNews server INN 2.3.1 ready

Then type:

LIST

it should respond with:

215
control 0000000000 0000000001 n
control.cancel 0000000000 0000000001 n
control.checkgroups 0000000000 0000000001 n
control.newgroup 0000000000 0000000001 n
control.rmgroup 0000000000 0000000001 n
junk 0000000000 0000000001 n
.

Then type:

QUIT

it should respond with

205 .
Connection closed by foreign host.


10. Type the following commands:

cd /usr/lib/news/bin
sudo ./ctlinnd changegroup control y
sudo ./ctlinnd changegroup control.cancel y
sudo ./ctlinnd changegroup control.checkgroups y
sudo ./ctlinnd changegroup control.newgroup y
sudo ./ctlinnd changegroup control.rmgroup y
cd
sudo ctlinnd perl n

Then type:

cat /var/log/news/news.notice

You should get back the start of a log file showing that you are connecting to the server.


0 comments

Client Dial Out Setup

Assuming that the modem and its drivers have been installed, edit /etc/wvdial.conf and add the phone number, username and password. (default is user maccs pass maccs) 

The file /etc/wvdial.conf should look like this:

[Dialer Defualts]
Phone = <Phone number>
Username = <username>
Password = <password>
New PPPD = yes
Modem = </dev/ttySx>


to connect to the server run:
sudo wvdial

after the computers have connected, open another terminal window and ssh into the ip of the server (Default 192.168.1.1)
ssh 192.168.1.1
Alternatively, once connected, type <CTRL-Z> (in the same terminal window) then ssh with the above command. To end the session, logout of the ssh and type <%1> then <CTRL-C>.

0 comments

Dial in Setup Documentation

This post documents the exact setup followed by the tutorial: http://derrick-caluag.blogspot.com/2006/10/how-to-setup-dial-in-server-on-linux.html
This is all assuming that you have already installed the modem and all drivers and the modem is a Conexant HCF chipset.

The package to drive the Conexant HCF chipset is:
hcfpcimodem_1.16full_i386.deb

First i installed mgetty by doing:
apt-get install mgetty
or by this package
mgetty_1.1.36-1ubuntu1_i386.deb

install ssh server
apt-get install ssh
or by these packages:

libssl0.9.8_0.9.8g-4ubuntu3.3_i386.deb
openssh-client_4.7p1-8ubuntu1.2_i386.deb
openssh-blacklist_0.1-1ubuntu0.8.04.1_all.deb
openssh-server_4.7p1-8ubuntu1.2_i386.deb

created ppp group by editing /etc/group and adding a line:
ppp:x:1001:

added a new user called maccs with password maccs by:
sudo adduser maccs
edited file /etc/passwd and changed the entry for maccs user to
maccs:x:1001:1001:,,,:/home/maccs:/usr/sbin/ppplogin
this sets the maccs user as being in the ppp group and having the login script of /usr/sbin/ppplogin

add maccs user to the dip group by reediting /etc/group and adding maccs to the dip line:
dip:x:30:maccs

setup event.d by adding a file /etc/event.d/ppp with contents to start and stop on certain runlevels and the execution lines of:
start on runlevel 2
start on runlevel 3
start on runlevel 4
start on runlevel 5

stop on runlevel 6
stop on runlevel 1
stop on runlevel 0

respawn
exec /sbin/mgetty ttySHCF0

added the login file (/usr/sbin/ppplogin) with contents of:
#!/bin/sh
#/etc/ppp/ppplogin
# PPP login script
mesg n
stty -echo
exec /usr/sbin/pppd -detach modem debug crtscts

this displays the normal login message and then runs the pppd deamon

changed the permissions of the login file and home directory for the maccs user with
chmod 750 /usr/sbin/ppplogin
chown root:ppp /usr/sbin/ppplogin
chmod 775 /etc/ppp
chown root:root -R /etc/ppp

edited /etc/mgetty/login.config and replaced the autoppp line with
/AutoPPP/ - a_ppp /usr/sbin/pppd file /etc/ppp/options
this tells ppp to use a certain config file for its options

in that options file then i changed all the following options, which must be uncommented, to be:
-detach
asyncmap 0
modem
crtscts
proxyarp
lock
require-pap
refuse-chap
usepeerdns

created file /etc/ppp/options.ttySHCF0 with the contents of
192.168.1.1:192.168.1.101
noauth

this specifies the ip addressses for mgetty to use when the dial in is connected

edited file /etc/ppp/pap-secrets and replaced the line after
# Every regular user can use PPP and has to use passwords from /etc/passwd with
* * "" *
so that any host can be authenticated

once the computer was restarted the event.d system started mgetty for respawning and the computer was ready for dial in


0 comments

GPS

To communicate with the GPS cards, be sure to have the follwoing packages installed on Ubuntu:


- python ($ sudo apt-get install python)

- pyserial (from http://sourceforge.net/project/showfiles.php?group_id=46487)


Then install the scripts gpsShow.py and gpsSetup.py. From the terminal window, sudo either command, and run through the program to communicate with the GPS. Upon starting either program, be sure to know the device placement of the card (a.k.a. which serial port it is plugged in to) in the form '/dev/ttySx' where x is a number 0-4. If you write '/dev/tty0', the script will try to communicate with the first port possible. In most cases, the GPS will be '/dev/ttyS0'.

0 comments

Ubuntu Install

Before booting, be sure to configure the hardware in the computer as follows:

Plug modem into an open pci slot and insert the telephone wire into the slot on the modem labeled "line."

For an internal GPS card, plug the card into an empty pci (or isa) slot. Plug the serial output cable into serial port B on the back of the computer. If there is a usb cable, plug it into an empty usb slot.

For an external GPS, plug the serial output cable into serial port B on the back of the computer. Plug the usb cable into an open usb port.

Boot the computer. Enter BIOS, and set the boot order to boot from the cd drive before booting from the hard drive.
Also, in the power menu, change the setting for "After Power Loss:" to "[Power On]"
Insert the Ubuntu Install Disk into the cd drive. Save and Quit BIOS.

Follow the prompts from the install disk to successfully install Ubuntu.

0 comments