Category Archives: Orange Pi

Location location location

Could be my lucky day today…  not only does the Orange Pi PC work but I’ve been talking to a pal of mine Peter Oakes (check his videos) in Canada…   I know zilch about Linux apart from what seems like several thousand commands I’ve learned recently (probably a dozen) be necessity – however, I was getting a little concerned that the Orange Pi even with a tiny heat sink tends to get a little warm and I thought it might be nice to get that info – and be able to turn a fan on instead of the normal response when they get too hot which appears to be to shut down!!!

Anyway it turns out that this command…

cat /sys/devices/virtual/hwmon/hwmon1/temp1_input

returns the temperature as a decimal. We THINK a similar one for the Raspberry Pi is this.

cat /sys/devices/virtual/thermal/thermal_zone0/temp

Though in the latter case, it returns sometimes a 5 digit number which seems to include the decimals… not sure how to reduce that down to the same as the Orange Pi – maybe integer divide by 1000 ( or am I reading the wrong one)  - both of these react appropriately to an air canister.

ANYWAY in order to use that in Node-Red – and hence send an email or turn a fan on…is to use the EXEC node – so in the case of the Orange Pi…

temperature of Pi

Well isn’t that handy – press the button and out comes the temperature of the chip – it doesn’t take much imagination to replace the left with a timer – maybe once every 30 seconds – and the output with either an email or GPIO control for a fan.

So – Orange Pi and Raspberry Pi experts – where is there an idiots guide to all the other useful addresses to get info ??

Facebooktwittergoogle_pluspinterestlinkedin

Orange Pi PC– Battle of the PIs

OrangepiOrange Pi PC

This is a complete and much shorter re-write of an earlier blog entry – a lot has happened in recent months and so what’s the point of keeping stuff online that is no longer useful, right?

Now, why would we want to revisit the Orange Pi PC?

Well, because having falling in love with Raspberry Pi 2 as an IOT tool I could buy 3 Orange Pi PCs for the price of the Raspberry Pi 2 if only it worked.

I should say right at the start  - I’m not interested in a pretty interface for another media centre – I’m after a low-cost box that I can talk to remotely. It must run the following:

  • Apache of similar with PHP
  • Node and Node-Red
  • Mosquitto
  • SQL-Lite
  • SCP remote access
  • Webmin

Why that combination? Well, first things first – I’d love to run NGINX but I’ve not had a lot of luck there with my combination of software and Apache is ok.  Secondly – I control stuff around the house and need Node-Red as the central controller – it’s also a great thing to have generally. Thirdly, Mosquitto – that’s how I control most of my stuff – and I need the websockets version.  Finally SQL-Lite -  having read some horror stories about the amount of writing that MYSQL does and bearing in mind we’re using SD memory here with limited writes, I’ve settled on SQL-Lite – and that needs PHPLiteAdmin to administer it hence the need for Apache etc. SCP for remote access to get to files without having to hook a monitor up – and Webmin – well I just like Webmin for updating stuff.

I have all of this running on the Pi 2 – but of course that’s £30 a pop. Investigating the Orange Pi was a means to save costs. Too good to be true? Well, if you read the original article (now scrapped) you’ll know I had LOTS of issues and eventually gave up. All of that has changed.  Currently I have everything running except for serial ports – and I’m sure that is just a minor issue – and I’ve not yet tested sound…. part of that is because one particular Node-Red node – IVONA refuses to install on the Orange Pi – again – I think that is likely solvable.

Performance: So how does this 2-pints-of-beer computer stack up against the mighty Raspberry Pi2 ?

With both the Orange Pi and the Raspberry Pi running winSCP and Kitty terminals… I went for sysbench…

apt-get install sysbench

and ran this test

sysbench --test=cpu --cpu-max-prime=20000 run

Both systems have similar software on them.

This came from here. https://www.howtoforge.com/how-to-benchmark-your-system-cpu-file-io-mysql-with-sysbench

The guys must’ve been testing this on a desktop as his test took 23 seconds (it did get a little warm, I think a little heat-sink on that processor might be a good idea)!!!!

After a couple of minutes I was just about dying of boredom when…..

JessieThe Orange Pi came back FIRST at 488 seconds – Amazing.

I really had expected the RPi to come back first. Minutes later and I was checking to see if the RPi had crashed  - but no, a quick change of directory in WinSCP showed it was still running.. nothing on the terminal however… as I was coming back from making coffee I noted the Raspberry Pi 2 had returned – with – wait for it 1,171 seconds!!

So - a working system for my control stuff, complete with a full operating system with various graphical tools – and all for under £12 inc shipping ??

February 2016: I took the latest Debian Jessie and scripts and after bringing everything as up to date as possible, I began my umpteenth attempt to get a working Orange Pi. This time I got reliable operation of Node-Red, Apache, Webmin and MQTT.

The ports and WiringPi: Ports at first seemed elusive until I came across this.. http://l0l.org.uk/2013/09/raspberry-pi-running-node-red-wiring-pi-to-pwm-control-a-light/

I installed WiringPi and it worked – at least for simple IO – but the interface for Node simply would not  have it. However, as the command line worked – that’s not a big deal.

  • gpio mode 14 out
  • gpio write 14 1
  • gpio write 14 0

Armed with those command line commands – which worked a treat – I only tried a few IO lines…. I used the EXEC function in Node-Red and now I have IO control – which is fine for at least the simpler operations – controlling relays etc.

So here is the information for getting Debian – follow precisely…

http://www.orangepi.org/orangepibbsen/forum.php?mod=viewthread&tid=867&extra=page%3D1&page=1

Following the instructions give you a working Debian on the Orange Pi, complete with WIFI and other add-ins – but it uses NGIX as against Apache. So in the script I remove this which gives me a basic working system and the rest is a modified and improved version of the original Raspberry Pi script as some stuff simply did not apply to the Orange Pi.

Here for anyone interested is the script.

https://bitbucket.org/snippets/scargill/Md4jr

To be checked. Audio – when I or someone else finds out why npm install node-red-contrib-ivona won’t work – I’ll test the sound.

ConnectorSerial: – there are 3 UARTs S0, S2 and S3 referred to in /DEV – The Node-Red SERIAL node sees them – but then refused initially to open them by default so there is a permission change in the script to make the ports accessible.

Heat: I do recommend a heat sink on the Orange Pi H3 chip – mine is is fitted and even then it gets too hot to touch for any length of time.

Anyway, recently I found this..  http://www.orangepi.cn/orangepibbsen/forum.php?mod=viewthread&tid=785 and I’ve run that and rebooted and – well, I can’t tell any difference but it’s probably worth running anyway.

Graphics etc: I have turned off the X interface near the end of the script thanks to input from others and  I’m using Samsung Evo microSDs now as they are relatively cheap and VERY fast compared to some – no – really a lot faster. 16GB should last a while.

And then the shocker, I updated the WIFI info as per Pi-Zero blog a couple of entries back – disconnected the Ethernet lead, plugged in a standard WIFI dongle, rebooted and… nothing.

Plugged the Ethernet back in and took a look with IFCONFIG – turns out that for some reason WLAN0 was perfectly intact but called WLAN2 -  I now have a running Orange Pi with WIFI! But the WIFI setup is not covered in the script as this is all being done with an Ethernet cable.

Just need to sort out that IVONA node which won’t work – and we’ve a winner by the look of it. Help appreciated with the latter.

May 2016: Bear in mind that since this article was written we now have the Raspberry Pi 3 which probably competes head on with this model on speed. Add to that MUCH better support on the Raspberry Pi AND the fact that they now have a backup program built-in as standard AND PIGPIO - ask yourself if the saving in initial cost is worth it.

Facebooktwittergoogle_pluspinterestlinkedin

Orange Pi PC

This blog item last update May 2016 – and it is all thanks in large part to you, the readers.  Thank you. Well, let’s see shall we…

Orange Pi PcThe Orange Pi PC (note, specifically the PC version, I’ll make no comment about others – this is the CHEAP one – cost me something in the region of £12 + post from AliExpress) is a “Raspberry Pi rippoff” in that it is very similar in look and function.  It has an Ethernet connector, 3 USBs, HDMI and audio as well as a power connector and micro-USB “host mode” connector (you CANNOT apply power via this connector so don’t confuse that with the RPi).

Mine arrived around 3 weeks after I ordered it. I eagerly opened the box and noted I had to give it a power supply able to handle up to 2 amps.

The first issue I had, NONE of my large number of 5v supplies had a connector that fitted – why on earth we have to have so many variations of 2-pin connector defeats me. So I took out the soldering iron, carefully checked to find that of the 3 pins under the connector, 2 were ground, one was 5v power – so I carefully soldered a lead and hooked it up to my power supply. I plugged in a monitor to the HDMI connector, plugged in Ethernet and…  I don’t know what I was expecting with no microSD but I expected SOMETHING. I turned on the power. In total, the two lights in the Ethernet controller came on – and that’s IT. NOT what I expected – I at least though a power light might come on.

I had it in my brain from the very misleading ads that this would take a “Raspberry Pi image” – well, it doesn’t – and so after plugging in a microSD with RPi setup on it and getting nowhere (NO more lights, NOTHING on the monitor) I started looking for help. Well, DON’T make the mistake I did and go looking to the design company – you’ll get no replies and their website is often as slow as HELL – I think they might be running the site on a Pi (and there are no schematics for the PC version of this board, at least  not at the time of writing).

So then I turned to the forums. It turns out (and this is important) that you will NOT see a board light until you have a valid SD image in there.  I found a Debian 8 ”Wheezy” image (NOT a Raspberry Pi image – still not resolved that claim), formatted the SD (16G class 10) with SD Formatter (on my Windows 10 PC) and then blew the unzipped image using Win32DiskImager.  I plugged in the SD, applied power, ON came the red board light, UP came the monitor. I was getting quite excited.

That was soon dashed when I realised the hardware ETHERNET wasn’t working. The instruction onscreen said to run a command to expand the disk partition. I did that and immediately the board rebooted, showed a TON of disk errors and died. I tried that several times – same result.  Just on a whim – I used Windows to LONG format the SD before using SDFormatter to quick format it. I don’t know if that helped, but… read on.

Next attempt – I went off for the Ubuntu version. This worked better, allowing resizing and coming up in graphical mode – with horrendous overscan on my monitor – but hey…   still no hardware Ethernet. I plugged in my WIFI usb board (I don’t like to use it, not reliable enough for my use as an MQTT/Node-Red server) and rebooted. Wifi was up.  No hardware Ethernet, no sound but it was all working so I started to install my script designed (kluged) for the Raspberry Pi. WELL don’t you know it – some of the folders are different in Ubuntu – so much for complaints about Windows versions.  The script largely installed – I had Webmin, Node-Red, MOSQUITTO and other programs running – but the lack of wired Ethernet and other features and the awful screen res made me want to give up.

One of you kind readers had previously send me off here for images…

http://www.orangepi.org/orangepibbsen/forum.php?mod=viewthread&tid=342

I kind of thought that with the formatting I may have cured some ill with the SD – perhaps I should give Debian another go – but with no wired Ethernet – what was the point. I re-read one of the emails in here and it turned out there were a couple of scripts needed – but where were they?? The GIGA link in that page link above made no mention of the scripts… however, one thing at a time – I went back to Debian and put that on the SD with Win32DiskManager, having reformatted the disk.

At that point I took a look at the SD – sure enough – sample scripts were on the Windows-readable boot partition – just waiting to be renamed – so ALL you need is the Debian image. I renamed the two scripts (see comments from cnxsoft below) and booted up the board. THIS time it booted up, taking a little longer but with the ethernet WORKING. No graphics – I didn’t really want that anyway as I control everything via the PC using WinSCP and then after installing TightVNCServer, using TightVNC viewer.

I gingerly followed the command line instruction for resizing the partition (one instruction, trivial) and LO – all working.  I moved to WinSCP so I could work from the comfort of my Windows PC – and – apt-get-update and upgrade worked a treat.

At this point my script which installs the kitchen sink. I’m going to cut a long story short – the Debian Wheezy mini installation just DOESN’T WORK, TightVNC would not work, Webmin. It doesn’t work. i detailed it all in here but what was the point!

So I started again – using Jessie this time in no time I had a properly working graphical interface running. I pulled up the Chromium browser, went off to the BBC website, tried to run a video – it wanted the FLASH player, I said ok – and the entire graphical interface came to a halt.  But… I think I heard something out of the speaker… and accordingly having remoted into this installation via ROOT (which in this case CAN be accessed externally) – I decided to give my script another go.

Well, both TIGHTVNC and WEBMIN installed – which is a plus compared to the previous version, and…. alas, no sound –  I loaded an MP3 onto the machine – set the sound mixer to analog output – turned the volume up – the little bar was showing the music playing, but as for any sound actually coming out of anywhere… nothing, zilch. PHPLiteAdmin would not work but I realised – no unzip – so that quickly got added to my script – just in case..

And what do I find? A brand new version of Apache2 – for **** sake!!!! – which now doesn’t work out of the box!

DEAD easy – says the web – NOW you have to put all your files now into /var/www/html -  and you can change this with THIS file  -

/etc/apache2/sites-available/000-default.conf 

Ok, THAT worked….. going to need some conditional coding in my script! I also discovered UNZIP was missing – I added that to the script.

PM2 installation started to throw out errors as had the node installation – I seem to recall npm WARNINGS before.. maybe they too were errors.

Password setup for Node-Red failed but that always fails – always complains about no bcrypt – even though bcrypt is installed – that needs work… solution is simple – run it again after the script is done – and remove the dead entry. I need a SED text to prevent duplicates – that’s a detail.

Despite gripes during the PM2 installation it still worked!

I can likely fix most things here but the SOUND – absolutely no joy…

SO – the CONCLUSION: I believe that the only thing wrong with the Orange Pi is an AWFUL, UNRESPONSIVE COMPANY, RUBBISH documentation and incomplete implementations of drivers. When I wrote this  I had a functioning equivalent of my setup on the PI with Node-Red, MOSQUTTO etc all running – for £12 but since then the Pi3 has taken us another step forward and I doubt this model of Orange Pi would compete.

BEAR IN MIND for those of you not familiar with the more expensive alternative – the Raspberry Pi (and possibly with less time to experiment)– all this stuff works first time every time out of the box on a Raspberry Pi. You have to ask yourself if it is worth the bother?  probably not - at least not until the Orange Pi people get their finger out and provider better documentation, better drivers and get rid of the out of date stuff on their website.

Facebooktwittergoogle_pluspinterestlinkedin