Archive for the The downside of Opensource Category

github is not southern hemisphere friendly

Posted in Orange Pi, Sucky service Providers, The downside of Opensource on July 8, 2017 by asteriondaedalus

So, as I mentioned last night.  As usual, if you are up late and fiddling with access to code from git you will likely get either unresolved host github, or the new thing which is a problem with certificates which is as likely to do with a timing thing and then again to do with host resolution.

This morning I ran make again and it breezed passed the point it got stuck on last night.

It’s the same time-of-day related behaviour I have seen when running git from my PC.



Posted in Linux, Orange Pi, The downside of Opensource on June 18, 2017 by asteriondaedalus

So, various things on follow up to mqtt as a service.

You can have a /etc/init.d/mqtt file (works from console but doesn’t work as a service and therefore does not work at boot)

You can have a /etc/systemd/system/mqtt.service file (doesn’t work)

You can have a /usr/lib/systemd/system/mqtt.service file (doesn’t work)

Closest thing that appears to hint at what the problem might be is that emqttd starts with console but systemd baulks during service startup.  Noting that /etc/init.d/mqtt works from console but won’t work using either of “service x start” or “systemctl start x” then that appears to “behave” in a way that would suggest console interaction with systemd.

Changed /opt/emqttd/bin/emqttd to turn off console on startup (doesn’t work).  Or at least the example code I used does not work as advertised.  The change suggested is from:

-args_file $RUNNER_ETC_DIR/vm.args 


-args_file $RUNNER_ETC_DIR/vm.args -detached -noinput -noshell -- ${1+"$@"}"

Not to mention that, for some reason, the mqtt.service options seem to “break” the node-red startup somehow.   When I log into the OPiZ, pm2 show tells me node-red is online but browser fails to connect.  If I delete the mqtt services and reboot I get node-red running on boot as expected.

The problem with the internet …

Posted in Linux, node-red, Orange Pi, The downside of Opensource on June 17, 2017 by asteriondaedalus

… and all you need is that one page you can get to from anywhere in the world, though it might be obfuscated by all the other pseudo pages on the same topic.

So, to get the node-red to run on boot I used the following (see “Starting Node-RED on boot”)(as root):

npm install -g pm2
whereis node-red
node-red: /usr/local/bin/node-red
pm2 start /usr/local/bin/node-red --node-args="--max-old-space-size=128" -- -v
pm2 save
pm2 startup
export PM2_HOME="/root/.pm2" # because I installed in root 
reboot #takes a while after rebooting but it should come up

The max-old-space-size=128 is based on suggestions for RaspingBreathBurryDoodle Pi and Beaglebone Black, which both have (as does the Orange Pi Zero) 512Mb of memory.

So, now that fraking emqttd, which does not start as a service on boot, is the last hurdle.

So wearing …

Posted in Linux, Orange Pi, The downside of Opensource on June 16, 2017 by asteriondaedalus

… goddamm fracking frack!

So, again different versions of versions of linux.

So, apparently I can change the timeout of a service with:

systemctl set-property mqtt.service TimeoutStartSec=x

If and only if I have a TimeoutStartSec property that is, you guessed it.

Turns out, there is a TimeoutStartUSec … woop … er… already set to five minutes.


So theres goes that theory.


Posted in Linux, Orange Pi, The downside of Opensource on June 16, 2017 by asteriondaedalus

I know I said I sorted starting emqttd as a service. I rebooted and opened browser to the emqttd web console.

Got caught out with beginner blunder – the webpage is cached on my PC isn’t it. So the emqttd didn’t, afterall, start. However, the bonus is the error reported has changed (using the tidier init.d file of mine), and the inference I get from the new error is, I think, the service startup period is timing out.

No problem.

A couple of mechanisms appear to be there to change the default timeout.


Stay tuned as nothing has worked as advertised on my OPiZ now its fragged and running distro.

Fracking frack frack …

Posted in Linux, Orange Pi, The downside of Opensource on June 14, 2017 by asteriondaedalus

So, got the emqttd and node-red running from separate console sessions on the OPiZ to checkout the mqtt messaging is working and voila!


Just a simple check by sending the timestamp to the topic “hello” and using the debugging to catch the response.

So, stuck again as 1) can’t set the IP on the OPiZ to static because of the quirky behaviour induced by the use of the expansion board and 2) still no luck getting either of emqttd or node-red running as services.  Both are show stoppers at the moment – at least for deployment.

I intend using double sided tape to tap the OPiZ to my gateway and drive it from the USB port on the gateway with a short ethernet cable into the gateway.  Good option since no gateway means no lan.  Also means if I cycle power on gateway to sort out problems the node-red server will need come up without intervention.

That will be much neater than the ODROID-C1 setup currently – which reminds me, must look at putting together the ODROID-C1s and parallella into that cluster.


Close but no bananna

Posted in MQTT, Orange Pi, Rant, The downside of Opensource on June 14, 2017 by asteriondaedalus

So here is where I got to getting emqttd to start as a service on Armbian Debian server running on OPiZ:

Jun 14 08:29:42 house systemd[1]: Starting SYSV: emqttd is mqtt broker....
-- Subject: Unit emqttd.service has begun with start-up
-- Defined-By: systemd
-- Support:
-- Unit emqttd.service has begun starting up.
Jun 14 08:29:42 house emqttd[1282]: /etc/init.d/emqttd: 1: /etc/rc.d/init.d/func
Jun 14 08:29:42 house emqttd[1282]: starting emqttd...
Jun 14 08:29:43 house run_erl[1321]: Erlang closed the connection.
Jun 14 08:29:58 house systemd[1]: emqttd.service: control process exited, code=e
Jun 14 08:29:58 house systemd[1]: Failed to start SYSV: emqttd is mqtt broker..
-- Subject: Unit emqttd.service has failed
-- Defined-By: systemd
-- Support:
-- Unit emqttd.service has failed.
-- The result is failed.
Jun 14 08:29:58 house systemd[1]: Unit emqttd.service entered failed state.

So, to get here first you need the instruction for setting emqttd as a service at emqttd site.

The script line “. /etc/rc.d/init.d/functions” (within /etc/init.d/emqttd) will try to source a file you don’t have in your Armbian debian server distro for OPiZ.  It appears a standard file so I used mkdir to create the /etc/rc.d/init.d directory and downloaded a copy of functions.  This may or may not be the source of any knock on problems I am currently having.

In any event.

What the emqttd build does not do is move the binary to /opt directory for you, and there are no words to direct you to do this in the emqttd help, so the help file either expects you “know” (how we hate priori knowledge yes) that was their install solution OR the build clapped out and didn’t move the files or install properly – and did not report same.

So, you will need to copy the files (built into _rel directory) into /opt with (from your emq-rex directory):

mkdir /opt/emqttd
cp -r _rel/emqttd/* to /opt/emqttd

To get the error above just type in:

service emqttd start

Note, I also tried the service installation for node-red to no avail.  It appears to hook into services via a slightly different route (who would have thought).  But, alas, the following line ends quietly with no error report.

systemctl start nodered.service

But, browser does not connect to anything.  Rebooting has no effect.  The following provides the obituary:

systemctl status nodered.service