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

Home Family Days Out Raspberry Pi & Electronics Blog

Stewart's Blog

Stewart Watkiss website to the world ...

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

The power of open source – Creating a GUI with Python and guizero

January 13th, 2018

This isn’t going to be a guide about how to program a GUI (graphical user interfaces) using guizero (hopefully I’ll add some instruction on that in future), but it does explain which I chose guizero, some of the concepts I used and a bit of an insight into this open source software library.

Adding GUIs was too hard – until now …

The story starts about a month ago, when I decided that I wanted to add a GUI to my Network Quiz Challenge. I actually wanted to add a GUI a year ago, but decided it would take too long back then and it got pushed to the back-burning until now. I already had most of the code in place (it involves a Raspberry Pi running Python talking to a Arduino using PySerial), but it was command line only.

I have some experience of writing code for graphical user interfaces on a variety of platforms, but generally it is the most difficult and time consuming part of any programming project. For anyone that is starting out in programming it can also be an incredibly steep learning curve just trying to get started in GUI programming. I have created a program before using Python and tkinter (which is the default GUI library for Python) but the code created is quite complex – see NeoPixel GUI for Raspberry Pi.

Networking challenge - with guizero GUI

After looking around a bit I came across a couple of Python libraries that are trying to make the experience of learning a GUI easier, and in the end I settled on guizero. It’s mission “The aim of guizero is to make the process of creating simple GUIs quick, accessible and understandable for children.”

Contributing to the Python guizero library

I started work on the GUI version, but came across a couple of issues. One is that there was a bug in the provided example code which had the x and y values the wrong way around, which I was able to work through and submit the correct details back to the maintainers. The second issue was due to a lack of column and rowspan feature in the grid layout. The grid layout arranges the widgets into a grid going across and down. This is best visualized by thinking about a spreadsheet. If you wanted a header to go across multiple columns in a spreadsheet then you would merge multiple cells together, this is the same using grid layout where columnspan merges them horizontally and rowspan vertically. This is something that tkinter supports (which guizero uses behind the scenes), but because it needed to be configured when creating the widgets it was not possible to use this except by updating the guizero library. I raised this on the GitHub issues page. Fortunately guizero is under active development at the moment so I got a response straight away. We discussed different ways of implementing it and I was able to contribute the code to add that feature. I also updated the document showing an example of how the gridlayout can be used to arrange photos as shown below, which is something that was not possible using the grid layout before.

Python guizero, images with columnspan and rowspan

The code is now in the main code so can be used by anyone else. This is an example of how open source code can benefit the wider community as the things that I implemented for my own requirement will benefit others, in the same way that I was able to build on code that others had done (after all guizero would not exist at all without the contributions of others).

Creating the GUI for the quiz

I only had a short time to create the GUI, as it was needed for January I didn’t start until after I’ve finished studying for my Master’s degree in the December. This was also through the Christmas period where I’ve been incredibly busy with my family and other volunteer activities. So I didn’t have much time to explore different ways of creating the GUI and fell back onto an old tried and tested hack of using almost invisible images to set the column widths. This is an old technique that used to be popular with websites before we had CSS.

It’s a bit of a hack, but it did the job. I may look at alternatives in future which may work better, but as far as a usable GUI it worked well. For this reason I probably won’t be using this code as a teaching example, it’s also quite complicated for learning from as I have used object orientation throughout the code (something that I think is good, but perhaps a bit advanced for the kids that guizero is primarily aimed at). You can see an example of how it looks in the screenshot below. I think it looks OK, not as good as some applications, but considering it was done in a short timeframe then all the main functionality is there.

Screenshot of networking quiz running on Raspberry Pi / Arduino

Another “cheat” is that the speedometer shown in the screenshot above is actually a static image. I created three different images and an appropriate one is shown depending upon the score.

Using guizero and tkinter side by side

One other thing that I needed to do was to use some native tkinter widgets as well as those through guizero. In particular I wanted a File Open dialog, but that is not yet implemented. This is one of the flexibilities of guizero in that in some cases even where something is not yet implemented in guizero it’s possible to just call the tkinter code directly.

Contributing to open source software

Although almost all the code that I write is open source it is normally something I write for myself, either to meet a requirement that I have or as a way to learn something new. I have contributed to some other projects, but as with my contribution to guizero that has been only fairly small. Much of this is due to time as it can take a long time to get familiar with existing code to the point where you can provide a bigger contribution. Much of my time is spent on my family, other volunteer activities (including Scouting and STEM Ambassador), my personal projects (writing and programming) and until recently studying for another Master’s degree.

I’ve now completed my degree so I do have a little more time available, so I would like to contribute more to
a more established project, but I’m not sure what yet. I do think that these GUI frameworks are useful including guizero and pygamezero (similar concept but for creating games rather than regular applications).

It can be difficult when there is already an active team developing the code and you don’t want to get in the way of other development. In this case there was different ways that the span could be implemented, so I was able to discuss it with the existing developers first so that it was consistent with their ideas as well.

Summary

This post is more about the advantages of open source software. Open Source software benefits from the collective contributions of many people and it can bring additional rewards in knowing that you helped someone else. The fact that I could update the library in time to complete my project was much better than if this was closed source.

So if you see an opportunity to fix some code then take a look at how you can help.

Upgraded Networking Challenge for Computing fair

January 12th, 2018

I have written previously about a school computing fair that I helped support. I went along again this year as a way to promote STEM and in particular computing. As I work for a telecommunications company then I wanted to promote computer networking as a career option. I didn’t want to just talk about computer networking as I much prefer something that is more hands-on. I therefore created the networking challenge quiz, which involves a multiple choice quiz which is answered by wiring up the appropriate ports between two patch-panels. If they got the answer correct then it lights up green, get it wrong and it lights up red.

Without having lots of network switches I simulated the networking using an Arduino. I then connected a Raspberry Pi which could tell check the status of the Arduino pins and tell it to update the colour of the LEDs. The old post about this is available: Networking challenge quiz (CLI version)

This worked well, but this year I wanted to improve on it. In the past the pupils had to read the answers from printed paper, so this time I instead provided this through a graphical user interface (GUI) running on a Raspberry Pi, which also allowed me to add pictures associated with each question. Also in addition to lighting up the results on the patch-panel, the GUI showed a speedometer like image showing them how well they did.

Screenshot of networking quiz running on Raspberry Pi / Arduino

This was written using Python and guizero (but I’ll talk about those in more details in a future post).

The quiz worked really well, backed up by one pupil that said it was “great!” and clearly enjoyed taking part.

Most of the questions were ones that I had aimed at the appropriate age group (as an overview of computer networking is included in the school curriculum) and I also included subtle hints in the images. I thought that the scores were a little low (as I wanted the pupils to walk away thinking they had done well) and perhaps they were a little too subtle for some, so during the day I decided to make it a little easier and tweaked a couple of the questions. This is something that I wasn’t able to do last year when the questions were pre-printed, but with the new version it was just a couple of quick changes to the json quiz files. There was one question that was intentionally difficult to challenge those that know lots about computers, which relates to the change from IPV4 to IPV6, I’m pleased to say 4 pupils knew the answer to that question and a few more guessed the correct answer.

At the end I explained that whilst the quiz involved a lot of acronyms and that to the outsider computer networking sounds like a foreign language, that when working in the industry these acronyms do become second nature and so not to be scared off by them.

Networking challenge - with guizero GUI

I’ve made all the code available via GitHub, although it’s really just for this project it may be of use to others.
Penguintutor Github – networking quiz

Review of MeArmPi robot arm for Raspberry Pi

November 30th, 2017

I backed the MeArm Pi kickstarter project earlier this year, and just received the finished product.

It’s a, laser cut, plastic robot arm which has a built-in Raspberry Pi. It is created by Mime Industries who have previously created a similar robot arm without the build-in controller / Raspberry Pi. It can be controlled using built-in joysticks or through programming via a choice of languages.

The MeArm Pi kit comes well packaged. My version included a Pi Zero with pre-installed SD card, although with some models you need to provide your own Raspberry Pi. It also came with a separate power supply.

MeArm Pi robot arm kit

Assembling the MeArm Pi Robot Arm

Opening the box and all the parts were laid out with an excellent instruction sheet complete with pictures for every step of the assembly. Assembly was mostly straight forward using the supplied allen key. It was a little wary at first as the screws do take some screwing in and I didn’t want to break the plastic, but went okay. The one part that was fiddly is the claw module which needed a bit of fiddling to get the bits in the right place. I also needed a screwdriver at this point as the screw on the servo motor was protruding a little.

The Raspberry Pi is mounted within the controller at the back of the arm.

First test of the MeArm Pi

Assembled Mime Industried MeArm Pi robot arm

When connected and powered on you first need to wait for a short while for the Raspberry Pi to boot. It should then be possible to use the two built-in joysticks to control the arm. I found that most of this worked straight away, it could move left and right, the arm could tilt up and down and the claws could be opened and closed, but there was a problem with the main forward and backwards movement.

I followed the troubleshooting advice which was mainly about the screws not being too loose, or too tight (a bit uncertain at first exactly what is correct but you do get a feel for it later). Which didn’t fix the problem. It was after I looked at the web interface that I realised that the servo was moving correctly, but that the small arm on the end of the servo was in the wrong position. I therefore removed the servo, and repositioned the arm using a screwdriver.
This did have to be a certain servo which was marked with the white dot. I expect this was just a one off where the servo was not correctly positioned prior to shipping. Once I realised what was wrong it was an easy fix in the end.

Programming the MeArm Pi

The MeArm Pi SD card image includes a WiFi hotspot and built-in web server. This means that you can connect to the Raspberry Pi straight away without needing to connect a screen or keyboard. If you do need to connect up a screen for any reason then with the Pi Zero at least it does mean a reasonable amount of disassembly, but hopefully that won’t be required.

Me Arm Programming web interface for Robot Arm

Included are four different programming languages from simple block based programming using Blockly to full text based programming using Python. Also included are JavaScript and Snap.

The MeArm Pi uses fservo motors which are controlled using degrees of motion which makes positioning the arm using programming easy and more reliable than normal DC motors.

One thing to be aware of is that the Raspberry Pi has ssh enabled without default passwords. It is good to have the ability to ssh onto the Raspberry Pi controlling the robot arm, but please ensure you change the password when you first use it.

How does the MeArm compare?

There are other robot arms available, but this is the first I’ve seen with a Raspberry Pi built-in to the robot arm. The one I have to compare with is the Cebek robot arm available from CPC and Maplin.

The Cebek robot arm is moulded plastic which gives more substantial parts. The Cebek robot also has an additional motor which gives it more control on positioning of the arm. Where the Cebek does not match up so well is that the motors are very difficult to control with no feedback of the position of the motors. The Cebek arm is controlled using a USB, but only includes Windows software with limited programming ability, although I have written my own Graphical application for controlling the Cebek Robot Arm for the Raspberry Pi / Linux.

Whilst each of the robot arms has their own good and bad points the built-in programming of the MeArm Pi makes it far more appropriate to learn programming, and the use of Servo motors makes it easier to use. So I think the MeArm Pi is the better for most people.

Summary

As a device to help teach programming, the MeArm Pi is an excellent robot arm. It is a little fiddly to put together and I had a couple of little issues with mine, but the programming environment is excellent.

Having the ability to control it using both the joysticks and through programming should mean that this is easy to get started with.

Birmingham Christmas Market, Ice Rink and Big Wheel

November 20th, 2017

Big Wheel and Ice Rink for Birmingham Christmas Market 2017

There have been some changes to Christmas in Birmingham this year. Watch the video to see more details:

Microwave Mug Cake and Cookie Recipes

October 25th, 2017

I wanted to run some kind of cooking / baking activity with the Cub Scouts, however we meet at a community centre which does not have a kitchen. I therefore turned to some Microwave recipes. I tried a few different recipes and in the end decided on two cakes and one biscuit recipe. These are based on existing recipes, but I have made a few changes either to the quantities or ingredients to simplify or to reduce the number of ingredients I needed to provide.

These are all easy to make and taste delicious.

The cake recipes all require a large mug to reduce the risk of overflowing, although it’s not so important for the cookie.
Note that depending upon you microwave it may take a different cooking time. Cooking these for too long may cause them to overflow, so check the microwave at least every 30 seconds. If the mixture starts to overflow the top of the mug then open the door for a few seconds and then continue microwaving until the required time.
Always allow anything cooked in the microwave to rest before eating to avoid the risk of hot spots which could scald.
For chocolate chips I use normal chocolate chopped into small chunks that are often less expensive than buying chocolate chips.

Chocolate Cake

Microwave Chocolate Cake - in a mug

4 tablespoons plain flour
¼ teaspoon baking powder
2 tablespoons cocoa powder
1 egg
3 tablespoons milk
3 tablespoons vegetable oil
Few drops vanilla essence
2 tablespoons milk chocolate chips

Add the flour, baking powder and cocoa powder to the mug and mix with a fork.
Add the egg and mix until the egg is absorbed.
Add the milk, vegetable oil and vanilla essence and mix well.
Add the chocolate chips and fold into the mixture.
Cook for 4 minutes, checking at least every 30 seconds.

Oreo Mug Cake

Microwave White Chocolate and Oreo Cake - in a mug

A delicious cake with the contrast of white chocolate and Oreo cookies.

3 tablespoon white chocolate chips
3 tablespoon milk
½ tablespoon. vegetable oil
4 tablespoon plain flour
¼ teaspoon baking powder
2 Oreo cookies
(Optional) 1 Oreo cookie for topping

Mix white chocolate chips and milk into large mug and microwave for 40 seconds.
Mix with fork until the chocolate has melted.
Add oil, flour and baking powder and mix with fork until flour is completely mixed in.
Break Oreo cookies into the mix and mash up with fork until only they are in small chunks.
Microwave for 60 seconds.
Leave to cool before putting an Oreo cooking in the top (optional) and serve whilst still warm.

Chocolate Chip Cookie

Microwave Chocolate Chip Cookie - in a mug

This recipe does not include baking powder so is more of a cookie than a cake. The chocolate chips can be substituted for dried fruit or other fillings for a different flavour cookie.

1 tablespoon butter
1 tablespoon granulated or caster sugar
1 tablespoon brown sugar
½ teaspoon vanilla essence
1 egg yolk
3 tablespoons plain flour
2 tablespoons milk chocolate chips (or alternative filling)

Put butter in mug and microwave for 30 seconds (or until melted)
Using a fork mix in sugar and vanilla essence.
Mix in egg yolk and then add flour and mix well.
Add chocolates chips and gently mix into the batter.
Microwave for 60 seconds.
Allow to cool for a few minutes before eating whilst still warm.

Learn Electronics with Raspberry Pi – on Humble Bundle

August 22nd, 2017

My book “Learn Electronics with Raspberry Pi” is included in the Lego Mindstorms and Robotics book bundle on Humble Bundle.

Learn Electronics with Raspberry Pi book

Through this you can get over $500 worth of ebooks for a fraction of their normal price, with a portion of the money going towards the charity AbleGamers Foundation.

As with all the Humble Bundles this is available for a limited time only, so you may need to be quick to get hold of it at this special price.

Please note that you have to pay at least $15 to get “Learn Electronics with Raspberry Pi” along with all the other books in the bundle.

If you miss the bundle then you can still get the book direct from Apress: Learn Electronics with Raspberry Pi, by Stewart Watkiss, or through many book stories.

Fire and Rescue Service Challenge Day 2017

July 3rd, 2017

I went to see the Rescue Challenge at Webbs of Wychbold, near Bromsgrove in Worcestershire.

This is an event where various Fire Services from around the UK compete in simulated rescue situations. The most dramatic of which is the two vehicle extraction where one car is positioned on top of another.

Two car RTA - Fire Rescue Service Challenge demonstration

I recorded one of the simulations (this was the last one of the day and was not part of the actual competition) where Hereford and Worcester Fire service have to extract two casualties from the vehicles. You can see the video below:

Raspberry Pi with Google AIY – voice recognition

May 8th, 2017

Google and MagPi (the official Raspberry Pi magazine) have released a project in the magazine using the Google API engine. This is known as AIY and was released with issue 57 of the magazine. The finished project is a cardboard box with a button switch on top. It includes a audio card and a microphone, but the thing that makes this all work is software that connects to the Google Cloud Service using voice recognition to add voice control to a Raspberry Pi and whatever program that you write for it.

Google AIY Cardboard voice recognition for the Raspberry PI

The instructions for getting started are provided at: AIYProjects with Google.
It explains the setup for a Raspberry Pi 3, but I used a Raspberry Pi 1 B+. The one thing I had to do differently is to use a different computer to setup the cloud configuration through the webpage as on the B+ it was much too slow.

You will need to follow all the instructions down to 3.3 which is where it refers you to the action.py file. This is where you can customize the commands to run code on the Raspberry Pi.

Shutdown

As the box is designed to run without keyboard or monitor, one of the first things that I did was to add a shutdown command which as it’s name suggests shuts the Raspberry Pi down cleanly. This is done by adding the following code snippets to the action.py file which is based on an example provided in the file.

The first part is to add a line to the actor instructions.

actor.add_keyword(_('shutdown'), Shutdown(say))

The command above instructs the Raspberry Pi to call the Shutdown command which is included in the action.py file (it actually creates an instance of a Shutdown object and calls the run method).

This is then implemented using the following code:

class Shutdown(object):

    def __init__(self, say):
        self.say = say
        self.shell_command = "sudo" 
        self.shell_args = "shutdown -h now"

    def run(self, voice_command):
        self.say('Shutting down now');
        subprocess.call(self.shell_command+" "+self.shell_args, shell=True)

Now run the src/main.py command and you should be able to press the button (or clap if you have set that up) and say shutdown. You could create your own version that uses other words like “power off” or “activate self destruct” if you prefer.

Controlling NeoPixels

The other thing that I the AIY project for is to control NeoPixels. This is very much work in progress at the moment, but I was already in the process of converting my NeoPixel GUI application to a client-server model using python bottle and a web control.

You can see this in action on the video below:

The NeoPixel code is on github NeoPixel GUI code on GitHub. I am working in a separate client-server branch but it in a state of change at the moment, so you will probably be better off waiting for it to be merged into the master branch at a later stage.

I have then added individual entries for each of the commands to the action.py file. This then uses wget to request the file (future versions will probably use the python webbrowser or something similar instead):

actor.add_keyword(_('lights'), Lights(say,_('lights')))

and

class Lights(object):

    def __init__(self, say, keyword):
        self.say = say
        self.keyword = keyword

    def run(self, voice_command):
        # Get string
        print ("Keyword "+voice_command)
        getcmd = "wget http://192.168.0.106/"
        command = getcmd+"status"
        if ("off" in voice_command) :
            command = getcmd + "alloff"
        elif ("on" in voice_command) :
            command = getcmd + "allon?colour=white"
        elif ("red" in voice_command) :
            command = getcmd + "allon?colour=red"
        elif ("green" in voice_command) :
            command = getcmd + "allon?colour=green"
        elif ("blue" in voice_command) :
            command = getcmd + "allon?colour=blue"
        elif ("rainbow" in voice_command) :
            command = getcmd + "sequence?seq=rainbow"
        elif ("chaser" in voice_command) :
            command = getcmd + "sequence?seq=chaser"
        elif ("disco" in voice_command) :
            command = getcmd + "sequence?seq=theatreChaseRainbow"
        # Hard coded colours at the moment
        subprocess.check_output(command, shell=True).strip()
        self.say(voice_command)

Note that this is a quick hack (which leaves temporary files in the local folder). I will be looking at cleaning up this code in future, but I’m currently working on the NeoPixel side first.

Summary

The Google / Raspberry Pi AIY kit has only been available (via The MagPi) for a few days and so this is just an initial look at what it is capable of. I’ll be looking at improving this code in a future version and perhaps adding voice control to even more projects.

Networking challenge quiz for school IT and computing fair

February 2nd, 2017

In the UK, Year 9 (age 13 to 14) is an important stage which can influence the student’s future career. It is during this year that the students first decide on what subjects to pursue, and in particular whether they will continue to study computer science. I recently attended a computing and IT careers fair for a local school where technology companies and universities were on hand to explain to students what it’s like to study and work in those fields.

I work for a communications company and rather than stand there and talk about working in IT, I created a short hands on networking challenge for the students to interact with. This involved a short multiple-choice quiz on computer networking loosely based around the computing that is in the computing curriculum.

Network patching rack

Network challenge - patch-panel cabling quiz

Instead of answering the questions on paper as they may with a traditional quiz, the students had to connect them up on a patch-panel which would light up green for a correct answer and red for an incorrect answer. As well as interacting with the challenge it gave an opportunity to talk about working in the IT industry and to aspire them to a rewarding career in the field of computing.

Network challenge - inside patch-panel cabling quiz

The original idea for the patching rack was to wire the ports directly to a Raspberry Pi, but for maximum flexibility and to make sure that I could also detect where a cable has not been connected correctly then it meant that I have to wire up 30 connections (6 questions, 24 possible answers) plus one more for the LEDs (using NeoPixels). This is more than the number of available ports on the Raspberry Pi, whilst it would have been possible to use an I/O expander that would have meant creating a custom circuit. Instead I decided to use an Arduino Mega. The Arduino mega is connected to the Raspberry Pi by a standard USB cable with serial communications over USB used to communicate between the Raspberry Pi and Arduino.

Connecting to the Arduino Mega

The back of the case does look like a bit of a birds nest, but that was due to lack of space within the case; it’s not possible to remove the top or sides, so I had to make the cables long enough to extend out of the case and then push them in along with the Arduino.

The connectors on the Arduino are push-in connectors, but I wanted something a little more secure without having the concern that one of the many connections could come loose. I used a prototyping board with screw terminals. The biggest challenge was trying to line up the pins between the prototyping board and the Arduino, but once connected it worked really well. This was simpler than trying to connect multiple port expanders and also meant that I could offload the work of controlling the NeoPixels to the Arduino.

Source code

The source code for the Arduino and Raspberry Pi is available from github at the link below.

Networking challenge – Raspberry Pi and Arduino Code

At the moment the code is quite basic. It is a non-GUI program which runs on the command line that I controlled using a Pi-Top (Raspberry Pi laptop). The answers to the questions are hard-coded into the Python file. This is fairly easy to edit in the source code, and certainly easier than having to push an update to the Arduino each time it’s updated, but I do hope to replace this with a configuration file in future.

How it went

I thought it went well on the day. I would much rather the pupils have something that they can interact with than just spend the day talking or answering questions. You could see that some of the pupils were generally interested and came over to have a go (despite having to compete with a reaction game on the Army stall next door).

There’s some things I’d like to change for next time in terms of the questions, but I enjoyed it and I hope that they found it useful.

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.

Summary

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).

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