Tuesday, 3 July 2018

The Sketch That Does Nothing

One of the joys of playing with Arduinos is putting something together, and then taking it apart and building something else.

The various shields sometimes make use of the same pins, and the result of using the previous sketch might be unpredictable.

This sketch literally does nothing, except tell you it does nothing over the serial link.

void setup() {
  // Technology Is Not Dull 2018
  // Use this project to clear sketch from Arduino Board 
  // before fitting a shield so the starting sketch does not 
  // cause any issues with the newly fitted shield.
    Serial.begin(9600);   
    Serial.println("Starting The Project That Does Nothing!");    
    Serial.println("Closing Serial port");
    Serial.end();
}

void loop() {
  // Nothing to see, move along...

}

Sunday, 1 July 2018

GPS Stack - physical build

So this project is to build a simple GPS locator using an Arduino compatible controller, a LinkSprite GPS Shield and a LinkSprite LCD shield.

The specification for the Arduino allows the stacking of shields. What you do need to ensure is that there are no conflicts over pins.

 The controller is the Ciseco Xino RF board.
There is nothing overly important about using this rather than an Arduino UNO, except this board uses a mini USB socket for power so the DC in socket is the highest point.

The GPS shield fits on top. Aligning the pins is a bit worrying as they are a bit delicate and the LinkSprite assembly is a bit squint.
The topping on the stack is the LCD shield.
The alignment issues are clear on the sockets on the photograph above.

Here is the assembled stack.
The DC in socket contacts the



LinkSprite GPS Shield

The LinkSprite GPS shield provides GPS data for Arduino and compatible microcontrollers.
Another purchase from Maplin, this has not particularly good instructions. The photograph on the instructions page is unclear as to how to set up the shorting pins to select the serial port.

The shield takes an SD card, note that due to its advanced age, it only takes SD cards - not SDHC and above. It is a bit difficult to find 2GB cards.

References:

http://linksprite.com/wiki/index.php5?title=GPS_Shield_With_SD_Card_Slot_for_Arduino_V2.0_B

Ciseco Xino RF microcontroller

The Ciseco Xino RF is an Arduino Uno compatible microcontroller with a built in radio module.

Add caption
Maplins stocked the Raspberry Wireless Inventor Kit for the the original Raspberry Pi. It included a Xino RF micro and a matching radio card for the 26 pin connector on the original Raspberry Pi. There was a set in the Maplins closing down sale which was about the same price as an Arduino Uno (but with added LEDs etc) so I added it to my collection (I bought one with my original Model B).

The Xino RF can be used as an Arduino with the added advantage that it uses a Mini USB for power (the DC in port is the highest point on the board, unlike on the UNOs where the USB-A connector with a metal case is the highest point. There is a sketch available that will return it to the Wireless Inventors mode.

LinkSprite LCD Arduino Shield

The LinkSprite 16x2 LCD Shield is a display shield for Arduino compatible microcontrollers.

Maplins (late supplier of electronic bits) stocked a range of LinkSprite products. One of many problems was they had a lot of rather ancient stuff that sat on shelves and was more of interest to archaeologists. With the loss of Maplins, it can be difficult to identify the particular items, but LinkSprite does still have a products wiki here.

Do be aware that the pins used by this LCD shield do not match those on the Arduino examples sketches. To make it more confusing, the example code on the LinkSprite site works (by setting the values in the initialization call) but has not had the pin selection changed in the comments.

If you use the Arduino LCD Shield "HelloWorld" example code, you need to change the pins used :

  •  LCD RS pin to digital pin 8
  •  LCD Enable pin to digital pin 9
  •  LCD D4 pin to digital pin 4
  •  LCD D5 pin to digital pin 5
  •  LCD D6 pin to digital pin 6
  •  LCD D7 pin to digital pin 7
  •  Wiper to LCD VO pin (pin 3)

//const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
const int rs = 8, en = 9, d4 = 4, d5 = 5, d6 = 6, d7 = 7; 

Ensure that the pins are not in use by any other shields or added hardware.

References:

https://www.arduino.cc/en/Reference/LiquidCrystal
http://linksprite.com/wiki/index.php5?title=16_X_2_LCD_Keypad_Shield_for_Arduino_V2
https://www.arduino.cc/en/Tutorial/HelloWorld

Arduino Installation on the Raspberry Pi

Though most software is available on the Raspberry Pi through the use of the APT repository, for some reason the version of the Arduino IDE is rather old, and possibly non standard.

To obtain the latest version you need to grab it from the Arduino web site here.

Follow the instructions and remember to choose the com port.

Wednesday, 27 June 2018

UBUNTU update after end of life - a tale of Zesty Zapu (17.04) to Bionic Beaver (18.04)

Background

A long (in computer terms) while ago I bought an Intel NUC as my first venture into building a computer from scratch (not exactly challenging - I only had to install the memory and the hard drive and then boot it off of an Ubuntu Live USB).

It is not particularly fast (still faster than any of my Raspberry Pis), but it is useful for some tasks (amongst others it runs Inkscape and does not get tied in a knot when logging into YouTube). It gets hauled out occasionally when I need it.

I dutifully update the operating system (starting with 14.04 Trusty Tahr). Now Trusty Tahr is a Long Term Support release but this is not a production machine so with each release version I updated it to the latest stable version.

And then I did not use it for a while.

I recently needed to upload something to YouTube, and once completed I went to update the operating system...

At which point the updater could not find the repository as Zesty Zapus was retired on the 13th of January 2018.

First point of call was a Google search for information. This brought me to reference 1. This was informative, but did assume that the Aptitude package was already installed.

A further Google brought me to Reference 2 for a simpler command line method.

Upgrade method

Please ensure you have backed up the machine before upgrading. 
These instructions are supplied "as is" and with no guarantees. 
Please use them in conjunction with the references and common sense.
So here is my version, based on the two references and my experience (please read the referenced pages for more detail).
First the sources.list file needs to be edited - my installation was fairly vanilla so had no strange sources.
Either copy the existing file or comment out the existing entries.
Command line:
sudo nano /etc/apt/sources.list
Replace with the following lines (replace the "zesty" with your version if that is different):

## EOL upgrade sources.list 
# Required 
deb http://old-releases.ubuntu.com/ubuntu/ zesty main restricted universe multiverse 
deb http://old-releases.ubuntu.com/ubuntu/ zesty-updates main restricted universe multiverse 
deb http://old-releases.ubuntu.com/ubuntu/ zesty-security main restricted universe multiverse

The next stage is to run the apt update command to obtain the last version information (using the new repositories):

sudo apt update

Once that has completed the versions of the software needs to be upgraded.

sudo apt upgrade

This will take some time.

Once this has completed you need to run the distribution upgrade.

sudo apt dist-upgrade
If this does not work (reporting no suitable upgrades), restart the computer.

Once it has completed you need to restart the computer again.

After you have logged in again, you run the release upgrade. This will take a long time, hours.

sudo do-release-upgrade

Once that completes you will have an installation of Artful Aardvark (17.10). This is only supported until July 2018 so you will need to upgrade it to Bionic Beaver.

This should be automatic, except you have slightly messed up the settings by editing the sources.list file.

Bring up the settings panel and select the updates pane. Select the sources by clicking in the tick boxes. It will then ask you if you want to check if there are updates. If it does not, try swapping the check interval (never to daily seems to work).

You can then follow the instructions for the upgrade to Bionic Beaver.

References:

https://help.ubuntu.com/community/EOLUpgrades
https://ubuntuforums.org/showthread.php?t=2382832
https://en.wikipedia.org/wiki/Ubuntu_(operating_system)#Releases