If you’ve been keeping up with the blog you’ll know that I’ve added to the script, code to allow NodeJS access to I2c. And you may also know that for some time my ESP8266 code has supported the little (cheap) purple 16-channel 12-bit PWM/Servo boards called PCA-9685.
I have covered the FriendlyArm NEO and NEO2 boards here before now and generally been in favour – but for one little item in common with many other boards – little or no IO support – well, that just changed. Read on…
With no apparent way to get to the IO on this cute little board, I promised I would write to FriendlyArm and ask for WIRINGPI and that I did. In the meanwhile if you take a look at the relevant blog entry you’ll see I made a start at using GPIO the hard way and even found a WIRINGOP (OP – Orange Pi) variation that would do basic IO if you could guess the right IO pins, but that was about it.
I’ve just been up to Northern Spain with a friend and our wives looking at some property up there and when we got to our hotel and got the wine open, Aidan showed me his new toy – Amazon Echo.
The Echo Moment
Well, I was so excited I’ve ordered the new Dot which should turn up next week – after all my failed experiments with Google Now and Microsoft’s Cortana trying to fire text at Node-Red so I could control things, this might just do the job – but that is something for next week.
Of course – you could always hang around and wait for the forthcoming fluffy version called FABRIQ – which appears to be rechargeable – but no mention of microphone arrays so you take pot luck on how good the audio capture is. You could even take the kit route with Seeed’s ReSpeaker – but by the time you add up the cost of ReSpeaker and the microphone array… well, I’m wondering if they’ve lost the plot. They sent me a ReSpeaker to play with minus the microphones – I nearly choked when I saw the additional cost. If you have an Amazon account you can play with Alexa here.
I’ve not had a lot of luck with the Raspberry Pi versions, one only works in the USA, others are out of date and require button presses… anyway I’ve ordered a USA mic any my DOT turns up next week so maybe in a couple of weeks this will start to fly at this end.
We came back to the cave on Friday and yesterday my friend Jonathan rang me up full of new stuff he’s been playing with.
Glasswire and Divvy
So first things first – for Windows enthusiasts – check out GLASSWIRE. I have it sitting here making pretty graphs of my network – I’m not saying it is any good – I’m saying it is extremely pretty and possibly deserves a corner of your desktop. Something else you might like to play with is DIVVY from MIZAGE. I’ll leave you to look those up. I found them interesting.
Meanwhile as some of you know I’ve been experimenting with Armbian on my little Nanopi NEO. Lovely operating system and I managed to get my script working on it no problem – but for one thing – WIFI - the NEO doesn’t have WIFI and so you have to stick one of those cheap Chinese WIFI dongles in – and on most of the SBC boards I’ve tried – no problem. However after jumping through some hoops to get the WIFI working on this little Neo board – I was very disappointed – WIFI performance was so poor you could see delays when doing the likes of apt-get update etc. I wrote off to the Armbian forum and the response was along the lines of “you should try an Orange Pi Lite if you want WIFI” – well that’s all very nice but I already have two NEOs.
Well, I was sitting getting depressed about this when my friend Jonathan rang me up with some new things to try.
WinDiskManager and Etcher
So first things first – you know that Win32DiskImager that everyone uses to FLASH Linux SDs – he’s spotted something not only a little faster but a little nicer looking called Etcher – so the first useful takeaway from this blog entry is Etcher. I installed it on my Windows 10 64-bit system no problem – none of your “administrator-only” stuff – and Etcher works - point it to an image file – and it flashes it to SD!! Mind you that’s ALL it does. If you need to READ images onto your PC you still need Win32DiskManager.
The DietPi Moment
He then reminded me that before I was playing with Armbian I’d had a go at DietPi for the Raspberry Pi. It only worked on the Pi itself - it was a nice, lean installation of Debian – but hey – the normal Pi setup was fine – so I put Diet-Pi to one side.
WELL – take a look at DietPi today – it is no longer for the Pi only – and it can install lots of goodies – kind of complimentary to my script (with a nicer interface). And in the process of this conversation I noted it has a setup for the NEO and other FriendlyArm boards.
Well, wouldn’t you know it – there’s a menu driven setup for WIFI – and it WORKS!!! And the funny thing is – the designer credits Armbian – WELL!! Ok, so there’s a LOT more to this and I’m only at the beginning – I noted that this Diet-Pi on the NEO seems to run even faster than the hardwired version on Armbian – and I’m only at the surface of finding out why – but one reason it seems nippy is you have full control over logging – which by default is running in RAM and at a minimal – a very sensible starting point.
In the process of setting things up I discovered some sillies in my script (which takes a basic Debian setup and installs a while raft of useful goodies centred around Node-Red) and I’ve fixed those.
I have now run my updated script on DietPi on the NEO and M2 and up to now everything seems to work – and it’s a small installation for a small board – and nippy… I need to go way more deeply into this – there is SO much in Diet-Pi now but I’ve no idea how much of it actually works – I DO know that not everything works on all boards but as I’ve only installed this on the FriendlyArm M2 and NEO I’ll keep my mouth shut except to say I’m mildly enthusiastic – my little NEOs are now useful wireless devices – which is a great step forward.
Experiments above with Node-Red, MQTT and serial – all working. And below – with a simple mod – a nice colour terminal… all on my NEO soon to be replicated on M2 and T2.
Now there DO seem to be some issues with DietPi – I’ve reported them – on a real Pi the serial port needs permissions altering to work (added to script just for belt and braces) – and on all installations, Mosquitto fails to run at power up – MAYBE starting too early I don’t know but taking a line out of the RESTART bit of the start-up script and putting it in /etc/rc.local does the job.
Up to now everything seems ok and I’m working with MrShark to looking toward the lightweight LIGHTTPD.. we’ve already improved my script – and you know how it goes – once someone triggers you off…
More of that soon – for now – I have my script (as of today) running (with the caveats above) on a Pi2, M2, NEO and BananaPiM2 – and that’s only due to restricted time… DietPi has the advantage of making a MUCH smaller footprint at under 2GB compared to nearly twice that on, say a standard Pi – as there is only in there what’s needed.
Oh while I think on, here’s the link to my original Neo article.
Expect to hear more about this in the coming week – I’m off now travelling with my wife and 3 cats ALL the way up Spain – 24 hour ferry – ALL the way up England… you won’t hear anything from me in here as I’ve not mastered blogging on a phone
.By now Aidan has his Alexa turning his lights on and off via Node-Red and so that will be the next job – integrating this whole lot together.
By now if you read this blog regularly you’ll have heard me rant on about the FriendlyArm boards – mainly because they are inexpensive and actually do work well as Pi alternatives – you’ll also note that I don’t blindly praise them – I’ve still not managed to get the T3 to run a 32gig SD of Android – and it’s an old Android to boot… but generally – I like their stuff.
SO it will come as no surprise then that I’m interested in the new NEO. And why would that be? Because it is SMALL and CHEAP. It has no WIFI or Bluetooth but it has hardwired Ethernet – just the job then for a NODE-RED central controller perhaps? This is clearly aimed at a market not wanting a graphical interface as no hdmi out – but at the price – I’m happy with that.
So there’s a reason it is cheap – there are two versions, 256Mb RAM and 512MB RAM – I would not personally give time to the former – but the latter would, you would think, run Node-Red, SQLITE and Mosquito without issue… So the extra RAM puts the board at $9.99 plus whatever postage you get stuck with in your country… cheap by any standard…
But – looking at the docs – it seems that right now the main official option is for Ubuntu – I don’t know about you but when something says “An open source tiny PI” on the front of the box, you might expect it to be somewhat compatible with THE PI.. and that means Debian for me – and no doubt for most people familiar with the Pi.
The internal processor is an Allwinner H3 quad core like the Orange Pi so it is reasonable to assume that there will be alternative software. It looks like there are 3 UARTS so one would hope for two to be accessible.
There is one USB, a microSD slot, a micro USB OTG port and 2 USBs via headers. The expansion port claims the usual, I2c, SPI etc but of course that will only happen if the software will support it. Size is 40mm by 40mm – which makes it kind of smaller than a Pi Zero.
It occurred to me that setup could be a problem with this board as it has no SCREEN but read on – as it turns out it wasn’t an issue.
FriendlyArm sent a copy of Ubuntu which I’ve no interest in but thought I’d better try to ensure the board was ok. Sure enough it worked but the instructions on the box were the wrong way around. The blue LED flashes constantly – the green LED stays on – according to their info – it should be the other way around. Also to resize the SD they offer a Linux solution – assuming everyone has a Linux computer spare – or a simple SUDO fs_resize. The latter at first didn’t work until I realised that firstly the sudo command was not there and secondly I didn’t need it as I was root !!!
So all of that worked well – but I know for a fact my script won’t work on Ubuntu so I needed to get a working Debian
So – off I went to get ARMBIAN – and sure enough there is one version there for this particular board! Update 22/09/2016 – there have been some issues with the Armbian setup – read their site – but also see my script – it refers to a specific version of the legacy Jessie installation on the Armbian site (at the time of writing the latest). With the script this is running exceedingly well - and yes, Node-Red can see serial ports 1, 2 and 3 (0 is in use for debugging).
I flashed a 16GB SD with the Armbian code using Win32DiskManager, plugged in the Ethernet and power. A dim green light came on. After a few seconds it brightened up. And then maybe 30 seconds after that a blue light started flashing regularly along with the green – a sure sign SOMETHING was happening. On the Armbian website it warns that the first time boot could take minutes – so I left it.
Next stop Advanced IP scanner. Sure enough there was a board in my address range – sitting at 192.168.1.26 – with my favourite tool, WinSCP, I used the login credentials root and 1234 and – no file list – it HAD logged in but nothing. I wrote off to the Armbian guys and apparently logging in with Putty (SSH) was needed to make an initial password change – and sure enough – it worked. I went back to WinSCP – and bingo.
The software asked me if I wanted to change screen resolution which was a bit odd as I was running in a terminal and the board has no screen!!! Not really sure what to do with that – why would they enable the graphical environment when there’s no screen. So – off I went (as root) to get tightvncserver – and sure enough it installed but would not run – complaining about lack of fonts. No big deal – I un-installed it. i had no intention of running a graphical environment on a board with no screen connection anyway !! Ultimately I did return to this and did get the graphical interface running as I wanted to see if I could get WIFI working on Armbian – but for the life of me could not get WIFI drivers to install.
I REALLY think this board needs a heatsink which was not initially supplied. I wonder why it is that Raspberry Pi manage to run without one and these H3 boards end up running hot enough to cook eggs – there ARE H3 boards which are faster than the Pi but I don’t think this is one of them. However the fact that it is so SMALL and inexpensive it is worth a little effort. Having said that with the latest Armbian the chip is running at 51 degrees C without the heatsink so that’s not bad.
Next stop, with the board running Armbian I left it running my installation script designed for a Raspberry Pi to install a host of utilities and Node-Red, Mosquitto and SQLITE. In the process I updated my script to include the new node-red-dashboard which is the worthy successor to node-red-contrib-ui and added things like “cu” which allow you to use the terminal as a serial VT100 terminal.
Overall? Well, I’m really happy – I have two working UARTS in Node-Red (UART1 and 2) I can’t find the pins for UART3 but Node-Red is happy to talk to it. UART0 works well as a serial monitor. I’ll need to load up some GPIO tools etc. but the bulk of my stuff just seems to work.
Update 29/09/2016 – FriendlyArm just contacted me –just to confirm – on the NEO – they never did bring out GPIOA13 and GPIOA14 to the connectors and hence UART3 though technically “there”, is not actually available.
For connections – see here - http://wiki.friendlyarm.com/wiki/index.php/NanoPi_NEO
Now as it turns out they bear no resemblance to other boards (unless I’m missing something) – so I started to experiment with the help of links from people in here.
THIS FELLOW - http://www.orzalabs.tech/2016/08/15/wiringpi-library-on-nanopi-m1/ got the M1 working with the Wiring Pi and so I installed that (H3 – same chip) – but could not get pin mappings to work.
I discovered that GPIO WRITE 24 ON turned on the little blue light on the board… and then purely by trial and error…
- GPIO WRITE 10 ON - GPIOC3 – pin 24
- GPIO WRITE 14 ON - GPIOC2 – pin 23
- GPIO WRITE 12 ON - GPIOC0– pin 19
- GPIO WRITE 13 ON - GPIOC1 – pin 21
- GPIO WRITE 3 ON - GPIOA3 – pin 15
- GPIO WRITE 6 ON - GPIOA2 – pin 13
- GPIO WRITE 2 ON - GPIOA0 – pin 11
- GPIO WRITE 28 ON - GPIOG6 – pin 8
- GPIO WRITE 29 ON - GPIOG7 – pin 10
- GPIO WRITE 24 ON - GPIOA6 – pin 12
- GPIO WRITE 26 ON - GPIOG9 – pin 18
- GPIOG8 (pin 16) could not turn on
- GPIOG 11 (pin 7) – could not turn off
- GPIOA1 (pin22) could not turn on
So – that’s a START!!! Just need I2c now!! The only issue for me here is that FriendlyArm ONLY provide and support UbuntuCore for the NEO which is of no interest to me. I don’t know if this is down to a language problem or what but…ok, the ad does say Ubuntucore ready – but the name says “NanoPi” – and surely to qualify as a Pi you should be supporting the main operating system of the Pi – that being… Debian.
Interestingly their M1 product DOES support Debian – which is strange. But here’s the problem – though WiringOp just happens to work for GPIO on both the M1 and the NEO, and compiled WiringOp programs can be made to work as user Pi, as the company’s Matrix software which DOES give you access to I2c etc. seems to have some issues with any other than ROOT access - and FriendlyArm do not currently know how to get around that.
So the ONLY the way forward here to make full use of these boards, is for someone brighter than me to work on WiringOP to make it completely compatible with the NEO and hopefully the M1 – at that point – we’re onto a real winner but it would be so much better – when someone brings out hardware products like this – which rely SO heavily on documentation and software – if they would get it right themselves!!! The manual for the Matrix software is even now in Chinese only!
Update October, 2016: If you look at my later article which includes updates on the NEO, there is a DietPi out that works with this and my script and makes for a small, fast installation.
Conclusion: All down to postage… this is a marvelous little board you might describe as “cute”. With no 3.5mm jack I’ll have to get my hands dirty and solder that 0.1” edge connector on to get audio out. I’ll report on that later and it appears there’s a microphone input too on that connector along with an option for an IR input! Also look out for their new Lite version - I have one on the way - with WIFI instead of Ethernet - and it has 2 USBs. At the time of writing - the Armbian installation with a WIFI dongle on the Neo was not that good but the DietPi version works a treat.