Raspberry Pi GPIO programming

DSCF6353 - Copy

GPIO – Starting from the pins up

During the last week of study I have spent a lot of time looking at many online references that relate to Coding for GPIO input and output on the Raspberry PI along with my other single board computers including (Radxa rock, banana Pi and Odroid U3+).

As many programmers will know there are many walls to be climbed while following a path of reference using the web, this has been the case during the last week of my reading for sure.

Just taking the Raspberry Pi alone for the moment, the study blocks relate to the fact that a lot of web pages contain details that are incomplete or are just simply not tested and thus working. You need a lot of time and patience to work through to the point where you yourself have collected enough details that actually work when coded in reality.

I have however now reached a point where I can at least post the details that I have collected, feeling that they work as I have now tested them to do so !!

There is simply too much detail relating to GPIO coding to place in this post alone so here today I am just going to pass on the base ground work that I am willing to use myself, in order to work outwards from them to each of my possible coding routes.

In My last post I introduced the basic concept of GPIO input/output and ended by saying that I would in this post talk about how GPIO is controlled via programming languages.

There are many programming languages that you can install on the Raspberry PI and other GPIO enabled development boards but not all of them are matched well to code for GPIO, I feel that the reason for this is as follows.

GPIO coding has many levels some falling at the hardware level of Machine code and Assembly Language, others abstracted far away in the realm of object orientated programming methods.

Here is an example of using assembly language to turn on an LED light :-

This example requires a simple wiring, using an LED and a resistor (1KOhm, typically) to 2 GPIO pins of the RaspPi 2 header. More information on the GPIO connector pinout can be found here. The black wire is connected to Pin 6 of the header (GND), and the red wire to Pin 7 (BCM 4)

RasPi2LEDWiring

Raspberry-Pi-GPIO-Layout-Model-B-Plus-rotated

Assembly Code by : D. Thiebaut

@ LINK !! blink.s
@ D. Thiebaut
@ based on the following C program:
@
@ #include
@ #include
@ #include
@
@ int main (void) {
@ int pin = 7;
@ printf(“Raspberry Pi wiringPi blink test\n”);
@
@ if (wiringPiSetup() == -1) {
@ printf( “Setup didn’t work… Aborting.” );
@ exit (1);
@ }
@
@ pinMode(pin, OUTPUT);
@ int i;
@ for ( i=0; i<10; i++ ) {
@ digitalWrite(pin, 1);
@ delay(250);
@
@ digitalWrite(pin, 0);
@ delay(250);
@ }
@
@ return 0;
@ }
@
@ To assemble, link, and run:
@
@ as -o blink.o blink.s
@ gcc -o blink2 blink.o -lwiringPi
@ sudo ./blink2

@ —————————————
@ Data Section
@ —————————————

.data
.balign 4
Intro: .asciz "Raspberry Pi wiringPi blink test\n"
ErrMsg: .asciz "Setup didn't work… Aborting…\n"
pin: .int 7
i: .int 0
delayMs: .int 250
OUTPUT = 1

@ —————————————
@ Code Section
@ —————————————

.text
.global main
.extern printf
.extern wiringPiSetup
.extern delay
.extern digitalWrite
.extern pinMode

main: push {ip, lr} @ push return address + dummy register
@ for alignment

@ printf( "blink…" ) ;
ldr r0, =Intro
bl printf

@ if (wiringPiSetup() == -1) {
@ printf( "Setup didn't work… Aborting." ) ;
@ exit (1) ;
@ }
bl wiringPiSetup
mov r1,#-1
cmp r0, r1
bne init
ldr r0, =ErrMsg
bl printf
b done

@ pinMode(pin, OUTPUT) ;
init:
ldr r0, =pin
ldr r0, [r0]
mov r1, #OUTPUT
bl pinMode

@ for ( i=0; i<10; i++ ) {
ldr r4, =i
ldr r4, [r4]
mov r5, #10
forLoop:
cmp r4, r5
bgt done

@ digitalWrite(pin, 1) ;
ldr r0, =pin
ldr r0, [r0]
mov r1, #1
bl digitalWrite

@ delay(250) ;
ldr r0, =delayMs
ldr r0, [r0]
bl delay

@ digitalWrite(pin, 0) ;
ldr r0, =pin
ldr r0, [r0]
mov r1, #0
bl digitalWrite

@ delay(250) ;
ldr r0, =delayMs
ldr r0, [r0]
bl delay

add r4, #1
b forLoop

done:
pop {ip, pc} @ pop return address into pc

———————————————————————

Follow the link at the top of the listing for more details !!

For sure Assembly Language is a very legitimate method of programming the Raspberry-pi or any computer of its type. It has the huge advantage of not even needing an operating system to be loaded when the raspberry pi boots, I will detail the methods of doing this when its appropriate to do so but for now just take it as a possibility for applications where only your machine code is needed, in projects that do not need an operating system, i.e. your TV has no OS! but plenty of code.

NB : As a related foot note – you can do the same as above using compiler based languages that can produce stand-alone machine code routines.

It is at this level of hardware programming that everything starts when it comes to coding for GPIO, the level of direct memory addressing for both input and output. Above this level you will find that all GPIO enabled programming languages follow two routes!

Firstly they can make use of the operating system to control any devices attached to the GPIO pins, Linux and on the Raspberry PI2 and 3, Windows 10 for IOT, are both configured to allow for GPIO pin control or device driver control for hardware devices that are attached as peripherals to the GPIO port.

Secondly languages can make use of code (libraries, units or modules ) that bypass the operating systems GPIO configuration in order to just like the Assembly language example here directly read or write to the pins on the GPIO header.

I feel this is just about the correct amount of information for this post today, my following posts will be a series of posts that will take the form of study notes that follow a route as below :

1.. Looking at any available GPIO information from Broadcom BCM2835-ARM-Peripherals Datasheet , Broadcom Publish a datasheet. The purpose of this datasheet is to provide documentation for all SOC peripherals in sufficient detail to allow a developer to port an operating system to BCM2835.

I have now posted relating to this area here….

I may also contrast and compare this information to that of datasheets available for the Radxa rock and Odroid U3 systems.

2.. A Look at how the Raspberry PI operating systems are configured to control the GPIO port, its pins and its interfaces. The reason for this post will be centred around the fact that you can use the operating system itself to code in the form of shell scripts. All GPIO enabled versions of Linux for the Raspberry Pi and other boards such as the Radxa rock use a file structure in the mounted file systems to pass read and write (input and output) signals to the shell, these signals can be used in a shell script.

Not to cloud issues but it is even possible to use none GPIO enabled programming languages to code for GPIO, if they can open and write to and read from these operating system files, I do however only want to make use of fully GPIO capable languages and their GPIO libraries and modules!

I have now posted relating to this area

3.. I want to construct a full review (that will involve more than one post!) of all available GPIO enabled programming languages starting with Python and followed by languages such as C++ and Java. I have found in the Radxa rock and some Raspberry Pi documentation that included coding examples, only involve – as I said above, opening and closing the related operating system files. To do this is most likely very slow and inefficient and also has the drawback of not producing stand-alone code. While this kind of code is more than ok for testing purposes ! why not work with the final aim of your code being fast and also having the ability to run itself in such away that it can be loaded in any environment with or without needing a particular OS or even one at all !!

Ok that really is enough for this post, back soon !!

Advertisements
Posted in Development board hardware, Development Languages, Linux, Operating systems, Radxa rock, Raspberry pi, Uncategorized, Windows 10 IOT core | Tagged , , , , , , , | Leave a comment

Raspberry Pi development projects and GPIO coding

DSCF6353 - Copy

Ever Since the launch in early 2015 of the Raspberry Pi 2 and followed one year later in early 2016 with the Pi 3, the Raspberry PI development board is now with out question a fully usable desktop computer, provided you just need it to perform any of the standard office and internet tasks performed in most peoples day to day requirements. So both of these models ( 2b & 3b ) perform very well for the operations of which any one buying a credit card sized computer could think of and expect to get.

The Raspberry Pi project however has always been aimed at educational needs in computer science, allowing for the needs of schools and higher education facilities. At its low price of €40 you can fill up the desks of students and allow them to experiment to their harts content, even if they damage them they are very simple to replace.

It is not only in the area of cost that the Raspberry Pi wins however, the fact is that this little computer is much more flexible than any desktop or laptop pc when it comes to the area of learning to intelligently program electronics based hardware devices.

Just like many of the available development board computers available today the Raspberry Pi systems allow you to not only communicate with recognised PC peripherals such as (Disks, printers, scanners, modems and screens) they also provide you with the ability to communicate at the lowest possible level with any electronic device that can be manually configured to connect to the Pi via the provided 40 pin GPIO connector on the Raspberry Pi Board.

Raspberry Pi

You can see this 40pin connector at the top of the PI board in the first of these two images. This is a Raspberry PI B+, the original Pi board in the current B series (B+, 2B and new 3B) Pi’s.

Raspberry-Pi-GPIO-Layout-Model-B-Plus-rotated

The GPIO enabled pins are designated a GPIO number as you can see in the second image here. I will in a later post come back to define the functions of all of these pins, if you enlarge and view this images however you will see that not all of the 40 available pins are in fact given a GPIO number, some being used to provide a positive current of (3.3v or 5v) and then other pins used as a Ground in order to complete a circuit.

The live (3.3v or 5V) pins and the Ground pins are used in one of the very simplest of electronic projects for the Raspberry Pi, the lighting of an LED. This is exactly what your pc or TV does when you first turn it on and can be used in the same way to show that your Raspberry PI is powered on.

The details of this project are HERE…

DSCF6352 - Copy

Just to show that this project works, you can see the LED lighting in the above image, my own project version using a breadboard 🙂

In my following post I want to examine how these GPIO pins and thus any attached device can be programmed using computer code.

It is possible to install any of the programming languages available in the Linux repository including (Basic, Ruby, Fortran, Lisp, Cobol, Python, Pascal and C++ …) however not all of these Languages have the facilities with in themselves to control GPIO pins , so I want to look at which ones have and how they can program GPIO input and output !!

Back very soon…

Posted in Development board hardware, Development boards, Development Languages, Linux, Raspberry pi, Single board computers | Tagged , , , , , , , , , , | Leave a comment

Raspberry Pi 7inch HDMI LCD screen and case, Setup and installation

Raspberry pi lcd screen nigel borrington20160405_0001

This week I received and installed one of the final elements for my Raspberry pi 3 project , a 7 inch LCD touch screen from Waveshare.com , this is a great addition to my Raspberry pi hardware. it can also be used with the Radxa Rock and Odriod development boards along as an additional HDMI Touch screen on a laptop or desktop.

My main aim for this additional device is to free up the Raspberry pi 3 from my main PC monitor and also allow my Raspberry PI 3 to be used for stand alone applications such as a network monitor or as a web server, in both cases using the screen to output monitoring information.

One of the great things about the Raspberry Pi is that because it uses the Linux OS, you can very easily using SSH or VNC connect to it remotely, I still intend to do this even with this screen. The screen however provides the additional ability to turn the PI into a stand alone workstation that can be used for many new and valuable projects. If you added a 5v 2.5amp battery pack you could even uses the Pi (B+,2 and 3) outside in the field in such projects as the PI weather station as a mobile PI.

Below I show how to assemble this unit with some example uses and configurations …..

Assembly

The case for the 7 inch screen comes protected with a sticky paper covering that needs to be removed my damping/wetting it in hot water and then pealing it away from the plastic with your fingers.

Raspberry pi lcd screen nigel borrington20160405_0037

Raspberry pi lcd screen nigel borrington20160405_0036

Raspberry pi lcd screen nigel borrington20160405_0034

For my own installation I am using a stackable raspberry Pi(B+, 2 and 3) case that allows its bottom layer to be screwed to the back of the LCD case as you can see here.

Raspberry pi lcd screen nigel borrington20160405_0031

Raspberry pi lcd screen nigel borrington20160405_0030

You attach the provided metal connectors to the back of the screen cover and then screw on the bottom layer of the Raspberry Pi case.

Raspberry pi lcd screen nigel borrington20160405_0026

Raspberry pi lcd screen nigel borrington20160405_0024

Raspberry pi lcd screen nigel borrington20160405_0023

You can see here that the Raspberry pi 3 attaches very cleanly to the back of the screen case.

Raspberry pi lcd screen nigel borrington20160405_0022

The next task is to attach the LCD panel and front cover to the back case element along with the previously attached Raspberry Pi.

Raspberry pi lcd screen nigel borrington20160405_0020

Raspberry pi lcd screen nigel borrington20160405_0021

Raspberry pi lcd screen nigel borrington20160405_0019

When this is completed , you need to assemble the included stand and attach the HDMI cable along with the USB to OTG cable that enables the touch screen ability.

Raspberry pi lcd screen nigel borrington20160405_0027

Raspberry pi lcd screen nigel borrington20160405_0013

Raspberry pi lcd screen nigel borrington20160405_0011

You can see from the two images below just how the finished configuration looks.

Raspberry pi lcd screen nigel borrington20160405_0005

Raspberry pi lcd screen nigel borrington20160405_0010

A final great use for this case and LCD screen, if reversed on its stand – it to allow you to use many Raspberry Pi HAT boards such as here with the Sense-HAT and get safe and clear access to them.

Raspberry pi lcd screen nigel borrington20160405_0002

You can also very easily connect to a development breadboard by attaching a 40pin ribbon cable to the GPIO pins on the PI, this cable routes very well under the screen stand for great access.

Raspberry pi lcd screen nigel borrington20160405_0003

I am very pleased with this screen , it both provides a very tidy setup and stand-alone control for my new Raspberry PI 3. This will allow me to move my Pi anywhere with the addition of a battery pack it will even let me work on some outside projects. I am looking forward very much to the extra abilities it has now provided!

OH! and it works very well, the screen is bright and very clear and the touch control is perfect!!!!

Posted in Development board hardware, Hardware construction, Raspberry pi, Single board computers | Tagged , , , , , , | Leave a comment

Raspberry Pi Sense Hat, Locating and using the sense-hat.py module

Sense_hat_python_Modules_sysnaptic_01
Raspberry pi sense hat modules

In my last post I introduced the Raspberry Pi sense hat, a hardware module for the Raspberry pi development board that contains the following hardware.

Raspberry Pi Sense hat

8×8 RGB LED matrix,
five-button joystick,
40 pin pass-through GPIO connector

Along with the following environmental sensors:

Gyroscope
Accelerometer
Magnetometer
Temperature
Barometric pressure
Humidity

I also included instructions on how to install the supporting drivers and software, this software includes python 2 and 3 modules along with examples and documentation.

If your not use to developing on a Linux system such as the Raspberry pi then you can easily become lost very early in the cycle, at the point where you need to know what objects/files where installed during the installation process and where these objects have been placed.

This knowledge is not made any easier with with the raspberry pi’s default distribution of Linux “Raspbian” because no software package database management application is installed as default.

In order to find more details for any of your installed packages along with installing new software packages you require, I find the synaptic package manager very good for the Debian Linux package format.

To install synaptic open a command terminal and type the following command :

sudo apt-get install synaptic

Because the aptitude and apt-get applications both allow you to install and maintain Debian linux software packages they are fully integrated with the standard Debian package management datadase.

Synaptic is a GUI based front end to this same package management database system and as such can perform the same functions as the command line based utilities. Synaptic however wins over using the command line in two main areas, these being the ability to search the online package repository database for any given Linux distribution, along with the ability to graphically display information about currently installed packages including (applications, drivers and system/development libraries).

So then in order to find out any details on the installed Sensor-Hat objects including the Python modules you will use, you use the Synaptic package manager to search for any packages installed on your system by firstly clicking on the package “Status” button at the bottom left of the synaptic application window , then by highlighting the status of “installed”.

To search for any installed package objects and files that relate to “senyouse-hat” packages you click on the “Search” icon on the toolbar and enter the text of “sense-hat”. After a few seconds/mins the following package objests will be returned, if you correctly installed the sense-hat packages to support the raspberry pi sense-hat.

you should see the following packages listed :

Python-sense-hat
Python3-sense-hat
sense-hat

as you can see from the images below , in the package listing window you will also get details of each packages ( Name, Installed Version, Latest Version and a Description ).

Sense_hat_python_Modules_sysnaptic_01

To find out more details for a package you simple right click on the package name and then click on the details menu option in the drop down menu.

As you can see in the image above, this presents you with a info window with the heading of ( Common, Dependencies, Installed files, Versions and Description ), you can go read these details for yourself in order to get familiar with the details they show, here I am only interested in finding the installed files so have show this window only.

You can see from the listing of the files that it is a full list of any related object to the packages installed and that it contains files in the “usr/lib/Python3/dist-packages/*” path.

If you have coded using Python then you will be familiar with the concept of importing python modules into your code, these modules most likely contain pre-writing python objects that can be used within your own program. This is not any different with the support code provided with hardware devices like the Raspberry pi sense hat.

The Python module that you import for your sense-hat related code is called “sense-hat.py” and you can see this file listed in the images above. It is a standard python program and can be edited and viewed by any standard python IDE or even by command line editors like VIM or EMACS.

Geany_Sense_hat_python_01

Here I am using and IDE called Geany which has a great interface when related to Python code as it can show all ( Imported modules, defined functions and objects you have defined ), you can see above that it is also fully aware of Pythons syntax needs such as indention.

By both locating you Python modules such as “Sense-hat.py” you can see exactly what functions it has and hopefully if the coder has used good comments – exactly what each function does.

Sense_hat_python_documentation

In the case of the sense-hat.py module, it has also been documented online here , however it is still well worth following what I have done above, as there is nothing as good as reading through the python code to get the feel of what your program will actually be doing when it both imports the module “sense-hat.py” and then calls on its objects and functions.

Posted in Linux Software Repositories, Programming skills, Python, Raspberry pi | Tagged , , , , , , , , | Leave a comment

Raspberry Pi Sense Hat

Raspberry Pi Sense hat

Having installed and configured my new Raspberry pi 3 this week, I am ready to start my first project with it. At the same time as I purchased the Pi-3 I also purchased the Raspberry Pi Sense hat, so I have selected this device as the first hardware project to work with, Some basic details of the Sense hat below …

Raspberry Pi 3 March 2016

Raspberry Pi 3
March 2016


The Sense HAT

is an add-on board for Raspberry Pi, made especially for the Astro Pi mission – it’s going to the International Space Station in December 2015 – and is now available to buy.

The Sense HAT has an 8×8 RGB LED matrix, a five-button joystick and includes the following sensors:

Gyroscope
Accelerometer
Magnetometer
Temperature
Barometric pressure
Humidity

We’ve also created a Python library providing easy access to everything on the board.

Using a Rasbian-Linux terminal prompt you install all the needed Python-3 software as follows ..

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install sense-hat
sudo pip-3.2 install pillow
sudo reboot

As stated the Sense Hat is programmed in Python and the above install makes available all needed PYTHON-API commands, imported into your python script.

There are many examples programs already on-line for you to look at and I will post some of my own documented examples in time but for the moment I want to post here a link to full API documentation for all available commands.

I feel that reviewing all these Python API command is the best starting point as it will provide a complete picture, something that a single simple program will not do.

This way, it will speed up making full use of this great little bit of raspberry Pi hardware ….

So in full then ….

Sense HAT API Reference

Make a cup of tea or Coffee and read through all of these pages. to do so will get you producing programs for this device much faster in the long run 🙂

Posted in Development board hardware, Development boards, Linux, Python, Raspberry pi | Tagged , , , , , | Leave a comment

Raspberry Pi 3 – A first look

Raspberry Pi 3 March 2016

Raspberry Pi 3
March 2016

7/3/2016, and this morning I received a Raspberry Pi model 3 in the post from New-IT.

It has been unintentionally far to long since I posted here on my blog and receiving the new Raspberry Pi is a great time to get going again !!!!

I have already setup the Pi-3, installing Raspbian Linux.

The first and very early impressions are very good, the boot time of the new Broadcom 64-bit quad-core ARMv8 CPU clocked at 1.2GHz is much faster than the Pi-2 although in all honesty the Pi-2’s speed was still very good.

It’s not the speed factor that attracted me to purchase the new Pi, its was the fact that the board has both Wi-Fi and Bluetooth connectivity on-board and this combined with the fact the the CPU is now 64bit offers some exciting prospects for future operating systems that will become available given time.

My main use for this board will be in connection with the Raspberry Pi Sensor hat, developing some Python and C++ applications in combination with my Pi-2 boards used to display the status of the sensors connected to the new Pi-3.

I will detail this project as it develops

Here is a list of Raspberry pi specifications since almost the lunch of the first raspberry Pi four years ago.

History of the Raspberry PI

History of the Raspberry PI

maxresdefault

Posted in Development boards, Raspberry pi | Tagged , , , , , , , | 4 Comments

Linux Software Repositories

Ubuntu Software Centre

Ubuntu Software Centre

Linux Software Repositories

Synaptic Package manager

Synaptic Package manager

One of the key strengths of Linux as an Operating system is the large amount of software that is freely available for installation, much like the Android Apps Store but with a greater history. The main difference between the Android Play store and many of the available Linux repositories is that the software within Linux is aimed at the full range of  installations from desktop to server ! .

I intend to add to this blog reviews and guides, that relate to many of the possible methods of locating and installing some great Linux software. Unlike in the long ago past, Linux now has some of the best software available, in order to build a powerful and fully functioning desktop/server installation.

Libreoffice writer 1

Linux Software has come a long way in recent years with packages such as libreoffice 5, which can stand head and shoulders with Microsoft Office for any scale of office based requirements.

Linux office software has a long history in the open systems world with applications such as ( star office and open office ) being used for many years by some of the worlds biggest commercial institutions.

Libreoffice 5Ref : 50 key places Linux is running

Number of Linux Users

2014 – 73 million, 2015 – 82 million registered Linux users, however you don’t have to register Linux to Download/install and use it! , it is also a conscious act to do so rather than just getting MS-Windows with your new PC … 

Back to Software

Versions of Linux such as Ubuntu and Fedora hold software repositories that have many thousands of packages within them, so Linux software is about much more than office and internet applications.

See : What are Repositories

Posted in Android, Linux, Linux Software Repositories, Operating systems, Software | Tagged , , , , , , , , | Leave a comment

Windows 10 on the Raspberry pi 2

Windows 10 1

Microsoft’s Windows 10 IOT core , has been available for the Raspberry pi 2 since around April to May 2015 and brings the Raspberry pi range of development boards into Microsoft “Internet of Things” arena, alongside other such development boards as the MinnowBoard Max boards along with the Intel Galileo board.

Ever since it’s release I have working on setting up and testing an installation using a Raspberry pi mode 2, so I just wanted to share my initial impressions and experiences.

Firstly I think its important to state just exactly what Windows 10 IOT core for the Raspberry pi is! and what it is not! along with firstly the current methods for project development using Linux.

Raspberry Pi development using a Linux OS

Since the very beginning of the Raspberry pi project the concept has been to produce a cheap small computer that can be used to develop electronics projects ( Such as Robotics and/or Sensor related applications ! ) that can be designed using development languages such as Python or C++. In order to achieve these aims the Raspberry Pi has used ARM core CPU’s alongside versions of the Linux Operating system. With user installed copies of Python and/or C++. As with all Open systems installations building this configuration and related projects is completely free.

This model of systems installation has provided for a completely self-contains development unit that can be controlled locally (i.e. by installing a keyboard/screen and a mouse) or remotely ( Via SSH or VNC over a network connection ! ) for all application and project development stages. The advantages to this configuration are that you are working in a standalone environment, i.e. you only need to work with your Raspberry Pi in order to develop meaningful projects !

Just what is Microsoft’s Windows 10 IOT core and the Internet of things ?

This short introduction below, is how Microsoft has chosen to introduce Window 10 IOT core to its potential users.

“Greetings, Makers!

We are excited to announce the public release of Windows 10 IoT Core for the Raspberry Pi 2 and the MinnowBoard Max. Visit the Windows IoT Dev Center to choose your target board, then walk through the steps to provision your board, acquire the tools, and get started Making. This release of Windows 10 IoT Core requires a development machine running the 7/29/2015 release of Windows 10 (Build 10240) and Visual Studio 2015.

Introduction to Windows 10 IoT Core

Windows 10 IoT Core is a new edition for Windows targeted towards small, embedded devices that may or may not have screens. For devices with screens, Windows 10 IoT Core does not have a Windows shell experience; instead you can write a Universal Windows app that is the interface and “personality” for your device. IoT core designed to have a low barrier to entry and make it easy to build professional grade devices. It’s designed to work with a variety of open source languages and works well with Visual Studio.”

Windows 10 2

So as you can read and see from the above text and image, Windows 10 IOT core, is not Windows 10 on the Raspberry pi 2 , in fact its not a standalone operating system at all !!!!!

Well isn’t that’s very interesting !!! ok lets take a quick look at what it is then !

When you have completed the installation of Windows 10 IOT core, following the setting up and getting going instructions from the link here, you are presented with a very basic screen on first boot, this shows such details as your IP address and basic system details such as installed devices.

Other available screens are a very basic training screen that provides access to the Microsoft’s IOT web site videos, along with an extra screen that shows full details of your Raspberry Pi 2.

Windows 10 3

So then , I think the picture here has becoming clearer as to what Microsoft has given the owners of supported Windows 10 IOT development Boards along what they have not !

What they have not done clearly, is to port a full or even cut down version of “Windows 10” to the ARM processor boards!

So what have they done ?

Well the Windows 10 Installation you have built on your Raspberry pi 2 system is nothing more that an application development and processing interfaces with some basic network management and web-server tools, these facilities provide for access to the board via a TCP/IP connection, wired or Wireless. Windows 10 IOT core allows for development of applications remotely on a Windows 10 based Desktop/Laptop system. It also allows these systems to Install applications for testing and final project release along with monitoring these project based application when they are running live.

As you can see from the above images, along with installing IOT core on a development board, you also install applications onto your Windows 10 Development system, these applications and network services search your local Network for any installations of “Windows 10 IOT” that happen to be broadcasting, once found they allow you to connect to these systems via Windows Powershell and/or using an internet browser.

Windows 10 4

The final element of this configuration is the inclusion of Microsoft’s Visual studio 2015, which provides for application development using its supported Languages such as C++ or C#. If your familiar with Visual studio then this is great , if not you have a bit of a learning curve to navigate around before you can just start coding. For example you will have to configure the IOT modules in Visual studio 2015 in order to manage application development and release.

Summary

So that’s what Windows 10 IOT core on the Raspberry Pi is and is not!

It’s not a small device version of Windows 10 , its not a command line version of Windows 10 and its not even a standalone operation system in the form we all know.

Windows 10 IOT core simply allows you to connect your Raspberry pi 2 to a machine running Windows 10 full! with Visual Studio installed and start developing, simple as that !

Comments

From a personal point of view , I have been left wondering what the point is ? in as much as, I am wondering why at a time when The Raspberry Pi has just been upgrade to a Quad core CPU with double the RAM offering much better performance, would you bother to install Windows 10 IOT core , which does very little with the Raspberry Pi 2 ‘s capabilities.

Well , there are some very good reasons, however they in no shape or form make the Linux operating system redundant for the Raspberry Pi project, indeed to convert the Pi project over to Windows 10 could potentially kill it altogether !!

The only reasons I can think of to use Windows 10 IOT core, is it would allow you to run a Raspberry as a Headless system with a network connection, so that you have no need to purchase a keyboard/mouse or a screen. However this is something you can easily achive anyway with a simple (SSH/TELNET or VNC) client installed under Linux!

For me then this leaves only one possible reason and this is that some project developers may not want to learn the Linux operating system and using Windows 10 IOT core with Visual Studio is a great answer for these individuals.

I personally feel that the reason that Microsoft has take this model of ( Client / Server development !) is that they want to keep developers tied into having to use a Primary Windows 10 installation with Visual Studio 2015 as a part of the equation, You also have to take into account that Microsoft no longer offers a command line ability of control for developing applications or even a text based editor such as is available if needed in Linux. The new Raspberry2 however is very capable of running development IDE’s locally such as Geany or Netbeans, x-windows based applications.

I think that all this depends on how you view your raspberry pi or other such devices, you can see them as dumb but programmable devices that sit at the end of a food chain of development and finally a live active project , such as being a device used to react to readings from a sensor and then performing localized tasks that relate to these sensor reading, or you can see them as standalone computer systems the are very capable of running, as a standalone project with all development and application processing being performed locally. The very fact Microsoft calls Windows 10 for these devices “The internet of things ” (IOT core) should be the clue here! as in they expect your development board to both be programmed and then controlled using a TCP/IP connection, thus the first perspective above.

A factor that you may need to take into account is that you may not want your controller boards like the Raspberry pi to be connected to the internet as it maybe much more secure and efficient to run standalone, in which cases using a local ( screen, keyboard and mouse ) is a better option. Also as already said , Lunix offers many ways to connect remotely such as (SSH , TELNET and VNC).

As a parting comment , I feel that Windows 10 IOT core, is just offering another possible route into developing projects based on Raspberry Pi hardware, however many will worry about seeing their open source system even having Microsoft nudging in at all. For these people however the answer is simple, you have no need to use it, Linux is doing very well in these kind of environments ( along with servers and desktops !) and will remain doing so for a very long time to come , so keep using it !!!

Posted in Linux, Operating systems, Raspberry pi, Single board computers, Windows 10 IOT core | Tagged , , , , , , , , , , | 1 Comment

Linux Configuration files and the command shell .

Linux and Unix configuration files

Linux and Unix configuration files

In one of my earlier posts I talked about Linux operating systems training and the Linux Professional Institute Study Guide (LIC-1).

This study guide is aimed at helping with taking the following Linux Exams :

LPIC-1 Linux Professional Institute Certification Study Guide: Exam 101-400 and Exam 102-400

Using this guide, in my last post I talked a little about the available command Unix and Linux shells and their history,shells used in different Linux distributions. I have also in some of my recent posts talked a little about the available text based file editors such as VI used in the UNIX/LINUX environment.

I feel however that it’s important to show just why Linux has retained a closer link to the text based command line or at least much more so than any currently supported version of the Microsoft windows operating systems.

While the Microsoft Windows operating systems have long since made an attempt to reduce the need for a text based command shell interface, transferring most if not all of the operating systems operations and configuration work into GUI based applications such as the systems control panel, Linux has evolved in such a way that easy and fast access to both a command shell approach and a GUI approach is possible.

Thus Linux/Unix takes a two pronged approach to local or remote systems administration !

One fact here that is very important and something that many desktop/laptop users my not fully appreciate is that Linux is the operating system that is largely running the Internet and Cloud , along with many of the internal computer networks within large companies around the planet, although many large institutions have out sourced their computer needs to the cloud.

See: Why Are So Many Websites Hosted On Linux?

Taking this into account its important to understand that Linux/Unix operating systems have long been divided into two main flavors ( Desktop and Server distributions ). Within the Linux server based world , many of these system are located in large isolated server rooms, that may contain many hundreds of servers running in a climate controlled environment, again this is even more so the case since many companies rent data space and processing power from the cloud these days.

Linux/Unix Internet and cloud servers clearly then make use of the Server distributions/Versions and as such they are mostly managed and configured remotely, i.e. they run in what is called a headless mode , with no keyboard or screen attached. These systems are managed using a remote log-in process such as SSH ( a service that provides a remote log-in to a system and then provides a command shell environment) . When this remote connection has been made usually from a remote desktop system you then have two options in-order to perform administrative tasks on the remote server system, you can on your desktop use an installed GUI interface to manage a admin task or you can do almost anything from the command line by editing application or system services configuration files. Linux and Unix applications and services are very likely to have been design with this double management approach in mind and can be configured with both GUI based Menus or Via editing a configuration file held in the form of a *.conf file on the system.

To show this , from a command prompt type the following :

sudo find / -name “*.conf”

# sudo is needed to give all the needed permissions to everyone of the systems folders!

This searches for any “*.conf” files within the entire disk structure of a Linux installation!

On one of my own systems this returned some 650 individual files, all of which can be edited using a text editor such as VI! or GEDIT

So taking all the above into account it may become a little clearer as to just why Linux/Unix has retained a closer link to a text based environment than say MS-windows has. The main difference between MS-windows and Linux/Unix is that Windows uses a single system wide configuration file call the “registry”, that is both used by system services and individual applications, some think this is better some not.

Many people feel that the advantages of retaining command line skills and provided service for them – is, firstly its just faster than using a GUI environment (OMG! Some many mouse clicks !!!), Linux shells with such features as command completion, a services provided by many shells that allows you to search for and quickly select intended commands along with the files names that you intend these commands to be performed on. Then Secondly a very good reason for using a text based approach to system operations and control is that it saves on network bandwidth , a text based file editor used for changing the content of a ( application or system service and users ) configuration file needs to send a lot less network traffic in the form of TCP/IP packets across the internet or local network than does a GUI based application and as such you will be able to perform an operation much faster! .

A good example of this is if you need to log-in, in order to shutdown an application/system that is taking too much of the systems CPU/processing time, sometimes there is just not enough processing power left to load up a GUI application but just enough to perform admin tasks from a text based command line in the form a shell ! .

In summary

For many people who have only ever known desktop systems, it may appear that it is so far out of date to even think of using a command shell and text based terminal, a little like going back to the early days of MS-DOS or CP/M, until you understand that not only can you do things faster but that most of the cloud and internet is being run by Linux/Unix systems that do not have a screen or keyboard attached and do not even have a GUI windows based system installed, like many of the Linux server distributions being used to run the cloud/internet today.

Learning and maintaining command line skills is still important in the IT industry and will allow you to do your job faster and in some situations it will be the only way to get many tasks performed at all !

Posted in computer fundamentals, Linux, Operating systems, Study guides and exams | Tagged , , , , , , , , , | Leave a comment

Linux command shells

Unix / Linux command shells

Unix / Linux command shells


Unix and Linux command shells

Within the Unix and Linux operating systems , a command shell is an operating system service/application that takes commands from a terminal emulator program or from a script source file and performs any given commands by making calls to the provided operating system API services.

The Linux command shell is one of the main reasons why Unix and Linux remain so favored in the IT business today. The level of control and power that can be taken over a computer system using a shell script or by just typing commands from a command terminal in Unix and Linux is very high compared to a system running MS-Windows.

Large scripts can be written that can automate the editing of system and user files, perform automatic reporting of system activities and performance measurements, perform job control, application install and updates and in fact almost any task you can think of as a systems administrator can be performed using a shell environment without ever going near a mouse.

Many Unix/Linux server systems today do not have a ( keyboard, mouse or screen ) attached and thus are controlled by remote access, using a command line shell from a remote terminal thus shell text based login is much more practical.

On most Unix/linux systems these days you can install many different shells from your operating systems online application applications repository , there are several shells available. Most available shells offer similar functionality, but each has different syntax and capabilities, they include ( sh, csh, ksh, tcsh, bash, zsh and dash ).

Today’s most popular shells include bash, zsh, ksh and dash.

The oldest of the shells are sh and csh both originating from earlier version of Unix.

You can get information on the different shells installed on your system, by looking at the details held by your installed package manager i.e. apt or synaptic package manager, under shells.

In order to select a shell as your default shell, used each time you use a command line terminal. You will need to edit your user account and add the new shell as you default shell, you must logoff and login again for this change to take place.

As shells can be used as an interpreted programming languages. To automate tasks, you may write scripts containing built-in shell commands.

When you execute a script, the shell interprets these commands as if you had entered them from the command-line terminal prompt.

Compared to compiled programs in c++ for example, shell scripts are slow but as they are mainly used for system functions, such as for file operations and not for mathematical calculation or graphics then this is less of a concern that it may appear.

UNIX shells since 1977

Looking at modern shells from 1977, when the Bourne shell was introduced.

The Bourne shell, created by Stephen Bourne at AT&T Bell Labs for V7 UNIX, remains a useful shell today (in some cases, as the default root account shell). The author developed the Bourne shell after working on an ALGOL68 compiler, so you’ll find its grammar more similar to the Algorithmic Language (ALGOL) than other shells. The source code itself, although developed in C, even made use of macros to give it an ALGOL68 flavor.

The Bourne shell had two primary goals: serve as a command interpreter to interactively execute commands for the operating system and for scripting (writing reusable scripts that could be invoked through the shell). In addition to replacing the Thompson shell, the Bourne shell offered several advantages over its predecessors.

Bourne introduced control flows, loops, and variables into scripts, providing a more functional language to interact with the operating system (both interactively and noninteractively). The shell also permitted you to use shell scripts as filters, providing integrated support for handling signals, but lacked the ability to define functions.

Finally, it incorporated a number of features we use today, including command substitution (using back quotes) and HERE documents to embed preserved string literals within a script.

The Bourne shell was not only an important step forward but also the anchor for numerous derivative shells, many of which are used today in typical Linux systems.

Figure 1 illustrates the lineage of important shells. The Bourne shell led to the development of the Korn shell (ksh), Almquist shell (ash), and the popular Bourne Again Shell (or Bash). The C shell (csh) was under development at the time the Bourne shell was being released. Figure 1 shows the primary lineage but not all influences; there was significant contribution across shells that isn’t depicted.

Linix Shell timeline

Linix Shell timeline

Basic shell architecture

The fundamental architecture of a hypothetical shell is simple (as evidenced by Bourne’s shell). As you can see in Figure 2, the basic architecture looks similar to a pipeline, where input is analyzed and parsed, symbols are expanded (using a variety of methods such as brace, tilde, variable and parameter expansion and substitution, and file name generation), and finally commands are executed (using shell built-in commands, or external commands).

figure2

Posted in computer fundamentals, Development Languages, Linux, Operating systems | Tagged , , , , , , , , , , , , , , | Leave a comment