Moving to Linux

Linux - Some History

It was the start of the 21st Century when I had my first success with Linux.

I looked at Linux in the late 90's but found it very difficult to configure. Early distributions like RedHat were limited in the range of hardware they would support. Software drivers for network cards and Video cards were not always available.

Linux had its roots in Unix which started in 1970 by a couple of guys at AT&T. Unix was written in the 'C' language which made it portable across many different platforms. With the release of the Intel 386 microprocessor in 1985 and its 32 bit instruction set and Memory Paging the PC programming environment was free of the 1 Megabyte memory limits. In 1990 Linus Torvalds, a Finnish University student decided to write his own operating system in the form of a 'Kernel', that allowed other programmers to build upon the core functions. One of the big advancements was the X-Window software in 1992 which allowed Linux to have a Graphical User Interface.

The Linux Kernel software has always been maintained by Linus to manage compatibility across the various versions of Linux called 'distributions'. The Kernel is a single compressed file that gets loaded into memory when the computer starts and controls all the low level functions on the computer. Other programs can then talk to the Kernel to perform higher or more complex functions. In this way the operating system runs entirely in RAM and the Directory Structure, consisting mostly of configuration files, is on the storage medium.

There are over 100 different distributions of Linux designed to provide a range of special environments for users. Some are based on small computers with limited memory and others have software built in to the distribution for Science, Multimedia, Communications or Entertainment.

The Linux mascot is a penguin (due to the fact that Linus was bitten by one during a visit to the Aquarium in Canberra, Australia) called Tux, so named as the coloring of penguins make them look like they are wearing a Tuxedo.

Installing a Linux Distribution

Finding the right distribution can be a fun journey. Most are easily downloaded and copied to a CD or DVD in the form of an ISO file. With the availability of cheap Flash Memory USB sticks its more preferable to install the ISO file on the USB drive. This allows the trial of many different distributions. Somewhere around I have a CD wallet full of early Linux versions.

If you just want to dedicate an old laptop to trying out Linux I'd recommend a distribution like Ubuntu Mate which has minimal hardware requirements, maybe a Gigabyte of RAM, a 32 bit processor with a Dual core and maybe running at 1.6GHz. Many of the Netbook laptops that were popular a few years ago with the Intel Atom processor will work.

Some popular Distributions...
I highly recommend browsing through Distrowatch.com when looking for a Linux Distribution. There are a range of distributions based on Debian like CentOS, Suse and Ubuntu plus Fedora based on RedHat. There are also many different desktops for the Graphical Interface to choose from. The Page Hit Ranking on the right side of the Distrowatch site gives you some idea.

A Linux distribution can usually be installed along side Microsoft Windows in a Dual Boot arrangement. The boot manager in Linux will display options for starting Linux or Windows. This lets you keep all your important Windows software on the same hard drive as you try out Linux. The other option is to boot from a CD/DVD or USB stick (the faster option) and run a 'Live' version of Linux. Running it Live will not allow you to save files as the USB will be 'read only'. In this case a web based file storage system works well. The advantage to running Linux Live is you just carry a USB stick with you when traveling, boot it on someone else's computer and access the Internet anonymously. Current laws allow Customs to take your computer and access any information on it so storing in the Cloud might be a smart move if you have sensitive information.

Lets Install Linux

I'm going to base this on Ubuntu Mate (but almost any other Distro is the same). So we've visited the website https://ubuntu-mate.org/ and downloaded an ISO file for the type of processor in our computer (64bit, 32bit or Raspberry Pi). The 32 bit version will work with just about anything.

There are two versions listed. 16.04 (Xenial) and 18.04 (Bionic). Either should work but Xenial is older. Download one to your computer. It should be under 2 GB in size so slower Internet connections might mean a bit of a wait. The ISO file is a Disk Image and needs to be written to a CD/DVD or USB flash drive. For Windows users the Win32 Disk Imager might be a good choice of program to write(burn) the ISO file.

Once the Disk Imager is installed in Windows, plug in your blank USB stick. Start the Disk Imager and select the ISO file you downloaded and select the USB memory stick. Start the copy to the USB stick. It will only take a few minutes. Once completed the Linux boot files on the USB stick will allow you to either install Linux or run in Live mode (which will have an 'Install' Icon on the desktop).

The boot menu option to Install Ubuntu Mate will step you through the installation, asking if you want to Dual Boot alongside Windows, ask you for a desired User Name and Password to use with Linux (dont forget it...), look for your Wifi network if you have one, offer to download extra files during installation (well worth it if you have the spare time). After about 30 minutes (may vary due to CPU speed) the installation should be complete. It will ask you to remove the install device (USB or CD/DVD) and restart. When the computer reboots you should have the boot menu asking if you want to run Linux or Windows. Usually the Linux option is the default. You will have to interact if you want to start Windows.

If you are successful you should see the default Ubuntu Mate desktop with the Main Menu (Start Button) in the top left corner. The top right has the Time/Date and shows a calendar if you click on it You should also see a Wifi icon. Other monitor icons can be added here. Bottom right allows you to select one of four virtual desktops with the Garbage bin next to it. Bottom left is the 'View Desktop' button, useful if you want to minimise open applications.

The Start Button in the top left corner drops down a list of applications plus it has a shutdown/reboot button if you want to finish your Linux session. Under the 'Internet' tab you will find Firefox for website access. Have a play with different programs, the Office tab has 'Libre Office' programs for productivity.

In a new article I will explore setting up Wine to allow the installation of Windows programs in Linux. this gives the speed and reliability of Linux with the availability of Windows programs. For Radio Astronomy the popular RadioSky program Radio Skypipe can be installed and used successfully.

Using an SDR receiver with Linux can result in rewarding experiments, especially for Hydrogen Line monitoring. A fantastic program called GNU-Radio can be installed and used with RTL2832 SDR dongles to receive at 1.4GHz. The brilliant add-on, Simple_RA, for GNU-Radio gives specific tools for the Radio Astronomer.

16.11.2018. 00:08

A Sky Brightness Meter

To follow on from my article regarding setting up the Wemos D1 Mini to work with the Arduino IDE I thought I'd experiment with the idea of a Sky Brightness Meter using a Light Dependent Resistor in a voltage divider with a 1Kohm resistor.

The Wemos board uses an ESP8266 microcontroller that contains built-in Wifi making it the perfect board for a remote device powered with Solar cells and lithium battery. The Wifi connects to a router nearby and sends the sampled Sky value to a web server that displays the sensor value.

The ESP8266 has a single 10 bit A2D input that gives a value from 0 to 1023. By connecting the 1Kohm resistor from the A2D input to ground and the LDR from the A2D input to 3.3Volts we should get a value of '1' in complete darkness and a value of around '600' in bright light. The LDR used in this project is about 200KOhms dark and 600Ohms in bright light.

The LDR sensor should be located inside a plastic tube that limits how much light gets onto the sensor otherwise ambient light could give false readings (from street lighting etc.)

I have been testing using the https://thingspeak.com/channels/581961 website with the soil moisture Arduino code provided by Mathworks.com. We need only add a Wifi AP name, password and the API Key provided from the ThingSpeak account. The sketch uploads every 30 minutes (or 1800 seconds). I recommend setting it to maybe 5 minutes (using a value of 300). The code provides a 'deep sleep' mode for the Arduino to minimise power usage. A link has to be connected on the Wemos board between 'RST' and 'D0' to enable the deep sleep wakeup.

Click HERE to download my modified sketch using a ThingSpeak account. You will need to add your Wifi information and your 'Key' from your own ThingSpeak account.

When the sketch starts it attempts to connect to the specified Wifi network. The serial monitor on the Arduino IDE can be used to monitor progress. The sketch then starts sending Sky Brightness measurements to the website.

The following is the text from the Arduino Serial Monitor window.

Connecting to WiFi
Connecting to WiFi
Connected
Sky Brightness = 422
Temperature = 21.00*C
Humidity = 61.00%
Connecting to ThingSpeak for update...
api_key=xxxxxxxxxxxxxxxx&field1=422&field2=21.00&field3=61.00
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Content-Length: 2
Connection: close
Status: 200 OK
X-Frame-Options: ALLOWALL
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, OPTIONS, DELETE, PATCH
Access-Control-Allow-Headers: origin, content-type, X-Requested-With
Access-Control-Max-Age: 1800
ETag: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Cache-Control: max-age=0, private, must-revalidate
Set-Cookie: request_method=POST; path=/
X-Request-Id: 990b22c1-7d98-4f50-84ed-b0263ed4531b
X-Runtime: 0.062499
X-Powered-By: Phusion Passenger 4.0.57
Date: Wed, 26 Sep 2018 23:38:43 GMT
Server: nginx/1.9.3 + Phusion Passenger 4.0.57

37
Goodnight for 300 Seconds

17.09.2018. 05:12