Running Arduino and CH340 on a Pi

As you might know Arduino is a great platform for tinkering , making and hacking parallel to or with a Raspberry Pi. As a microcontroller it has not got all of the capability of a Pi BUT is very useful for using sensors, motors and LEDs like neopixels etc. Combining a microcontroller with a Raspberry Pi is essential if you are creating robotics or advanced control systems involving sensors / actuators. Installing Arduino IDE in Raspbian is now very straightforward and I highly recommend using the command line as opposed to downloading and installing from the Arduino website. So let’s get started with the install; boot up you Raspberry Pi, open Terminal in desktop and type in the following commands;

sudo apt-get update && sudo apt-get install arduino

This will update your repositories and install Arduino IDE in the correct directories for you. After completing install Arduino will be available to your Pi in the main Menu —> Programming ; as shown below (Pi-TopCEED)

OK – this is the all the installation we need for official Arduino boards BUT if we want to use any 3rd party boards based on EPS8266 (IOT applications) or WS2812 (NeoPixel controllers ) we will have to install a CH340 driver so Arduino IDE can recognise the serial port communication protocol via the  USB port. Let’s open terminal again and download the CH340/341 driver – this time from GitHub;

wget https://github.com/aperepel/raspberrypi-ch340-driver/releases/download/4.4.11-v7/ch34x.ko

we will do a step by step installation here so after download has finished we install the serial driver first;

sudo insmod /lib/modules/4.9.35-v7+/kernel/drivers/usb/serial/usbserial.ko

we will then do the actual CH340 driver install and do a reboot;

sudo insmod /lib/modules/4.9.35-v7+/kernel/drivers/usb/serial/ch341.ko

sudo reboot

after reboot we will open terminal again and check install with this command;

lsmod

if you should see something like this – we are good to go:

We are now ready to test a 3rd Party board ; I will use a board supplied to me by 4tronix – a NeoPixel board in development – we like shiny & bright pixels. After plugging the board in to a spare USB port and opening Arduino we will see this upon checking port/board;

serial port succesfully recognising the USB device

board recognised as Arduino UNO (ATmega328)

 

As indicated the USB port is now recognised and the board is identified as an Arduino UNO – as the board is based on the UNO chip; ATmega328 – installation successful.

 

credits/links;

CH340 download / instructions from aperepel’s  Github repo

 

issues and fix for unsuccessful install (comments )

 

CH340/341 Driver install for MacOS High Sierra

 

(To be continued with some geeky programming examples)

. . . share the geek love . . .Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInPin on Pinterest

Backing up a ‘live Pi’ to USB

So backing up a an SD Card from your Raspberry Pi is not necessarily that straightforward ; normal procedure will be to poweroff , remove SD Card and Backup manually on a Mac/ PC.

It is however possible to backup a ‘Live Pi’ via command line/terminal to a USB flash/memory stick WITHOUT any disruption or shutdown of your Pi.

The first thing you will need is a (fresh/clean) USB stick and I’ll take you through the formatting of that first. Insert the ‘Memory Stick’ to a spare USB port on your Pi and run the following command in terminal    ;

df -h

Your device will most likely be listed as /dev/sda1 see pic below

As you can see this USB device (32Gb Sandisk Ultrafit) has already been in use and is formatted – BUT I wanted a clean disk so let’s do some formatting. Unmount the drive first with this command;

sudo umount /dev/sda1

Next we’re going to erase / format it as a NFTS drive but I will then also need to install support for this format first ;

sudo apt-get install ntfs-3g

I will create a directory (folder) for the USB drive (optional) like this;

sudo mkdir /mnt/usbstorage

create ownership with these commands;

sudo chown -R pi:pi /mnt/usbstorage
sudo chmod -R 775 /mnt/usbstorage

We can now format and erase USB drive with this command (NTFS);

sudo mkfs.ntfs /dev/sda1 -f -v -I -L USBbackup

I chose the label USBbackup for my drive (did not work though, it still came out as untitled). Also note I forgot to unmount drive at first.

We can now start the backup of the SD card whilst our Pi is up and running, let’s identify devices type of the SD card;

sudo cat /etc/fstab

You should be able to identify a partition named  /dev/mmcblk0p2 or very similar – lets execute the backup command;

sudo dd if=/dev/mmcblk0p2 of=/home/pi/untitled/AIY.img bs=8M

The cursor will be blinking intermittently for up to 20 mins during the backup process – do NOT interrupt this by shutting terminal down , good time to make a cup of tea. After about 20mins you will get a confirmation of successful backup.

8Gb SD Card  backed up as an AYI.img complete, process/confirmation of backup might take 20 minutes – sometimes longer if working with Class 4 devices.

Sources;

RaspberryPi USB Cheat sheet

Rolf van Gelder’s CageWebDev blog

HTCP guides

. . . share the geek love . . .Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInPin on Pinterest

Pi-Papers

There is a myriad of websites, blogs, YouTube channels and online resources for the use of Raspberry Pi and exiting projects to go with it. There is however nothing like having a printed magazine or a book to follow or assist you through the adventures of physical computing, I will attempt to show you a few worthwhile publications here. The first and probably most obvious publication you should go for is The Magpi which now is  the ‘official’ Raspberry Pi monthly magazine. The issues are often bundled with  ‘surprises’  such as a  free PiZero’s or Google AIY kits – as you do . A 12 month subscription will cost £55 but you will receive a free PiZeroW bundle with that (including case/cables)

Free PiZero ?? The MagPi has evolved ‘abit’ from 2013 – it is now an incredibly easy to read, captivating resource for all geeks ; young and old alike – I think Amy might have grown a bit as well !

The MagPi has a wealth of contributors from the now solid ‘PiCommunity’ and a range of engaging projects to capture the imagination of fellow tinkerers, programmers, hackers across all age ranges. Lucy Hattersley has now taken over for Russel Barnes who now in turn has taken the helm at Hello World – also a mention to Rob Zwetsloot for coming up with some awesome features in the magazine.

 

Hello World covers anything from government policies to Book Reviews and Lesson Plans on Gamedesign, the topic of physical computing is well covered (and yes I have my first copy signed) !

 

As an educator / teacher you will be eligible for a FREE subscription to the recently established Hello World magazine which is far less RaspberryPi centric and takes a broader view of physical computing in education and strategies to promote and further the subject. Although Hello World might seem a bit more academic it is a very good ‘teacher toolkit’ for anyone involved in teaching Computer Science / Computing. Hello World  still contains great tutorials for use in the classoom and with guests writers like Cat Lamin , Alan O’Donohue , Miles Berry and Linda Ljukas the topics covered  are incredibly diverse.

 

David Whale and Martin O’Hanlon’s Adventures in Minecraft is a great guide to using and ‘hacking’ gamimg to learn programming – also a through guide to MineCraft on Pi.

 

Honourable mentions in the geeky world of publishing; Wiley not only has a good range of Pi related books and publications; they have also supported authors like Carrie Anne Philbin, David Whale and  Martin O’Hanlon to get very useful and inspirational publications printed for use in classrooms. Simon Monk is a prolific author of anything RaspberryPI and coding  – his Raspberry Pi Cookbook is definitely worth a read for the beginner and HEY – there is now even a Haynes Raspberry Pi2 Manual for car lovers. O’Reilly publishers have a great range of books and publications on programming and Raspberry Pi hacks all served on amazon both in print and as ePub / PDF. Please leave comments below and Happy book hunt peeps.

 

. . . share the geek love . . .Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInPin on Pinterest

Hello world . . . again !

. . . so it is very difficult to contain myself with excitement as I’ve managed to migrate my neglected blog to being hosted on my Raspberry Pi3 ; all set up with an NGINX .img from DietPi – more to come later – much , much more . . .

. . . share the geek love . . .Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInPin on Pinterest

. . . EPISODE IV !

Well unlike George Lucas  – Derek Shaw & Andy Melder from the Southend Crew CAN actually count – so yes Saturday 22 November saw the 4th instalment of Southend Raspberry Jam – and what a Jam it was. I was unfortunately only able to stay for a short few hours but that was certainly enough to capture the flavour of the afternoon. The Tickfield Centre was very well organised and laid out – this combined with David Whale brilliantly deploying ExploreSTEM Raspberry Pi kits – these funded by IET.

David Whale aka ‘The Wizard’ enthusing young and old alike with his MineCraft hacking skills.

 

An impressive range of activities and lectures were on offer anything from soldering workshops, MineCraft (a must), HAM Radio demo’s and this time a very good Wearables Workshop – this generously sponsored by Sukkin Pang .  So wearables  I hear you say ?? Yes the combination of small and flexible electronic components and textiles makes it possible to create some fairly exiting ‘wearables’ – particularily with bright LED’s.

IMG_0680

The ‘wearables’ workshop quickly sold out ; the combination of wearable electronics and funky sweatshirts is a definite hit with youngsters and families alike.

 

I mentioned the ‘ExporeSTEM Pi Kit’s’ organised by David Whale from the IET ; each case contains everything necessary to start up ; Raspberry Pi, keyboard/mice, a few GPIO extras, SD card and power supply. this makes an event like  this a lot easier to set up; cases also double as a handy monitor riser; Win Win.

IMG_0657

You can NOT have a Raspberry Jam without a MineCraft workshop – combination of gaming and python programming is great introduction to code. Note cases for Pi Kits – very handy.

 

As said I only had the opportunity to attend this brilliant event for a few short  hours; So many people to see – so many activities that I did not get a chance to cover. But I will mention a list of some of the great and good ‘geekanoids’ that are regular supporters of these events ; Richard Saville (aka AverageManvsPi), Paul Brown (MyPifi), Laura Trevail (The Pinnochion), Peter Onion, Jim Darby , Michael Horne and many more – apologies for missing any out.

 

 

. . . share the geek love . . .Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInPin on Pinterest

London Jam – Kano style !!

You could have done worse on a soggy London afternoon than taking a trip up to Whitechapel for a ‘Jam Packed’ Kano hack and code session. Even at the point of entering the space behind the Fox & Ginger pub I realised this was going to be a very busy event.

IMG_0393

A very busy and successful London Jam – well done Team Kano !

Nice bright Orange Kano Kits generously decked out in the hall gave everyone an opportunity to have a go at a very well designed and engineered kit. A wide range of activities taking place – with a multitude of exciting hack and code kits apart from the Raspberry Pi.

The Star attraction was the brilliant Kano kit – fantastic involvement from all ages ; from ‘building’ the computer to boot up and coding.

So this was not a traditional Raspberry Jam as we know it as there was a range of other technologies on display ; Arduino , MakeyMakey , Virtual Reality and a great range of show and tell.

Interactive Banana's !?!? Yup MAkey Makey

Interactive Banana’s !?!? Yup MakeyMakey is a great experimental Arduino based platform – here manipulating Minecraft with bananas !

 

The really important aspect of these events whether its Code Club or a ‘Raspberry Jam’ is the family involvement – no less so with this London Jam;  Learning can be fun – even for us adults.

IMG_0442

Great to see families involved – the enthusiasm is infectious; here exploring littlebits – a great kit for introduction to hardware hacking and coding.

 

There are always notable achievements and innovations demonstrated at Jam’s  and events; Zachary Igielman brought his PiPiano; 14 years old and already a very promising developer. Another notable was Team Aber; Sailbot innovators – demonstrating a perfect marriage of traditional and new technology – very well presented; please support these guys.

Team Aber showing off their

Team Aber showing of on of their brilliant ‘Pi Powered’ SailBots , the team is currently working on a larger version that will cross the Atlantic – autonomously.

 

It was as usual also  a chance to catch up with friends,  fellow geeks and developers – exchange ideas or just have a geeky good time.

Infectious enthusiasm or what ?? Kids having a great time & learning at the same time !
Yes I know, it’s a radical concept 😛

. . . share the geek love . . .Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInPin on Pinterest

Croydon Jam – Deluxe !!

Wow !! What can I say ?!? Just awesome !! First Croydon Raspberry Jam and I think it’s fair to say that it exceeded all our expectations !!

First of all I need to extend a big thank you to all of our volunteers who made this event such a success , the ‘honours list’ at the bottom of the page. As you might guess a fair amount of planning and organisation goes into an event like this – and this was well and truly a team effort – big thank you to Margaret,  Monique and everybody at the LNK unit. I also have to mention my former employer Woolwich Polytechnic School for providing us with Monitors , cables and Raspberry Pi’s – something a Raspberry Jam will not run without. A Raspberry Jam does not run without fuel aka food and drink ; loads of lovely nibbely cakes were provided by Brakes Food Market – deeeliish.

A proud moment for both of us ; I would NOT have done this of without Margaret ; an incredibly focused, organised and lovely person to work with. Thank you Margaret .

I think we knew that it would be a busy day with ticket holders appearing at the doors 1/2 hour before start ; and boy did they keep us busy, nice busy though.

A snapshot of workshops at Croydon Raspberry Jam – anything from coding to hands-on soldering , Sonic – Pi and electronics.

So we had 4 workshops going ; Sonic Pi, MineCraft, intro to Scratch & GPIO and a soldering workshop – this running on a carousel of 5 x 5 x 5 x 5. We were fortunate to also have a wide range of show and tell stalls ; all ranging from Raspberry Pi aficionados like Averageman to more Advanced Tech Startups  such as Pi-Top and Wyliodrin.

As all workshops were sold out we had a few ‘wait list ticket holders ‘ but it’s fair to say that ther was plenty to bide the time with ; Doug Jeffrey’s Dalek and AverageMan’s Raspberry Pi Rover were popular distractions. Once all workshops were running it is fair to say that time flew past all of us -great enthusiasm and positive energy. We managed to squeeze an extra slot of workshops in before 16:00 – all credit to the crews running the workshops.

A few short clips – varying quality but hey its a jam 😛

 

Roll of Honours list:

MIneCraft Workshop: Mick Rideout, Reed Roberts

Sonic Pi: Paul Sinnett,  Saleha Salahudin , Alexa Sage

Scratch GPIO workshop: Christopher Taylor,  Jarle Teigland

Soldering Workshop: Ryan Burwood, Lorraine Sanchez

(Sonic Pi Disco workshop : Derek Shaw :P)

Just being a STAR(s) : DeclanEliza & LNK Crew + many many more . . . .


 

             brakes-professional-food-market

cropped    ModMyPi      4tronix_ebay

Default.aspx

. . . share the geek love . . .Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInPin on Pinterest

And about Time Too . . .

Yep I’m back , better, stronger and even more geeky !

Hopefully my blog will be a bit easier to navigate, and following feed back ; a few more relevant sections added . Check out the new programming sections : Terminal Block and Python Pit – these will hopefully get you up and running with some coding.
More content being added as we speak – so stay tuned.

. . . share the geek love . . .Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInPin on Pinterest

‘Brute Force’

Apologies for disruptions folks – following a number of attempts of hacking and brute force attacks on my blog I have had to enforce security to the N’th degree!

Back to lɐɯɹou very soon.

657

. . . share the geek love . . .Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInPin on Pinterest

Code Club Maker Party

So I took ‘MiniMe’ up to CodeClub today – a free and fun ‘Maker Party’ at the trendy
Lyst Studios in Shoreditch today and a very interesting event it was. The event was geared towards 9-11 year olds, the main purpose to give the  youngsters an intro to the Scratch drag and drop programming language and some hacking activities.

Random Mystery Prize Draw

image

So a quick introduction by Michael Mentessi from Code Club;  starting off with coding by ‘Post-It’ notes.

The  session started off with a ‘challenge’ for 3 teams to instruct a human to walk up to an object and pick it up with ‘single line commands’ only. Each instruction had to be written on a ‘post it’ note and handed to the ‘humanoid’ in correct order.

image

Needless to say some chaos ensued – but hey this is what coding  and making is about: having fun :p  So skills like breaking down instruction into core comments and teamwork was at the core of this  exercise , very valuable indeed.

IMG_0498

Jon Taylor suffering a severe case of Stack Overflow here . . .

 

 

 

 

 

 

 

 

 

 

 

As mentioned this was a soft intro to Scratch so when the laptops were fired up – the task of using the software to program ‘ a simple Ghost Game went remarkably smooth – drag and drop programming is a geat way to start coding.

IMG_0540

Michael Mentessi running through the first Scratch exercise for our young Coder’s – nice Whiteboard

I thought the analogy between Post-It notes and the Drag & Drop modules in Scratch worked extremely well, even the children with little or no experience with the software saw the connection. Given the timespan given for the workshop we saw great progress here – the kids just loved it.

image

Jon Bretman running through a few sequences and timings with Marcus.

The last exercise and ‘grand finale’ was the use of the Makey Makey kit used in conjunction with Scratch , some inanimate objects + a load of bananas and tadaaaa:  ‘ScratchPiano’ !

IMG_0581

Jon Taylor from Lyst-Studio doing a demo of the ‘Scratch-Piano’ to a now very excitable young crowd.

The enthusiasm through the day was infectious, particularly when we got on to the Code and Scratch Piano – great to see technology being used  to genuinely enthuse and educate at the same time.

IMG_0600

Makey Makey kit is in essence an Arduino controller (and very sensitive) with analogue in/out which enables a range of sensors and/or outputs to be connected to the terminals.  Jon showing ‘the ropes’ !

I suppose it was difficult to tell who the biggest kids in todays workshop was – maybe you can help us out there Michael ??

IMG_0607

Michael Mentessi doing a great job troubleshooting the kids projects – spreading a very infectious enthusiasm through the workshop.

Have a look at the YouTube clips below to get a flavour of the day : (choose from playlist menu)

Wohooo – Mystery Prize Draw here:

Mystery Prize Draw for Random comments below  . . .
. . .  totally Random winner chosen very Randomly  😛

 

. . . share the geek love . . .Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInPin on Pinterest