Category Archives: Raspberry Pi Zero

RPI Prototyping

Prototype boardRemember a few blogs back where we were talking about prototyping boards for Raspberry Pi and similar and I showed a sample board and someone came back and said “Ah but you can get cheaper on AliExpress” – well, I bought one…

Here’s the link - £1.09 in sterling, free postage…. and I have to say… pretty good. Took a few minutes to solder the gold plated connector – holes are PTH and look ok.

So – if you click on the image you might get a larger version… the board came with the connector and nuts and bolts which I managed to lose within minutes of bringing the board into my office.  So you get a 5v rail and ground rail on the left. Over on the right there are full length 3v3 and ground rails and a whole line of holes for every pin (other than ground and power as you already have them).  The rest are all uncommitted runs.  

I have to say, for that price if you’re into tinkering – it’s a winner.  Should work with any of the Pi-type boards with the same connector – though clearly some of the IO pins will be wrong on some boards.  Very nice – just ordered another one.

Facebooktwittergoogle_pluspinterestlinkedin

The Real Raspberry Pi

I’ve been using the likes of FriendlyArm boards and similar for so long now, struggling at first with GPIO and I2c and as regular readers will know, finally pretty much mastering it due to hard research and more importantly, the works of people you’ll find links to in other articles in here….. that I’ve pretty much ignored the actual Raspberry Pi for some time.

Until this week when my friend Jonathan sent me a Raspberry Pi 3 to check, as he’s been having trouble with “the script” and I could not help as my RPI2 installations worked just fine.

Continue reading The Real Raspberry Pi

Facebooktwittergoogle_pluspinterestlinkedin

Raspberry Pi Zero WiFi

Raspberry Pi Zero WiFiI should have just entitled this “Raspberry Pi” as it keeps expanding (now covering the rest of the Pi boards – but keep reading).. as you will see, the title is a little restrictive given what we’ve done over the last few days. Friend Antonio over Italy and I (still stuck here in the frozen wastes of the Northeast of England) have been working quietly in the background on making the script compatible with the new Raspberry Pi Zero WiFi (RPiZW) having already managed to get it working on a range of boards and operating systems including RPi2, RPi3, Debian, Xenial, various Orange Pi boards, various FriendlyArm boards, the Odroid C2 and more.

At under a tenner, no-one can claim this tiny WIFI enabled RPiWZ is going to break any records. It is slow. very slow compared to a Raspberry Pi 2 or perhaps an Orange Pi Zero... and at first attempt I nearly gave up after waiting a whole day for my script to run (and fail) - something that can take maybe an hour on more powerful single board computers such as the RPi3 or the Odroid C2 etc.

However, having failed to get the script to run on the official Raspbian distribution for this board, for a variety of reasons, we next tackled DIETPI. Here, this slimmed down operating system comes into it's own and the PI Zero WiFi runs a lot more swiftly than it does with stock Raspbian. Still, by lunchtime yesterday I'd stopped the script due to various errors. By late last night however, with a little manual injection I had everything running on this tiny board - Apache, PHP, Node-Red with all my usual Nodes, MQTT, Sqlite, PhpLiteAdmin, Ha-Bridge, MC and much more, all with no manual intervention (just as well, given the time it takes).

This weekend while I was out shopping for a new milk-frother, our friend Antonio over in Italy was busy working on some last minute amendments to the script which, you'll recall now runs on a range of devices and systems including Xenial and Debian. We’ve now completed the  updates to the script, including the ability to run on the RPiZW.  The sheer size of the RPiZW (or rather lack of it, being exceedingly thin) means you could fit this board, able to control a house, on the back of an LCD display and have the whole thing mounted in a reasonably slim wall-mounting box. The Orange Pi Zero on the other hand has that large Ethernet connector which means a slim case is out of the question.

There is of course competition for this board, the Nanopi Neo Air is actually smaller (different format of course, being square) - and no doubt a lot faster - but like the RPiZW it has no Ethernet. One issue I've had with many boards is that of WIFI reliability. Up to now, the WIFI on the RPiZW is rock-solid - just as well, as it doesn't have hardwired Ethernet capability (well, not without some soldering or a compact-size-defeating USB dongle). The NanoPi on the other hand works well and is way better technically but I'm not 100% happy about the WIFI on the latter. All of this could change of course with future software updates.

Raspberry Pi Zero WiFi: Here’s what I did (total time 4 hours -  VERY little of which I was actually doing anything – well, watching YouTube videos actually):

  • I grabbed the file DietPi_v145_RPi-armv6-(Jessie).img
  • I used SD Formatter to format a 16GB card then Win32 Disk Imager to blow the image onto the SD card.
  • I plugged the card into the RPiZW and powered the board up, plugged into a screen – and with keyboard and mouse connected via a USB hub.
  • I started up the Pi – that takes a little while and it eventually wants you to login as root (initial password dietpi).
  • As per initial dialogs in DietPi-Config, I set up the WIFI.
  • The board went off to do some downloading and came back to the DietPi-Software - I swapped from DropBear to OpenSSH Server and lighttpd to Apache2 - but didn’t install anything else.
  • At the end of that I could get into the board remotely using WINSCP and no longer needed the keyboard and mouse.
  • I copied the script across to the root directory – ensuring it was in Linux format (Line feeds only) and that it had execute permission.
  • It went off and automatically set up a PI user with password “password”. I logged into the board (using WinSCP) as user  pi. I copied the script across again and once again made sure it had execute permissions. I ran the script.
  • Several items were downloaded. I waited patiently until the main menu came up. I accepted all defaults but added HA-Bridge.
  • I was asked for a user name (user) and password – and an admin name (admin) and password… (you can opt out of that now and leave defaults if you like) and at that point the script – as you’d expect – went off for 4 hours (using a half-decent microSD from Samsung) doing it’s own thing. And yes, watching the WEBMIN setup DOES feel like watching paint dry.
  • At the end of all of this – I rebooted the board – and that was the end of that – a perfectly working RPiZW.

Something that has come out of this – is the importance of SD speed… I’ve always known this but NEVER has it been as obvious as it is here with this slower board. 4 hours – recall I mentioned an earlier attempt which failed but also took longer. Well, now I’m using a decent Samsung microSD.

Raspberry Pi Original: Which brings me to the Raspberry Pi – not the 2 or 3 but one of the originals. The script appears to be working perfectly now even on pre-Pi2 boards with full size SD card (Raspberry Pi © 2011.12). Sadly when I was using those I was not aware of the need for the best SD and THIS install took 7.25 hours – if you plan to try one of these – get a decent SD! Still – all working so an otherwise useless Pi is now up and running.

Raspberry Pi Zero: On a whim, I took a copy of the microSD I used on the RPiZW and dropped it into the lowly, cheap and cheerful Raspberry Pi Zero (the one with nothing) – I then took a USB adaptor and plugged it in, with one of those really cheap unbranded WiFi USB blocks at the other end.  I plugged in power, waited, checked for new IP addresses and LO AND BEHOLD that was online too!

Raspberry Pi 2:  I tested the modified script on the Pi2 and as well as being a darn sight faster to install than the units above – it does work well.  I did however notice that the yellow Node-Red GPIO node does not work – possibly something missing in DietPi. However – there’s a great utility called GPIO which gives you full command line access and I’ve now added that as an option to the script. I’ve tried GPIO access including PWM and it all works a treat as Pi user.

cd
git clone git://git.drogon.net/wiringPi
cd ~/wiringPi
./build

The above it what I added… then use GPIO – now, with the –g option, the pins correspond to the actual connector which is nice – so for a nice dim LED on GPIO13

gpio –g mode 13 pwm
gpio –g pwm 13 20

Not tried that on the Zero but I assume it will work as well. If anyone knows why that yellow GPIO node sits at “connecting” do let me know. Remember in all of this we’re using the DIETPI image – NOT original Raspbian – which IMHO is a little heavy handed if you don’t want a graphical interface.

Things are looking up.

Raspberry Pi backupAnd now for something completely different: Meanwhile I thought you might like to see this Raspberry Pi battery backup  (not for good reasons) -   I bought this a couple of weeks ago and it turned up today. 4 brass spacers and it fits onto my Raspberry Pi 3 a treat.

But – pull the power out – and the Pi reboots – who on EARTH dreamed this up!!! They claim 9 hours of backup but no good if power loss causes a reset… worse -  I bought it from Europe at £9.49 and I COULD have bought it from where they probably got it from in the first place at £8.73 and no postage. Oh well. I’m assuming I got a bad one – surely they could not have designed it this way. Anyway, it has a 3800maH battery and it all fits perfectly on the back of a Pi.  On the FRONT of my Pi I have an LCD display and the whole thing was intended to form the backbone of my updated home control in Spain when we go back there in April. A clue to the problem may be that there is a small yellow power indicator on the Pi, suggesting the pack might just be putting out insufficient voltage for the Pi + LCD. So – I tried it with a Raspberry Pi 2 on it’s own – same result. Just thought you’d like to know in case you were thinking of buying one of these. THIS looks GOOD (Thanks Antonio) – any experience of this??  I have some goodies from another company coming in the next couple of weeks which look promising as uninterruptable supplies– more on this soon.

Facebooktwittergoogle_pluspinterestlinkedin

Pi Zero Wi-Fi Automatic Reconnect

WIFISometimes I wonder about the thinking processes involved in Debian setup.

Why for example would you NOT want the Wi-Fi to reconnect on failure? What is the point? Yet, that does seem to be the default scenario, particularly odd when it comes to the Pi Zero – which has no option BUT to use WIFI.

I generally attach Raspberry Pi devices to the Internet via a hardwired Ethernet as connectivity is very important to me – not much point in having a super-duper setup miles away only to discover you can no longer talk to it, right?

Yet that is EXACTLY the scenario people will no doubt stumble onto when getting their new spiffy Pi Zero – I’m not going to say low cost because by the time you realise you need a USB hub and WIFI adaptor the price suddenly shoots up towards the cost of competing devices.

However, having had my Pi Zero sitting on the shelf for some time and having now received more than one WIFI dongle (including one with a decent external aerial) I thought I’d give it a go. The little number you see here on the right was £2.59 from Hong Kong and is in keeping with the low cost of the Pi Zero. I also spent £5.59 in the UK on a cheap powered USB hub because article after article suggested that running the WIFI without a hub was not a good idea (since verified and further backs up my doubts about the benefit of having a Pi Zero in the first place).

USB HubSo I took an old-fashioned Pi B and set that up with Wi-Fi (without the hub) – copied the FLASH from its rather large original SD to a micro SD and plugged it into the Pi Zero. Plugged in the cheap USB powered adaptor  – plugged the WIFI dongle into that and applied power.

Worked a treat. Lovely. Tried without the hub, no joy. But of course this is when people normally stop only to discover often days or weeks later that this is NOT a good enough solution.  I did note that very occasionally the Pi Zero would reset – the cause of this was a very long, thin USB power lead – funny that this never had been a problem with the Pi2 – but shortening the lead very definitely solved the problem.

So with everything working, To test reliability, I simply pulled the Wi-Fi dongle out – and put it back in. The Wi-Fi was DEAD. After 5 minutes still no connection.  So I rebooted the Pi and back came the connection. The next test was to pull the power to the router (does anyone REALLY live in a place where none of this EVER goes wrong?). Router back on – waited 5 minutes and… sure enough – absolutely NO Wi-Fi.

I started to scour the web – BOY are there some convoluted solutions out there – one might suggest  some were written by sadists. Come on guys – this is a tool, not life itself – something SIMPLE is needed.

And so it was I stumbled onto this page.

http://raspberrypi.stackexchange.com/questions/4120/how-to-automatically-reconnect-wifi

Here’s the important bit – no new files.  I was talking to the Pi via winSCP and of course as Pi user you don’t have permission to wipe your nose so I made a slight mod to the Pi connection – in winSCP, under advanced, SFTP I put “sudo /usr/lib/sftp-server” into the SFTP SERVER panel – and reconnected – this gave me elevated control to actually let me edit files without needing a degree in Linux using one of the many awful command line editors therein.  

As per the link above..

In /etc/network/interfaces I put:

allow-hotplug wlan0

iface wlan0 inet manual

wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet dhcp

I saved that and rebooted – all was ok. I pulled the WIFI dongle out – winSCP griped. I plugged it back in, 1 minute later, winSCP reconnected automatically. I turned off the router – winSCP griped. I turn the router back on – just over a minute later, winSCP reconnected automatically.

Now why isn’t that the default setting?

For my next trick – in Debian Jessie and with the graphical interface set up, I tried swapping routers – I have 3 access points as my home has lots of thick walls.  I swapped from one to the other and was asked for a password. Ok, fair enough. But then when swapping back to the original, I was asked for the password again. WHAT?? I’d already given it the password, why would it want it again?

Well it turns out that all is ok as the graphical interface had actually saved both settings in /etc/wpa_supplicant/wpa_supplicant.conf

I’ve obviously altered my two SSIDs and passwords.  I guess you could put as many of these as you like in here manually.

network={
    ssid="aaaaaaaa"
    psk="xxxxxxxxxxxxxxxxxxxx"
    key_mgmt=WPA-PSK
}

network={
    ssid="aaaaaaaa"
    psk="xxxxxxxxxxxxxxxxxxx"
    key_mgmt=WPA-PSK
}

Lovely.  It really is worth asking however, is it really worth the saving of having a Zero when it needs a USB lead and hub for it to be of any use, not needed with a P2 which is also faster.. or one of the alternatives out there. There is also no 3.5mm jack for audio on the Pi Zero.

Still at least I can now use this for something…

IanChilton on Twitter just sent me this link – which I have to say on the surface of it is pretty damned interesting for the Pi Zero – any thoughts on this? The price is stunning and it would seem to be JUST what the Pi Zero needs? Does not seem to come with a power adaptor – but it does have a little hole for one in the back!

http://www.aliexpress.com/item/Hot-marking-Micro-USB-to-Network-LAN-Ethernet-RJ45-Adapter-with-3-Port-USB-2-0/32544477817.html?spm=2114.30010308.3.2.YZfEDZ&ws_ab_test=searchweb201556_3,searchweb201644_3_505_506_503_504_301_502_10001_10002_10016_10005_10006_10003_10004,searchweb201560_3,searchweb1451318400_-1,searchweb1451318411_6450&btsid=7667f665-95f8-487d-9525-af3aa4c3a948

So.. do we actually NEED to use WiFi in the ZERO or is this a viable and practical alternative?

By the way if you see that 4 port USB hub I photographed above on Ebay – avoid it  - we were sitting watching TV tonight when the little plug-in-the-wall power supply that came with it – blew up!!

Facebooktwittergoogle_pluspinterestlinkedin

Pi Zero and the USB Problem

The £5 Raspberry Pi Zero has great potential as a cheap gadget but it has one major problem – lack of USB. So it has no ETHERNET – your ONLY option is WIFI – but will the WIFI work and how the HELL are you supposed to figure that out when you only have ONE USB socket. You can have mouse, or keyboard but not both.

IF you happen to have a USB hub lying around you’re all set – but if not, here’s a GREAT idea from a pal of mine…   if you happen to have an original Raspberry Pi (ie NOT the Pi2) – plug the WIFI into that, set everything up on that – then transfer the SD and the WIFI over to the Pi Zero.

SIMPLES – I really don’t understand why I didn’t think of that first – well done David. I just happen to have one old PI lying around and I was looking to giving it a job! Node-Red on a Pi Zero? Keep an eye out for further news.

Facebooktwittergoogle_pluspinterestlinkedin

Pi Zero Suicide

Ok, maybe it’s not THAT bad. I hooked up my Pi Zero to a Wi-Pi controller by taking the WIPI out of it’s shell and hardwiring power to the end power connector – and signals to the second usb connector as here.

http://hackaday.com/2015/11/28/first-raspberry-pi-zero-hack-piggy-back-wifi/

I then grabbed Berryboot (original, not the Pi2 version) and altered the files as here. http://www.berryterminal.com/doku.php/berryboot/headless_installation 

I made sure that the files were in Linux format (I used Notepad++ which can save in the right format). Popped in the MicroSD…. plugged in USB power to the end connector and… nothing – not even a flashing light.

That’s it. Not a clue what I did wrong and guess what – I only managed to get ONE Pi Zero!

So here’s an update. With the Berryboot code for the original Pi, nothing happens. With the Berryboot code for the Pi2, the little green light comes on – so it is reading the SD… but nothing else happens. As yet I’m not seeing anyone else having managed to get the Pi Zero working with Berryboot.

Facebooktwittergoogle_pluspinterestlinkedin

Raspberry Pi Zero

Pi ZeroIf you have been hiding recently you may not be aware of the new Raspberry Pi Zero. Hot on the heels of the CHIP and other low cost micros and by the look of it a zillion miles ahead of that daft BBC “Micro Bit” (there’s a shocker)   the Raspberry Pi Zero has some great potential not least because of the price tag – $5 which as you may know is around £3.30 right now.

So what do you get for this ridiculously small amount of money. A Raspberry Pi 1 at double speed, amazingly. Yes, running at 1Ghz the Pi Zero is a full Raspberry Pi and it is tiny.

The official MagPi magazine is out today and will GIVE AWAY one of these on the cover.. not kidding!!! So now every child in Britain etc. CAN have a computer. I have to tell you I am so pleased there’s an alternative to the BBC’s second and hopefully failed attempt at world domination.

Raspberry Pi ZeroSo what could be wrong – £3.30, a full Raspberry Pi – what’s stopping you?

Well, before you rush off.. there is tax – which for example in Chicago is a miniscule 39 cents. Oh yes, this is real – my Pi Zero is ordered and waiting for me to pick it up at the shop – a grand total of $5.31 which is £3.51

But… mostly the ads say “available NOW” – just as they did with the original Pi until you get to the bottom of the page where it says “due to high demand we are currently out of stock” – surely there must be a law against that but hey ho.

I gets worse but before I gripe about British rip-off merchants, let me clarify – this is ALMOST a Raspberry Pi – it has no ETHERNET.. and that’s a big but! Why? Because if you’re familiar with the Pi, you will know that most if not all of the WIFI dongles available for the Pi, which working, are not the most reliable items in the world. This would be IDEAL as, say a dedicated MOSQUITTO server or BLYNK server or similar but would I trust one of those WIFI dongles 24-7 – no.  A real shame.  However, by the time I get my hands on this device and get it back in the office to play with I may well have found someone to prove me wrong about the WIFI reliability. If you know better – please do write in. It was suggested that you could plug in an Ethernet to USB adaptor – but judging by Ebay prices it would be cheaper to buy an Orange Pi which is a better bet than Pi Zero + external Ethernet – or will be once they sort out the software.

So – you can run Raspbian (not entirely sure how to do that yet without the Internet – perhaps BerryBoot might come to the rescue here). – Oh and before I forget – the really good new news on Raspbian is that future versions will have Node-Red built in by default (I love it when I make the right choices) and this just opens up SO many possibilities.

Remember - £3.51 all in -  I just bought one for (the few places in Chicago that do have these in stock are offering one per family so there will be a couple of families going to the store with me Smile )

So here we go - https://www.raspberrypi.org/blog/raspberry-pi-zero/  - MADE IN WALES – which is on the same tiny land-mass as the rest of Britain right?  So if the Americans can charge me £3.31 – what bargains might I get in England you wonder, a mere stones throw from the factory..

Let’s take a look shall we, at the bargains available in the UK right now. http://cpc.farnell.com/raspberrypizero?&ICID=I-Rpizero  - a mere £10.54 + VAT which comes to £12.65 – or a mere NINETEEN DOLLARS. Oh yes, you get a couple of cables with that – you know, the ones you could pick up for a couple of quid from Ebay.

Pi Hut http://thepihut.com/products/raspberry-pi-zero offer the basic Pi Zero at £4 which is a little more like it – but it is all irrelevant as they are out of stock.

Pimoroni also charge £4 for the basic item - http://pimoroni.com/zero but when you press the buttons – they don’t work – I’ll assume that means out of stock.

For around £6 you could buy the MagPi magazine and get a Pi Zero for nothing!! Except you can’t  as they are out of stock. http://swag.raspberrypi.org/collections/magpi/

So – assuming you CAN find somewhere to buy this – I do think it has a bright future unless someone comes along with the same thing plus Ethernet for £6  - but remember this is a souped-up Raspberry Pi – NOT a Raspberry Pi 2 which remains a superior beast.

IF a cheap WIFI dongle can be found on EBay that works reliably and If the likes of BerryBoot will pick up on that dongle so you can simply download the operating system without needing a PC or jacked-up-price-SD card, then I predict a bright future for this device – not least because of the massive amount of PI-related information out there, the friendly nature of Raspbian and of course the stunningly brilliant Node-Red.

Expect more on this next week – I pick mine up on Saturday, just before heading back to the UK as we have Thanksgiving here in the USA today and there’s no chance of getting into the stores in time today.

Facebooktwittergoogle_pluspinterestlinkedin