Warning

Warning: Keep out of reach of small children and smart-alec teenagers. Keep printed material away from open flames or excessive heat. Studying these documents may cause drowsiness. Do not read while driving heavy equipment or machinery. If nervousness, sleeplessness or irritability occur, discontinue use and seek professional help. Excessive and prolonged use may cause career burnout and has been known to cause cancer in laboratory rats. Isolated cases of schizophrenia exhibiting delusions of grandeur have been reported. Do not use if you are being treated for high blood pressure or have problems urinating due to excessive consumption of caffinated drinks.

Tuesday, October 8, 2013

Pi Lab 2 - NTP Services







OBJECTIVE:
The objective of this lab is to configure the Pi to update its time using a rotating pool of Internet NTP servers.

REQUIRED MATERIALS:
  • Raspberry Pi Micro-Controller
  • 8GB SDCard with the Operating System NOOBS (Raspian – Debian Linux derivative) pre-installed.
  • Power Supply, AC-DC Converter, External Plug in, Micro USB connector, 5W, 5V, 1A output.
  • USB Keyboard.
  • USB Mouse.
  • HDMI Monitor.
  • HDMI Cable.
  • HDMI to DVI Adpater (if your monitor only has a DVI and not a HDMI connector).
  • Two straight through Ethernet cables
  • Home router\switch connected to a cable modem or DSL modem
  • A personal computer

PRE-REQUISITES:
  • An operating system must be installed onto the Raspberry Pi (see Pi Lab – Initial Setup)
  • The Pi must have Internet connectivity.
A basic understanding of:
  • Ethernet networking.
  • Connector types such as HDMI, DVI, USB, RJ-45 (Ethernet), etc…
  • The Linux Operating System
  • The Network Time Protocol (NTP) Protocol

REFERENCES:
Raspberry Pi Help
  • http://www.raspberrypi.org/phpBB3
Linux NTP Man Pages
  • ntpd
  • ntp.conf
  • ntpq
  • ntpdc
  • ntpdate
  • ntp_mon
  • ntp_acc
  • ntp_clock
  • ntp_misc
The NTP Protocol
  • http://www.ntp.org/
  • http://www.eecis.udel.edu/~mills/ntp.html
  • http://www.eecis.udel.edu/~mills/ntp/html/
  • http://support.ntp.org/bin/view/Main/WebHome


PRELIMINARY READING:
Most computers have a clock somewhere in their circuitry. The clock circuitry usually has a battery connected to it so that after you set the time and date on your computer, and then turn off power to the computer, the clock circuitry still functions and keeps time so that when you power on the computer again, the correct time and date is readily available to initialize the operating system. When the computer is configured to synchronize it’s time to a NTP server, the operating system corrects the clock circuitry from time to time. The ntpd has this quirk in which if the computer’s clock is different than the NTP server’s clock by more than 1000 seconds (between 16 and 17 hours), ntpd assumes that something is very wrong and that the only dependable thing to do is have a human being step in and set the clock manually. It sends a warning message to the system log and then stops the NTP daemon. In other words, NTP won’t work.

The Raspberry Pi has a system clock, but it does not have a battery to keep it functioning when the Pi is powered off. This means that if you do not have an Internet connection, every time you turn the power off and then back on again, you will have to manually set the system clock. On my Pi, the default date was June 19, 2013 UTC time. Right now it is October, which means the clock is at least 3 months off. There are several workarounds to this dilemma:

1.   Physically connect a real-time clock (RTC) module to the Pi circuit board. There are several different RTC clock modules sold by numerous vendors.
2.   Raspbian (Debian-Wheezy Linux optimized for the Raspberry Pi) uses the “fake-hwclock” daemon to record a timestamp before you power down. When you boot the Pi back up, the system clock is set using the time recorded before you shutdown. That means that if you manually set the correct time on the pi, and then power it off for 3 hours, when you power it back on, the clock will be 3 hours off instead of 3 months off.
3.   Use the “ntpdate” utility. This forces a system clock to update using the time received by querying NTP servers on the Internet. After you execute the “ntpdate” command and update the system clock, then you can run “ntpd”. The drawback is that you must have an Internet connection, and your firewall needs to permit packets using the NTP protocol to pass through it. It is not included the Raspbian installation.
4.   The “ntpdate” has been deprecated and its functions are included in the newest version of the “ntpd” daemon. With the Raspbian OS installation, ntpd is configured to run at startup and automatically checks Internet NTP servers for time and updates the system clock. The clock update feature works when the Pi is a NTP client and is getting its time from stratum 1, 2, 3, etc., servers. However, if you are trying to make the Pi into a stratum 1 server by getting your time from a stratum 0 server (an external clock source such as GPS), then the clock offset becomes an issue. For example, if the GPS time differs from the system clock time by more than 1000 seconds, NTP will not work. You will have to manually set the system clock time before you can get the GPS to work with NTP. Also, be advised that NTP will not set your time zone. By default, the time zone is UTC. If you want your clock to reflect the time as it exists in your time zone, you need to change the time zone by executing the command “sudo raspi-config” and selecting option 4 - “Internationalization Options”.

Screen Shot of the Rasbian Software Configuraion Tool


PROCEDURE:
Experiment 1
1.   When you installed the Raspbian OS in the previous lab, the default time and date should have been updated over the Internet, assuming you were properly connected to the Internet.
2.   Note the current time and date of the Pi by left clicking the time displayed in the bottom right corner of screen if you have the GUI desktop displayed. If you are using the command line interface, enter the command “date”.
3.   Disconnect the Pi from the network.
4.   Gracefully shutdown the Pi By clicking the ON\OFF button on the bottom right of the screen and selecting “Shutdown” or by executing the command “sudo shutdown –h now” at the command prompt. After the screen has gone blank, physically remove the power connector from the Pi.
5.   Wait an hour or two.
6.   Remove the Ethernet cable from the Pi thereby disconnecting it from any network, and then apply power to the Pi.
7.   Check the time and compare it to the time noted before you removed power. They should be the same.
8.   Reconnect the Pi to the Internet and wait a few minutes.
9.   Look at the time and date again. The clock should be updated.

Experiment 2
1.   Note the current time and date of the Pi.
2.   Remove the Ethernet cable from the Pi.
3.   Shutdown and turn off power to the Pi. Wait a few hours.
4.   Turn on the Pi without being connected to the Internet.
5.   Execute the command “sudo service ntp stop”.
6.   Reconnect the Ethernet cable to the pi.
7.   Execute the “date” command. The time should be the same as it was before removing power.
8.   Execute the command “sudo service ntp start” and wait a minute or two.
9.   Execute the “date” command again. The time should have been updated.




Monday, October 7, 2013

Pi Lab 1 – Initial Pi Setup







OBJECTIVE:

The objective of this lab is to:
Install the Raspbian Linux operating system onto the Raspberry Pi microcontroller board. Configure the Pi to communicate with other devices on an Ethernet network.

REQUIRED MATERIALS:

  • Raspberry Pi Micro-Controller
  • 8GB SDCard with the Operating System NOOBS (Raspian – Debian Linux derivative) pre-installed.
  • Power Supply, AC-DC Converter, External Plug in, Micro USB connector, 5W, 5V, 1A output.
  • USB Keyboard.
  • USB Mouse.
  • HDMI Monitor.
  • HDMI Cable.
  • HDMI to DVI Adpater.
  • Two straight through Ethernet cables
  • Home router\switch connected to a cable modem or DSL modem
  • A personal computer

Top View of Raspberry Pi with NOOBS SDCard












Notes:
The Pi only has only two types of display connectors – RGA and HDMI. This allows you to connect a TV to your Pi and use it as a monitor. You can also use a monitor with a standard VGA connector, but you will need to purchase a VGA-to-HDMI converter which contains circuitry to change the signal from the VGA format to the HDMI format. They can cost $20 dollars or more, and you will probably have to order it over the Internet. When I went looking for one, I went driving around to 4 different stores, but nobody had it.

Nobody had a monitor in their store that had HDMI connectors either – just VGA or DVI. So, I bought a small monitor with a DVI connector that was on sale, a HDMI cable and a HDMI-to-DVI adapter to go with it.

I initially used my cell phone charger to power the Pi because it had the required voltage and amperage rating. Then l purchased another charger on the Internet later.

PRE-REQUISITES:

A basic understanding of:
  • Ethernet networking.
  • Connector types such as HDMI, DVI, USB, RJ-45 (Ethernet), etc…
  • The Linux Operating System

REFERENCES:

http://www.raspberrypi.org/phpBB3

PROCEDURE:

Connect Everything Together
1.       Connect the PC to the router\switch that is connected to the Internet with the Ethernet cable.
Turn on and configure the PC with DHCP (obtain an IP address automatically). Using the PC, verify connectivity to the Internet so that if the Pi has any problems connecting the Internet, you will know that it isn't a problem with the Internet.
2.       Connect the keyboard and mouse to the Pi’s USB ports.
3.       Connect the monitor to the Pi’s HDMI port.
4.       Connect the Ethernet port to the router\switch with an Ethernet cable.
5.       Insert the SDCard with the pre-installed NOOBS Operating System into the Pi’s SDCard connector on the underside of the Pi as shown in the photo below.


Inserting SDCard into Pi card reader slot














Power Up the Pi
1.   Because the Pi does not have an ON\OFF switch, you turn the Pi on by connecting it to the power supply. Apply power to the Pi. When the Pi finishes booting up, you will see a window in the middle of the screen with the header “NOOBS v1.2.1-Built June 26, 2013”that lists various options.
  • Archlinux
  • OpenELEC
  • Pidora
  • RISC OS
  • RaspBMC
  • Raspbian [Recommended]
  • Edit Config (e) - allows you to change various startup parameters including video settings.
  • Online Help (h) – requires a connection to the Internet to access the URL shown above under REFERENCES.
2.   A drop down menu at the very bottom center of the screen that has various language options.
  • English
  • Deutsch (German)
  • Suomi (Finland)
  • Franais (French)
  • Magyar (Hungarian)
  • Japanese
  • Nederlands (Dutch)
  • Portugues (Portugese)
3.   Using the mouse, select “Raspbian” (double left click), and then click on the “Install OS” button. A message appears saying “Warning: This will install the selected Operating System; All existing data on the SD card will be overwritten.” Click the “Yes” button.
4.   If everything goes well, you should see a message pop up “Image applied successfully”. Click “OK” to reboot the system.
5. After the Pi reboots, a window will pop up showing the “Software Configuration Tool”. Options are:
  • Expand Filesystem. Ensures that all of the SD card us available to the OS.
  • Change userpassword. Change the password for the default user (pi).
  • Enable Boot to desktop. Boot to GUI or the command line.
  • Internationalization options.
  • Enable camera
  • Add to Rastrack
  • Overclock
  • Advanced Options
  • About raspi-config
Note: The up\down arrows and the “Tab” key are used to navigate the menus. Use the “Enter” key to make your selection.
6.   Select option “1. Expand Filesystem”. A popup message says “Your partition is not currently supported by this tool. You are probably using NOOBS, in which case your root file system is already expanded anyway.” Select “OK”.
7.   Select option “3. Enable boot to desktop”. A popup message asks “Should we boot straight to desktop?” (GUI). Select “Yes” for now.
8.   Select option “8 Advanced options”. A submenu appears. Select “A2 Hostname”. Press “Enter” and type the new hostname. Tab to “OK”, press “Enter” again to return to the main menu. When entering the new hostname, use:
  • Only letters a through z (case sensitive).
  • Digits zero through nine.
  • A hypen.
  • The name cannot begin or end with a hyphen.
  • No symbols, punctuation characters, or spaces are permitted.
9.   On the main menu, select option “2 Change password”. A popup message says “You will now be asked to enter a new password for the pi user”. “Enter” for “OK”. At the bottom left of the screen, enter your new password twice. I will use “cremepie” as my password for now.
10.   We are finished making changes. Tab to “Finish”, press “Enter”. “Reboot now?”, “Enter” again for “Yes”.
11.   At the bootup screen, there is a message that says “For recovery mode press shift”, (don't touch it!) then after a small waiting period goes to the GUI desktop interface. No login required.
12.   Verify network connectivity. Right click on the icon labeled “Midori”. This is a lightweight Internet browser. Left click “open”. If the pi has properly connected to the Internet, the page will open to an Internet website.


Midori Web Browser Icon






13. To turn the Pi off, left click the red power button on the bottom right of the screen (shown below). Wait a spell, and the power off menu will appear showing the options:
  • Shutdown
  • Reboot
  • Logout
  • Cancel
Raspberry Pi ON\OFF Button


Wednesday, October 2, 2013

Discovering CSU\DSU Loopback Plugs


In studying for the certification tests, mention was made in class, and in the books, about doing loopback tests to help in troubleshooting router WAN connections. They mentioned the required commands to enter at the router console, but no mention was made that anything needed to be done physically to the equipment.

One day I was in Leland, Mississippi trying to troubleshoot a downed T1 connection at the school district’s main office. The telco tested their circuits and said they were ok. Exasperated, I finally called Cisco’s tech support. The Cisco tech said that I needed to make a loopback plug, remove the T1 line from the

CSU\DSU, insert the plug into the DSU\DSU, and enter some commands at the router console. If the serial interface came “up and up”, then the router was good and the problem was most likely on the telco’s equipment. He also said that the telcos almost always say that it isn’t their problem. But if I tell them that my physical loopback worked, then they will admit that it’s their equipment, if it is.

So, I made the loopback plug in the manner in which he instructed me and tested the router. The interface came back up just as he said it would. So, I called the telco back and told them that my loopback tested good. They hemmed and hawed and then finally said they would do a loopback “again” on their end. Sure enough they “discovered” that they couldn’t loop their smartjack and that the problem was with their equipment at the CO (Central Office). Within 20 minutes, the school district’s router was working fine.

Cisco has a document on their web site that tells you how to make a loopback plug, but if you don’t know about it, you won’t go looking for it. Also, if you have no access to the Internet at the site because the line you are trying to fix is your connection to the Internet, how are you going to access Cisco’s web site? This is something I’d really wished was part of my training. From then on, I have always made sure that I had T1 and 56k loopback plugs in my laptop carrying case and they have saved my hide many, many, many times over.

How to Make CSU\DSU Loopback Plugs

Constructing loopback plugs for CSU\DSUs is pretty simple and straightforward. If you are accustomed to making Ethernet cables, then you should have little problems making a loopback plug. With the tip of the connector facing you, the clip on top and the wires extending out the back, the pins are numbered 1 through 8 reading from the left to the right

T1 Plug

  1. Basically all you need is an RJ45 connector and two wires from a piece of scrap Ethernet cable. A length of about 4 inches should be more than sufficient.
  2. For a T1 CSU\DSU, the idea is to connect pin 1 to pin 4, and pin 2 to pin 5. Insert the 2 wires into the connector as shown in Figure 1 and crimp.

Figure 1. T1 CSU\DSU loopback plug.

 

56K Plug

For a 56k CSU\DSU, the idea is to connect pin 1 to pin 7, and pin 2 to pin 8. Again, Insert the 2 wires into the connector as shown in Figure 2 and crimp.

Figure 2. 56k CSU\DSU loopback plug.

 

No Crimper Handy? No Problem.

So, what if you don't have a pair of crimpers handy?
  1. Find a pre-made CAT 5 cable that has the connectors already installed on both ends.
  2. Cut the cable in two about three inches from one of the ends.
  3. Remove the shielding and separate the wires.
  4. Strip the necessary wires leaving about a half-inch or so of bare metal on the ends and then twist the ends together.
  5. For a T1 loopback plug, strip and twist wires 1 and 4 together and then strip and twist wires 2 and 5 together.
  6. Leave the remaining wires dangling out the back. Do the same for a 56k loopback plug strip except twist wires 1 and 7 together and 2 and 8 together. See the diagram for a T1 loopback plug below.

Figure 3. T1 CSU\DSU loopback plug using the stripped and twisted wire method
That's all there is to it!

Lab Servers Part 3



The 1u Chassis

Well, I bought the power supply extension cable and so I finished installing everything into the 1u chassis okay. I booted up the server with the chassis cover off and let it run awhile. The temperature stayed around 34 degrees C. As soon as I put the cover on the chassis, however, the temperature started to rise. When it got up to about 43 degrees, I shut it off.

The small fans I bought are moving any air hardly at all. Add that to the fact that the cables and the RAM modules are blocking any air flow that there is. I guess I am going have to invest in some better fans before I can get this server up and running.

The 2u Chassis

You will note that I don’t have any DVD\CDROM drives on these servers. Thought I’d save some money and install everything via flash drive. I created a bootable USB flash drive with the OpenSuSE  12.2 installation image as per the instructions on the opensuse.org website. After everything was installed and I logged into the system, the screen would go blank. The BLACK SCREEN OF DEATH. The monitor is showing the message “No Signal”.

Considering that the display works fine all through the setup and displays a login prompt, but then goes blank only after I login, I figure that it’s a video driver issue. OpenSuSE version 12.2 is at least a year or two old, and my motherboards with their CPUs with integrated video are much newer. So, chances are the old drivers in the 12.2 version will not work with the latest hardware.

I downloaded the latest “.iso” version of OpenSuse (12.3) and burned it to a bootable flash drive. I proceeded to install OpenSuSE  onto the server. Login.


WOO-HOO!! It works!!! No black screen of death.