The FriendlyArm NanoPi Duo turned up for me today – well, in fact, more than that, a complete kit comprising motherboard, heatsink, SSD and more turned up – read all about it below:
So the NanoPi Duo comes in 2 flavours – 256MB and 512MB of RAM. For my purposes I have here the 512MB verson as a preliminary test suggested that “the script” may not be that happy with a 256MB device – depending on your requirements that may or may not apply.
The board itself handles a microSD (not supplied) and operating system images are readily available from the Friendlyarm site. I’ve included a WIKI link which has all of that and more.
This board is somewhat different to the rest of the FriendlyArm range, being intended (I assume) as a small breadboard-compatible control board (about the same size as some of the ESP-32 boards around right now), running on WIFI. It is cheap and it is very small. What they have done however is made full hardwired Ethernet, 4 USB ports, microphone and even a 64GB SSD drive option available on a base board which you can purchase separately or as part of a complete (more cost-effective) kit.
So for example if you have a need for a number of minimal embedded Linux controllers – then the development kit and a number of DUOs might be the way to go.
In the large photo above you see the baseboard which appears to fit into a Raspberry Pi case, the slim DUO plug-in board in the centre and to the right that square board is the 64GB SSD drive. The microphone and the debug serial connector are hidden underneath. Below, you see the Duo itself.
As I could not be bothered to plug in the serial I used Advanced IP Scanner on my PC to seek out the IP address which as it turns out was 192.168.1.45. SSH, root and pi access are already set up as is the case with the other FA boards (I wish others would do that – some do, some don’t) and so WinSCP quickly connected to the board (using hardwired Ethernet for now) and as usual I immediately changed the passwords.
There is no video out on this board and hence no desktop. Everything is done via the command line – or of course once you’re all set up with programs, possibly via a web interface – but it is all very familiar to those who’ve used Debian or Ubuntu and not LOT different to a Raspberry Pi command line (unsurprisingly).
All of the login information and how to set up wifi is conveniently located in the slip of paper that comes with the board, incidentally, along with other useful information – but the major source of information is their WIKI. http://wiki.friendlyarm.com/wiki/index.php/NanoPi_Duo – I checked the command for WIFI and sure enough both of my WIFI access points showed up with decent signals. For setup however where possible I prefer to use hardwired Eithernet.
I failed to find information on using the SSD – I would have expected to see something in the menu of npi-config (their own command-line config program) – but nothing. I looked briefly on the web – nothing. Please do note however that the SSD is not a standard fitting so I may be looking in the wrong place.
The base board is kind of self-documenting as on the underside are all the pin-outs clearly marked.
Incidentally (and I’d never noticed this before) – once you’ve installed Ubuntu, FA have installed NanoPi-Monitor at port 8888 which in a browser gives you a nice overview of the processor. It has a couple of minor bugs which I’ve reported. It looks like simply a modified RPI-Monitor.
I started running “the-script” to install my stuff on the board, starting temperature 50c and after 1hr 27 minutes the temperature was 60c (I’ve not mounted the heatsink). I suspect this is because the H2+ isn’t the fastest and I’m using an ancient SD card I happened to have lying around as I plan to immediately move everything to SSD.
All seemed well as the script appeared to run without issue… however – after a reboot it became obvious that the one thing which would not run – was Node-Red.
Serial, SQLITE and Orange Pi GPIO npm modules would not load up properly – bearing in mind that these are part of the standard package and have been for some/. I tried re-installing the modules – and the installs went ok – but Node-Red would not accept them.
As these always work, at this point both Antonio who’s been following this and myself are at a loss as to why this is happening – more on this as things develop.
For reference - here's Node-Red starting up with this installation.
[pcsh lang="bash" tab_size="4" message="" hl_lines="" provider="manual"]
pi@duo:~$ node-red 26 Sep 21:00:58 - [info] Welcome to Node-RED =================== 26 Sep 21:00:58 - [info] Node-RED version: v0.17.5 26 Sep 21:00:58 - [info] Node.js version: v6.11.3 26 Sep 21:00:58 - [info] Linux 4.11.2 arm LE 26 Sep 21:01:00 - [info] Loading palette nodes 26 Sep 21:01:25 - [info] Dashboard up and running 26 Sep 21:01:33 - [info] Dashboard version 2.5.1 started at /ui It looks like serialport didn't compile properly. This is a common problem and its fix is well documented here https:// The result of requiring the package is: undefined 26 Sep 21:01:37 - [warn] ------------------------------------------------------ 26 Sep 21:01:37 - [warn] [rpi-gpio] Info : Ignoring Raspberry Pi specific node 26 Sep 21:01:37 - [warn] [Orange Pi] Error: Could not locate the bindings file. Tried: → /home/pi/.node-red/node_modules/epoll/build/epoll.node → /home/pi/.node-red/node_modules/epoll/build/Debug/epoll.node → /home/pi/.node-red/node_modules/epoll/build/Release/epoll.node → /home/pi/.node-red/node_modules/epoll/out/Debug/epoll.node → /home/pi/.node-red/node_modules/epoll/Debug/epoll.node → /home/pi/.node-red/node_modules/epoll/out/Release/epoll.node → /home/pi/.node-red/node_modules/epoll/Release/epoll.node → /home/pi/.node-red/node_modules/epoll/build/default/epoll.node → /home/pi/.node-red/node_modules/epoll/compiled/6.11.3/linux/arm/epoll.node (line:1) 26 Sep 21:01:37 - [warn] [In] Error: Could not locate the bindings file. Tried: → /home/pi/.node-red/node_modules/epoll/build/epoll.node → /home/pi/.node-red/node_modules/epoll/build/Debug/epoll.node → /home/pi/.node-red/node_modules/epoll/build/Release/epoll.node → /home/pi/.node-red/node_modules/epoll/out/Debug/epoll.node → /home/pi/.node-red/node_modules/epoll/Debug/epoll.node → /home/pi/.node-red/node_modules/epoll/out/Release/epoll.node → /home/pi/.node-red/node_modules/epoll/Release/epoll.node → /home/pi/.node-red/node_modules/epoll/build/default/epoll.node → /home/pi/.node-red/node_modules/epoll/compiled/6.11.3/linux/arm/epoll.node (line:1) 26 Sep 21:01:37 - [warn] [arduino] Missing serialport dependency 26 Sep 21:01:37 - [warn] [serialport] Error: Could not locate the bindings file. Tried: → /home/pi/.node-red/node_modules/serialport/build/serialport.node → /home/pi/.node-red/node_modules/serialport/build/Debug/serialport.node → /home/pi/.node-red/node_modules/serialport/build/Release/serialport.node → /home/pi/.node-red/node_modules/serialport/out/Debug/serialport.node → /home/pi/.node-red/node_modules/serialport/Debug/serialport.node → /home/pi/.node-red/node_modules/serialport/out/Release/serialport.node → /home/pi/.node-red/node_modules/serialport/Release/serialport.node → /home/pi/.node-red/node_modules/serialport/build/default/serialport.node → /home/pi/.node-red/node_modules/serialport/compiled/6.11.3/linux/arm/serialport.node (line:6) 26 Sep 21:01:37 - [warn] [sqlite] Error: Cannot find module '/home/pi/.node-red/node_modules/sqlite3/lib/binding/node-v 26 Sep 21:01:37 - [warn] ------------------------------------------------------ 26 Sep 21:01:37 - [info] Settings file : /home/pi/.node-red/settings.js 26 Sep 21:01:37 - [info] User directory : /home/pi/.node-red 26 Sep 21:01:37 - [info] Flows file : /home/pi/.node-red/flows.json 26 Sep 21:01:37 - [info] Creating new flow file 26 Sep 21:01:37 - [info] Starting flows 26 Sep 21:01:37 - [info] Started flows 26 Sep 21:01:38 - [info] Server now running at http://127.0.0.1:1880/
You will note in the above that the serial issue is well known (apparently) so off I went to the GIT repository and one of the options for install was this..
sudo npm install serialport --unsafe-perm --build-from-source
I did this in the .node-red directory – where I install all my nodes – and, well, how can such a simple thing take SO MUCH compilation.. however – it no longer gripes about serial and when I short serial in and out together on the baseboard – and run a debug into the serial in mode in Node-Red and attach the serial out node to a debug – it all works just as you’d expect. In the actual DUO the SECOND serial port is available – but that is not brought out to the base board.
I seemed to be getting no-where with Node-Red (everything else in the script works – and Node-Red itself did after a second successful attempt to install the I2c code – leaving only the stuff you see above not working – but not stopping Node-Red coming up.
To keep from getting depressed (or possibly make things worse) I decided to try to get the SSD working – it looks like SDA and so I reasoned it might act like any other hard drive. It did. I used the code here https://tech.scargill.net/neo2-nas-part-two/ to transfer the data (copy) to the SSD and set it up as the main drive – it worked a treat and I’m now doing the remainder of my experimenting on the hopefully faster SSD. Of course – booting for now is still done via the original SD – but that’s no big deal (though I’d much rather do away with it altogether). FriendlyArm intended that people would use this for data only as clearly the DUO on it’s own has no SSD – but hey – I like to push things.
With serial working I tried removing the rpi-gpio node – Node-Red ignored me but that’s no problem as it ignores the node anyway… however right now I am left with no Orange Pi node (which works on other similar boards and showed no issues on install) and no sqlite3 node even though SQLITE is actually running. Again no apparent issues on installing the node.
I pondered at this point if I might be using too early a version of node for some reason – I checked and it was version 3.x – so a quick update to version 5 and I tried installing SQL again – I could see an uninstall and reinstall going on – all looked well. I saw this time a message to say that pre-built binaries were not available – falling back to source compile with node-gyp… that all looked well though it took some time to compile.
BAD idea – now all the nodes that DID work – don’t… I tried re-running the script at this point – but it was too late. Thankfully having put the whole lot onto SSD – I still had the original on the SD!
At this point I had the Orange Pi node (which isn’t for Orange Pi) and the SQLITE node not working…
I really stumbled on a solution – I can’t really take credit for it. I noted that elsewhere rather than install sqlite – some had installed sqlite3
npm install sqlite3
Well, blow me it worked. I dropped the SQLITE node into Node-Red and passed a query to it – and it worked.
Now down to one node that does not work – sadly it’s an important one as this is how to access GPIO..not that there are many GPIO pins on this board available….
Well, it turns out that if you run node-red manually (node-red-stop then just node-red) something called epoll was missing. In the Node-Red directory I ran:
npm install epoll
And despite an error in the install – the next time I ran Node-Red – the errors went away. But would it work?
Well, it probably would but this was a pivotal moment – one in which I realised… the DUO doesn’t actually HAVE any IO pins – well, not if you’re using I2c etc.. there just are not any IO lines left!!! Well, there is one – IOG11 – but that said it was locked. It probably would have been easier if I’d investigated this earlier.
At this point – there was only one solution – my Nano peripheral – would the I2c work?
sudo i2cdetect –y 0
Well, that kind of worked – but slowly – I reasoned that for some reason they didn’t put pullup resistors on the board… I plugged in one of my OLED displays with pullups and voila – device 3c showed up. Off I went to install the driver. I used the same code I used for the NEO2. Aside from changing the location of the thermal zone from 1 to 0, it worked a treat!
On the subject of serial - here’s a question I’ve never really resolved – and I’ve come across this before on similar boards.. Tie the serial in and serial out together – and you can send info out – and have it come back in – totally reliably. However, with the two connected together, sometimes when rebooting – the board does not come out of reboot. Remove the link and try again and the board reboots – does anyone have a definite reason for this? I’ve seen this on other boards….
Well, that was hard work – but I got there in the end and it is all documented here… for you to decide whether this is financially worthwhile but I think it is very cute and now I have a working setup I can see the little DUO ending up in the odd project. For now I’m enjoying the 64GB SSD!
Talking of which – here’s a screenshot from the SSD