Third party cookies may be stored when visiting this site. Please see the cookie information.

Home Babies & Children Gallery Information Free Software Reviews Blog

Stewart's Blog

Monkeys, megabytes, medical and more ...

(Children, computing, first aid and other ramblings ...)

Getting started with 3D printing using Linux

January 15th, 2017

I have now got a 3D printer. I haven’t done much with it yet and it’s a steep learning curve but I’m looking forward to getting into 3D printing.

Choosing a 3D printer

The first decision was which 3D printer to buy. There are a lot of different choices starting from little over £100 and going into several thousands of pounds. The one that I opted for was one of the more expensive budget ones costing a few hundred pounds. It is made by Wanhao, the model is the Wanhao i3Plus Duplicator. At the time of writing this is out of stock on Amazon UK, but they do have the Wanhao i3 V2 Duplicator. The i3Plus integrates the control unit with touchscreen into the main printer instead of needing additional unit, this does mean it takes up less space on the desk.

One of the things I wanted was a 3d printer that was based on the open source Prusa design rather than a proprietary design. This means that it is possible to upgrade or change the printer in future, such as by changing the printer extruder to support different materials. It’s not something that I necessarily plan to do in future, but I like to keep that option open. It also means that if there is an updated version of the file format then I could potentially use that by upgrading the firmware (software) which may not be available with a proprietary printer. Some 3D printers even go so far as only allowing their own plastic being used such as the XYZ Printing Junior. There may be some benefits to using the printer approved materials, but this could also be restrictive.

Wanhao i3Plus 3D printer

Another benefit of the Wanhao printers is that the printer is supplied partly or fully assembled, whereas some printers are provided as a kit which involves assembling all the individual components. In the case of the Wanhao i3Plus Duplicator then the main parts of assembly were to attach the vertical assembly to the base and connect several wires by plugging them into the relevant connector sockets. This means that the printer was up and running within an hour of opening the box, whereas with some other printers it may take several hours.

Another consideration is that the mains electrical connections are fully enclosed within the printer. On some of the kit printers this is sometimes in the form of a separate power supply block which is connected directly to the mains. Just looking at customer reviews one 3D printers includes the quote “The power supply has to be wired to mains and the live wire is only covered by a small flap..potential for shocks exist…” – see this review. I haven’t verified this myself, but it is an additional thing to consider if you then need to add an additional enclosure for the power supply.

One feature that this printer doesn’t have that I considered is a dual-head. I can see that there are instances where that may be useful, but I did not think it essential for my first 3D printer. It also doesn’t have a self-levelling base, which some 3D printers do include.

This isn’t the only 3D printer which ticks all those boxes, but it is one that did and I’m happy with the 3D printer I bought.

SD Card included with the 3D printer

The most common way to print on the 3D printer is by saving the print files to an SD card and inserting that into the printer. An alternative is to connect a computer directly to the 3D printer, but that could tie the computer up for a long time.

The 3D printer includes an SD card which includes some free software, but that software is Windows only. It also had one sample 3D object to print (although it said that it should have more than that). It does mean that it’s possible to get up and running with your first test print without first needing to find / buy an SD card or connect to the printer by USB.

3D Printer Slicing Software

If you have a 3D CAD file that you would like to print then it needs to e converted to a GCode file which is used by the 3D Printer. This is through a process known as slicing where the 3D object is split into slices or layers. The slicing software can also add additional things, such as additional support material and can determine how much material is used for solid objects (which are normally printed with a mesh rather than solid material).

The most popular slicing software is Cura, which is open source software. There is a version provided by the manufacturer that includes the specifics about the printer, but that is for Windows only. I used the standard Linux version and then for the printer type choose Prusa i3 which gives reasonable results.

Unfortunately the Cura GUI will not work on the Raspberry Pi as it requires OpenGL, but that is still work in progress on the Raspberry Pi, but it will work on Linux running on a PC. The Cura back-end is provided for the Raspberry Pi, but that is command line only.

An alternative slicer software is slic3r. This is available for Linux including the Raspberry Pi repository. The version that is compiled for the Raspberry Pi is an older version and I’d recommend trying to use an updated version as it is much easier to use.

Slic3r needed some configuration for the printer and the following are the settings I used for PLA:
Model: RepRap
Nozzle: 0.4mm
Filament width: 1.75mm
Extruder temperature: 205 deg C
Bed temperature: 60 deg C

Free 3D object repositories

There are many sites that have 3D objects that you can print on a 3D printer. Usually it is a case of downloading the appropriate file and then using the Slicer Software (discussed above) to create the G-Code. The following are a few sites that have 3D files available.

[Please check terms of use etc.]

3D CAD Software

If you are looking to create your own models then you will need some 3D CAD or design software. There are two different 3D design applications that I have used with Linux.
The first is Blender which is a 3D modeller. This is popular for creating 3D visual objects, such as characters used in games and animations. The models can then be exported for use in a 3D printer.

The second is FreeCAD which is a full 3D CAD application. This is particularly useful if you want to create parts that need to interact as you can specify the exact dimensions. Learning FreeCAD is quite a steep learning curve, but well worth it. FreeCAD is available for Linux and works on the Raspberry Pi 3 (although I’ve only tried with small objects, memory will be the main limitation).

If you are looking to learn FreeCAD then I found this FreeCAD Video tutorial by j16out to be useful.

After creating a 3D object then you need to export it as an STL Mesh file which can be opened in the Slicer software.


I haven’t done much with the printer so far, but I’m happy with the results so far.

The combination of Cura and FreeCAD works well on Linux (except the Raspberry Pi for Cura).

Gloucestershire and Warwickshire Railway Santa Special Steam Train

December 21st, 2016

This Christmas we visited the Gloucestershare and Warwickshire Railway for the Santa Special steam train. The train was from Cheltenham Racecourse railway station. The train was fully booked, but there were enough tables for everyone to find a comfortable seat.

GWR Santa Special Steam Train

We started with a train journey to the “North Pole” station. The carriage was decorated for Christmas and the staff on the train came around to tell us where to go when we passed through the magical tunnel to the North Pole. On arrival of the station we visited Father Christmas in a converted train carriage, where the kids received good quality presents.

GWR Santa Special meeting Father Christmas

We then enjoyed free mince pies and coffee in the station cafe before our journey back home. There was also some Christmas songs at the station. There was a snow machine just before we visited Santa, but the one thing they could have done with is a bit more snow.

After boarding the train home we were told that it was delayed a little, but at least we were on the train in the warmth. The staff were also great and came around to each compartment to let us know what was going on and check that we were all okay [hint to other railway companies – this is how to provide great customer service]. While we were waiting we played a game which had been the present from Santa to our daughter.

The train then took us back to the racecourse. The length of the train ride was just about right. Enough time to enjoy the journey without it getting boring. As an alternative for younger children they also run a diesel rail-car train where Santa visits the children on the train.

We had a great Santa experience.

For more details about this and other train journeys see Gloucestershire and Warwickshire Railway.

Birmingham Christmas Market 2016

December 12th, 2016

Video and photos from our visit to the Birmingham Christmas Market in 2016.

Element 14 BOO! Pi Costume Contest

November 9th, 2016

Around Halloween 2016 Element 14 ran a Costume Competition for wearable tech projects.
Boo! Pi Costume Contest

I was already working on a Wizard of Oz costume so I submitted my project to the competition.

Wizard of Oz wearable electronics costume - powered by Pi Zero

You can find out more about the Raspberry Pi – PiZero NeoPixel bow tie here.

My costume was one of the winning entries and I have now received a bag full of goodies, including a Raspberry Pi 3 and Sense Hat:

Element 14 Raspberry Pi bag of goodies

A big thank you to Element 14. Find out more on the Element 14 community site including future competitions, projects and forums.

Wizard of Oz Costume – Wearable electronics with Raspberry Pi, Pi Zero

October 26th, 2016

Wizard of Oz wearable electronics costume - powered by Pi Zero

I decided to create a Wizard of Oz costume for Halloween this year. As you probably know The Wizard of Oz wasn’t really a wizard at all. He used a mechanical machine to convince the citizens of Oz about his magical abilities. What you may not know is that he was more than just a charlatan, but also an evil dictator with the truth exposed in the Musical Wicked (based on Gregory Maguire’s novel), so quite appropriate for Halloween.

Rather than go for the traditional costume I created a modern interpretation of what The Wizard may look like if he had access to todays technology. So using a Raspberry Pi and some wearable electronics I’ve created this costume.

How it works

The LED circuitry is based around a NeoPixel circuit that I’ve used several times already (Raspberry Pi NeoPixel Worksheet). I’ll add more details on the extra parts to create the wearable project in future.

Future development

I’m currently working on a smaller version of the circuitry using a ProtoZero board and hope to add the ability to play music files in future.

Boo Pi Costume Competition

For anyone else creating a Raspberry Pi Costume at the moment (2016) then there is a competition run by Element 14 looking for the best wearable tech costumes. If you have a better idea for a Raspberry Pi wearable costume then see the link below:

Electronics and Raspberry Pi Halloween Projects

October 23rd, 2016

These are some of the Halloween Projects I’ve created.

Haunted House

A scary haunted house, using a Raspberry Pi, home automation, electronics and scary music.

Halloween Raspberry Pi project

Raspberry Pi Haunted House

Raspberry Pi MotionSensor Jack-O-Lantern Pumpkin

My son’s Motion Sensor based Light Up Pumpkin project

Motion Sensor Raspberry Pi Halloween Pumpkin Jack-O-Lantern

Halloween Motion Sensor Pumpkin

Wizard of Oz Costume

A Wizard of Oz Costume with light-up bow tie.

Wizard of Oz - wearable electronics costume

Wizard of Oz costume using wearable electronics and a Pi Zero

Scary Pi-ano

A Makey Makey based touch Piano, programmed in Scratch.

Raspberry Pi Makey Makey - Scary Pi-ano

Halloween Scary Pi-ano – musical piano with Makey Makey

Indoor Halloween Haunting

A motion sensor based flashing light sequence.

Halloween PIR Motion Sensor light

PIR based Halloween Lights

Raspberry Pi Motion Triggered Halloween Pumpkin Jack-O’-Lantern

October 23rd, 2016

My 8 year old son has now completed another Raspberry Pi project. This project is a Halloween Pumpkin, or jack-o’-lantern, which is triggered whenever someone comes near.

Raspberry Pi Motion Sensor (PIR) Halloween Pumpkin Jack-O'-Lantern

It uses a PIR motion sensor to detect someone entering the room and then lights up a sequence of NeoPixels. In this case these are static green and blue NeoPixels, although with a few changes to the code they can light up in any colour, flash or run in any sequence you could wish for.

You can watch my son demonstrating it on the video below.

The project uses GPIO Zero for the PIR Motion Sensor and a simple voltage level shifter to control the NeoPixels.

Lighting up the NeoPixels

I used a long strip of NeoPixels that I happened to have, but you can also use a small strip or large ring for a similar (though less bright) effect.

The NeoPixels do need a little setting up, so I suggest getting these working first before adding the code for the motion sensor. The NeoPixels require a simple electronic circuit and some libraries to be installed which drive the LEDs. This is explained in the worksheet below which covers creating your own circuit on a breadboard. You can also use a PCB such as the MyPiFi NeoPixel board or by creating your own HAT / add-on board for the Raspberry Pi.

I hope to add details of an add-on board in future.

Using the PIR motion Sensor

The motion sensor used goes under a number of different product names including “D-SUN PIR” and is also the one included in the CamJam Raspberry Pi kit. This sensor has 3 pins to connect to the Raspberry Pi: Ground, 5V supply and a Data Out. Although the sensor uses a 5V supply it only gives out a 3V signal so this is directly compatible with the GPIO ports. This has been connected to GPIO 26, which is the physical pin 37. This was chosen to avoid the first 26 ports which were blocked due to the add-on board used.

The motion sensor is easily controlled using the GPIO Zero library which is now standard on the Raspberry Pi.

Source code

The source code to bring this all together is shown below.

from gpiozero import MotionSensor
from neopixel import *
import time

delay = 10

FREQ = 800000
DMA = 5

pir =  MotionSensor(PIRPIN)

while True:

    print ("you can't hide")
    for i in range (0,LEDCOUNT,2):
        strip.setPixelColor(i, Color(255,0,0))
        strip.setPixelColor(i+1, Color(0,0,255))
    for i in range (LEDCOUNT):
        strip.setPixelColor(i, Color(0,0,0))

The code should be placed in a file (eg., which then needs to be executed using sudo so that it runs as the root user (adminstrator):

sudo python3


You will see that when triggered the code sets the NeoPixels to two colours, one for the odd pixels and one for the even ones. You could modify this to use any colour that you wanted and you could even add some code to make the LEDs flash etc. If you create a colour sequence or flashing lights then you can remove the time.sleep entry and have the sensor usable once the light sequence has completed.

You may also want to look at having the program run automatically on startup. This is explained in the following guide under the section “Adding to systemd startup”: TightVNC startup with systemd
Note for this you want to change the ExecStart entry to run the above command (without the sudo prefix) and set the user to root.

More Halloween Projects

Restore dual boot with Ubuntu when Windows 10 update overrides the UEFI settings

October 10th, 2016

As a Linux user it’s now very rare that I run Windows on my home computer, but when I do it’s usually because of something important. At the moment it’s because I’m taking some exams on my MSc course and the remote proctoring software only supports Windows and Mac.

It’s therefore rather important that my laptop is able to boot into Windows occasionally, but it’s a shame that Microsoft doesn’t seam to have the same concern for stability that I do. If they did then I would think it at least basic courtesy to warn me when a Windows update could leave my computer unusable for several hours and will trample all over the settings I had previously configured.

Fortunately this happened just after my exam, as if this had happened before then this would have been much, much worse than just wasting several hours of my time.

It all started with what I believe is the Windows 10 Anniversary Update. This is a significant update to Windows 10 adding new features in addition to security and bug fixes. As this is a big update then I would have expected a bit of warning – perhaps a “Do you want to proceed with the update now?” or similar. Microsoft has other plans, presumably they don’t want people to skip the update (as users have avoided with the big jump to Windows 10), so they just made it part of the normal “Shutdown and install updates option”.

It took sometime for the computer to shutdown, but the problems became apparent when trying to boot the laptop up again. It first went into the installing updates which was very, very slow. After about an hour I thought it had crashed, but in fact it was still installing the update and a short while afterwards I saw the status creep up to 26% complete. It then continued very slowly until it reached 36% which left the following screen:

Windows 10 anniversary update - stuck on please wait screen

The screen says that this will take a while, but this was getting ridiculous, so I gave up on what I was trying to do and went to bed. I woke up the following morning to see that it was still trying to install the update.

Although the screen said “Don’t turn off your PC” by this stage I had little other choice than to force-ably power down the computer. I then rebooted and Windows 10 rolled back the update restoring a working version of Windows.

It sounds like I’m not the only one to have suffered problems with these Windows 10 updates as seen in this story (ThaiVista).

It was tempting to leave disable the windows update and leave the operating system as it is, but leaving a system without recent updates is generally a bad thing, so I then spent several more hours updating all the drivers I could find and re-trying the update. I believe that it now has the latest updates installed and appears to be working, although that was only the start of my problems…

Windows 10 prevents booting into Ubuntu

As I mentioned previously I’m really a Linux user and my laptop primarily uses Kubuntu, which is a variant of Ubuntu Linux. I had already made several configuration changes to my computer to ensure that dual boot worked well, but Microsoft appears to have had other ideas, as since the update it was no longer possible to boot into another operating system. These are the changes I had to make to be able to boot into Grub and hence boot into Linux.

I don’t know whether this is deliberate, that Microsoft doesn’t care what impact the updates have on the user, or that they don’t know what they are doing.

Turn off fast startup

The first thing is to disable fast start-up in Windows 10. This is needed to ensure that the computer full shuts down allowing a different operating system to be booted. This is something I had already done previously, but that has now been reset back to it’s previous setting.

To prevent the fast start-up then the “fast start-up option” needs to be unchecked.
As you can see Microsoft makes this option really easy to find, just to goto:

Start -> Settings -> System -> Power & Sleep -> Additional Power Settings -> Choose what the power buttons do -> Change settings that are currently unavailable -> Turn on fast start-up (recommended)

Make sure that there is no check mark against that option.

Restore EFI to Ubuntu’s Grub loader

The update has also removed Linux from the UEFI loader (replacement for the legacy bios on 64-bit computers). Once again Microsoft has overwritten the changes I have made and makes it difficult to set it back.

First check the file name matches the one I have on my computer which is “\EFI\ubuntu\grubx64.efi”.

You can’t view EFI directly in Windows Explorer etc., so instead right click on the Windows logo and choose:
Command Prompt (Admin)

Choose a drive letter that isn’t in use (I used j: ) and then mount the first partition on the disk drive.
mountvol j: /s

You can then navigate into that drive using:

and cd into the appropriate directories.

Check that there is a file called:
If not then you may need to perform the restore from a Ubuntu rescue disk.

If that file does exist then it can be set as the default boot option by entering the command
bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi

Check that the dual-boot works

That should be it, it should now be possible to shutdown from Windows and choose Linux (Ubuntu) or Windows from the Grub menu (assuming that is how it was previously set-up).

If that doesn’t work and you need to check the UEFI options directly then from Windows 10 goto Windows logo -> Settings -> Update and security -> Recovery and choose Restart Now which is under the Advanced startup option.

When it boots into the recovery mode choose
Troubleshoot -> Advanced options -> UEFI Firmware Settings and then reboot.

You should then find yourself in the UEFI settings where you can make changes such as disabling Secure Boot.

PyconUK 2016 – Sending secret messages with a micro:bit

October 3rd, 2016

Another year and another Pycon UK. For 2016 the UK’s community Python Conference was held in Cardiff, Wales. It’s also the fourth year that they’ve included a special Children’s day on the Saturday. This included a day of kids coding on Raspberry Pi computers (Pi-Top CEED) and this year each child received a micro:bit to provide a new way of coding.

The final workshop session was a open “work on a project” session and many of the children decided to use their new micro:bits in their project. My son’s idea was to use two micro:bits (luckily I’d taken an extra one with me) to be able to send messages between the micro:bits. This would allow him to send secret messages to his friends in class [not that we’d encourage such things :-)].

Pycon UK 2016 - kids lightning talks

So we set about writing the code using using the Mu editor on the Raspberry Pi and then using the editor to flash the code directly to the micro:bit. This is a much better way to write code to the micro:bit compared to having to generate the hex file and then drag it onto the micro:bit.

The code is fairly simple thanks to the provided radio module. Essentially it looks for button presses on the micro:bit and depending upon whether A, B or A+B are pressed then it sends a different message. The other micro:bit listens for the signal and then displays a message using the LEDs on the front of the micro:bit. We only had about an hour to get the basic code working, so we didn’t include the ability for bidirectional messages, which would probably be a bit hard for such a young programmer. The python code is included below:

Transmitting micro:bit

from microbit import *
import radio


while True:
    a = button_a.was_pressed()
    b = button_b.was_pressed()
    if a and b:
    elif a:
    elif b:


Receiving micro:bit

from microbit import *
from microbit import display
import radio


while True:
    received_text = radio.receive()
    if (revieved_text == 'boring'):
        display.scroll ("This lesson is boring")
        sleep (100)
    elif (received_text == "fun"):
        display.scroll ("This lesson is fun")
        sleep (100)
    elif (received_text == "playtime"):
        display.scroll ("Shall we meet at playtime")
        sleep (100)

As you can’t see there aren’t many comments in the code, but then it should be fairly obvious to see how it works. The sending and receiving of messages is handled by the radio module and the main thing to consider with the button press detection is that it includes the test of both a and b being pressed first (otherwise the if would see both buttons being pressed as “a” being pressed).

My son and gave a short demonstration of the project during the lightning talks on the main PyconUK stage. This is included in the video below:

Pi-Top Raspberry Pi laptop computer

October 1st, 2016

During my visit to the Raspberry Pi factory arranged by RS I also entered into a competition to win a Pi-Top computer. After a close run vote, I won. So I now have a Pi-Top Raspberry Pi laptop.

Pi-top Raspberry Pi laptop computer

The Pi-Top is a similar size to a regular laptop, but involves some assembly and uses a Raspberry Pi for it’s motherboard. As well as a laptop they also sell the Pi-Top CEED which is a screen with built-in Raspberry Pi, which you connect your own mouse and keyboard. Both are available in black or a colourful bright green.

The Pi-Top does involve some assembly to put it together. This is not too difficult and it’s fully explained in the guide, but a little fiddly at times. Essentially each part is modular and it’s a case of putting them together and connecting the wires and connectors. No special tools are required other than a supplied allen key (hex key). One problem I had was that I believe the screws for the screen hinge were screwed down too tight as the instructions assume that they are fully loosened off, but I was able to get the screen connected eventually. The assembly should not put anyone off as the sort of people looking for a Raspberry Pi laptop are also the sort of people that shouldn’t be too afraid of assembling the Pi-Top.

Once assembled the Pi-top functions much like a normal laptop. It has a long battery life (approx 10 hours) and is expandable through an innovative plug-in system. The optional expansion includes speakers (available as a single mono speaker, or buy two for full stereo) and a prototyping board which can be used for making your own circuits or for connecting HATS to the Raspberry Pi.

The Pi-top can be used with the normal Raspbian OS supported by the Raspberry Pi foundation or the Pi-top’s own Pi-top OS. I have mainly used the standard Raspbian, but the Pi-top OS does include some additional integration with some of the peripherals and is tailored especially for use in education. The Pi-Top OS also includes CEEDuniverse which is an interactive game to teach computer programming to children.
I have been through some of the activities with CEEDuniverse, which are very good, but I haven’t actually tried that to teach programming to children yet.

I’ve also had an opportunity to see the Pi-top CEED being used to teach programming to children at the PyconUK kids day where they worked really well.

The main benefit for the pi-top is that it integrates everything needed to get started with the Raspberry Pi without losing any of the expandability and access to the GPIO ports. All the workings of the Raspberry Pi and expansion board are hidden under a plastic cover which just slides out of the way when you want to get inside. In fact using the pi-topProto board the GPIO pins are conveniently placed in the centre of the Pi-top which works really well.

Pi-top Raspberry Pi laptop with electronic circuit on proto board

The pi-top has been really convenient for taking along to Raspberry Jams and similar events as it saved having to borrow screens from the desktop computers in the classroom.

There are a few little things I would have liked to see. It would have been nice to be able to get to the HDMI port to connect to a projector, although I think that is quite a big ask. It’s beyond what the pi-top is supposed to be, but would be a nice feature.
Also the keyboard feels a little soft to type on and when touch-typing it occasionally misses a key press. On the plus side it is available as a UK keyboard, and for the target audience of use in schools and for school children then they will probably not have that problem.

There are other cases that integrate the Raspberry Pi with a screen and/or a keyboard and touch pad, but as far as I am aware this is the only one that integrates them into a single laptop and it does the job really well. If you are looking to equip a class with Raspberry Pi computers then the Pi-Top CEED may be a better fit (as it’s even cheaper), but I’d highly recommend the Pi-Top especially if looking for a more portable solution.

Twitter Status - follow stewartwatkiss

UK days out, children and holiday information is also available on the Days Out Diary web site
Linux, LPI and the Quiz / Test Program posts are also available on the Penguin Tutor website
First Aid Information, first aid games and first aid practice test / quiz entries are also available on the First Aid Quiz Web site