Archive for the Linux Category

Short cut to static IP on HypriotOS using linux

Posted in Linux, MQTT, node-red, Raspberry Pirate, RaspingBreathburryDOodlePi on December 23, 2019 by asteriondaedalus

So, go try understand the new flash utility for Hypriot OS. Ignore the blog entries as the wacker has no technical writing skills.

Seems you need only read and understand the FAQ. All you need to know is:

>flash --userdata setup.yaml

With setup.yaml based upon one of the examples from the flash samples folder.

First of all you need flash installed on your linux box, since it does not run on windoze.

The flash utility can be installed on Debian 10 with:

>sudo apt-get install -y pv curl python-pip unzip hdparm

>sudo pip install awscli

>curl -LO

>chmod +x flash

>sudo mv flash /usr/local/bin/flash

You can test it with:

>flash --help

OR, you can do what I eventually did, since it took me hours to find you couldn’t set the static IP on a HypriotOS host with the old tricks no more.

So, I set up for flash utility but when I stuck a previously bombed SD card into my Debian 10 box, the SD card of course was readable.

So, here is your short version to set up a static IP with HypriotOS without having to setup cloud-init and all that jazz.

Download a HypriotOS image zip, say:

Unzip the image and burn to sd card using etcher.

If you have the sd card in your Debian 10 machine, open it using graphical file browser. Open and edit the following file using the file browser’s built in editor:


Use the example static.yml file in HypriotOS sample folder and edit up the user-data.yaml file to suit your static IP setup.

Take sd card out of your Debian host and insert into your target RPI.

BOOT FOR THE FIRST TIME and voila! You will find your HypriotOS host on the static IP you set up in the edited user-data.yml file.

Note, the BOOT FOR THE FIRST TIME. That is, download image, edit the config in user-data.yml then BOOT FOR THE FIRST TIME.

Nice accident si?

Message repeats, without the flash utility installed :

  • Insert SD card into USB SD card reader.
  • Insert USB SD card reader into Linux box.
  • Bomb Hypriot onto SD card. Do not remove it. DO NOT BOOT IT!
  • Use text editor on Linux box to edit user-data.yml file on SD card in the USB SD card reader. The file is at the top of file system so easy to find when you open up the SD card in a file browser.
  • Safe the updates to user-data.yml on the SD card.
  • Unmount the USB SD card reader and insert the SD card into your RPI.
  • Now you can boot.
  • You needn’t have used the static IP example but, assuming you did, you now have a HypriotOS box with static IP.

Setting up platformio and arduino IDE with ttyUSB0 on Debian 9

Posted in IOT, Linux, NodeMCU on September 27, 2018 by asteriondaedalus


Troubles with my 64bit Debian 9 Stretch and trying to setup for ESP8266 and ESP32 development.

This is a freshly built laptop so the USB ports had not been opened before.

I could not “see” ttyUSB0!  So I assume it might be drivers (it was for my Windoze PC).

I feel lucky to have found anything on setting up my usb serial port to see my NodeMCU 0.9 because of just how much junk is on internet about the zillions of ways of fracking your USB port.

I did find out the drivers I had to install, a great video on how to do that, and stopped short of doing that because 1) the instruction was to move stuff under the kernel devices directory (it turned out I had two kernel directories so thought better of that) and 2) when I looked under the kernel directories I found the driver already installed.

So, a little more poking around and I found I needed to add my standard user to related groups:

dialout – full and direct access to serial ports. Members of this group can reconfigure the modem, dial anywhere, etc.

sudo usermod -a -G dialout user

plugdev – allows members to mount (only with the options nodev and nosuid, for security reasons) and umount removable devices through pmount.

sudo usermod -a -G plugdev user

That is what I need as the serial port now displays in Arduino IDE. However, I did opt for also installing platformio into the MS Visual Studio Code (rather than into Atom).

Winter chill.

Posted in Linux, ODROID-C1, Orange Pi on July 30, 2017 by asteriondaedalus

So far so good.

OPiZ has run for 12 odd hours with temp reporting, node-red and emqttd up status running on OPiZ, emqttd up status running on PC and PC pinging OPiZ.

I note that, because this is winter, and we snuggle under a couple of doonas during the night, heating in the house is off.

That meant the temp of the OPiZ dropped to 59degreeC from the 62degreeC it peaked at yesterday.

I note also that the memory watch I ran on the OPiZ via TeraTerm was fine.  The free memory was oscillating around the same value that it was around 12 hours ago.

So, who knows, is it a temperature related thing that causes the ethernet to drop its connection?

Odd that there are complaints on the net about heat problems with the OPiZ, the OPi series in fact, but they don’t bother to 1) provide heatsink with the devices 2) tune the device to run slower out of box since that will drive the operating temperature down and because there is no heatsink provided.

Mind you, I have also found 6x6mm Peltier coolers so who know how silly this could get.

Or, I guess, play with a jar of mineral (baby) oil.

The server needs to provide Mission Critical level functions for running the house.  So it stands to reason that either I get this sorted or drop the OPiZ and go back to ODROID-C1.

Thrashing by reboot a success

Posted in Linux, Orange Pi on July 29, 2017 by asteriondaedalus

So, I have left the OPiZ running for 24 hours, node-red and emqttd running, and rebooting every 5 minutes.

All is running.

So why the dropout of the system previously?

Now the experiment will be to remove the 5 minute reboot, just leave it running and either ping from my PC via a python app or set up a pass-through topic on emqttd to test for the OPiZ server being up.

The dropping of ethernet may be related to how long the system has been running.

It could end up a design problem, the OPiZ 2 has dropped ethernet.  I might yet have to relent and go to wifi – though this would be 1) against principle and 2) against the design I have set for my set up.

I do note one mention on internet of heat related problems with OPiZ and the ethernet.  So, in the meantime I am going to order me a gaggle of heatsinks.

Do di do di do di DOH~!

Posted in Linux, Orange Pi on July 29, 2017 by asteriondaedalus

So, yep, sure enough, I came back to the OPiZ and could not connect.

As I have the 3-pin serial connected I snuck a look and yep … route naught.

I rebooted, setup emqttd as a service, re-started the cyclic reboot task in node-red.

I will let that run a few days then I will have to try something else to work out when and why the lan connection is dying.

This is on a new Orange Pi Zero board that hasn’t had an expansion board inserted, and it is running the headless debian server.

I still can’t fathom how the difference between ethernet connection persisting and then being dropped procedurally is the installation of erlang/elixir/emqttd.

Worst case, I guess I can install Mosquitto.

Still, I cannot see the mechanism.


Around the buoy again …

Posted in Linux, MQTT, Orange Pi on July 27, 2017 by asteriondaedalus

So, after thrashing the nodejs, node-red, npm install for a few days (by rebooting every 5 minutes) we have decided those aspects were not causing the problems with the ethernet and usb devices collapsing.

I just began the next stage by installing erlang/elixir and have begun the chore of re-installing emqttd.

Go figure, it gets most of the way through it’s build and claps out.

Might be that the latest master called by git requires OTP 19.3+ and the apt-get for OPiZ returns OTP19.  So, I have ripped out the emqttd again and re-run git command but used an OTP 19 friendly branch emq20.


emqttd builds on OPiZ running OTP 19 if you use the emq20 branch.

Now to bed.

I will look at setting it up as a service tomorrow night then pummelling it with reboots over the weekend.

Ah ha!

Posted in C.H.I.P., Linux on July 26, 2017 by asteriondaedalus


I am now building the third C.H.I.P. with shairport-sync.

I went to look on the gateway admin page to check to see if the other two were still up.

Neither turned up in the wifi list.


So I went to the iPad and sure enough, I could see and select the other two as Airplay targets.

So, I ssh’d in and I could connect to both  AND I could ping from both.  That validates both that I can get out and the DNS setup is still working.

So, it looks like there is some bug in the gateway web admin since I can’t have internet access if something isn’t right.

Not sure if that relates though to the OPiZ story as that was definitely devices dropped.

Still, so many niggly confounding problems.

So, I will ignore them and build the third C.H.I.P. for Madam’s office.

What the!?

With the static IP set, the third C.H.I.P. can be seen on the gateway wifi list.  The only difference between the third C.H.I.P. and the other two is it is connected by USB to my PC for the setup.  Why on earth would that make a difference as to whether it is “seen” by the gateway list?

Okay, so I had deleted a network scanner off my Android phone when I found it had broken post an update.  I downloaded a new one tonight that similarly could only see the new C.H.I.P. attached to my PC???  I scrapped that one and downloaded yet another one and it could see all three C.H.I.P.???  Fracked if I know what is going on there.

Too dopey to bother with, no concern given I can still talk to board by USB and all other evidence is that, from the C.H.I.P. point of view everything is fine.


Posted in C.H.I.P., Linux, Orange Pi on July 22, 2017 by asteriondaedalus

So, here it is Sunday.

Morning coffee in hand while I wake up.

Dogs still asleep but will be doing backflips once they hear me getting their leads out for the Sunday bush walk.

OPiZ still up, node-red console full of reports of reboot every 5 odd minutes.

Since it has been in this reboot cycle since Friday night I am happy enough the nodejs, node-red, npm combo is not the contributing factor to the ethernet and usb stopping.

After the walk I will … well I will have a nap.  But after the nap I will … well I will build another C.H.I.P. with shairpoint-sync for the second sound bar.

Later tonight I might have another go at the emqttd install on the OPiZ.

I am still not sure how that might induce the dropping  of devices, but it in hindsight there is a conspicuous connection since the problems seemed to start once I had installed and was running the emqttd – that observation holds over the at least a dozen times I re-burnt then setup a distro for the OPiZ.

Curious, because these are the exact same steps to set up a Raspingdoodleburry Pi or ODROID-W with the same combo of app – neither with any problems with devices dropping.

Pump up the volume

Posted in C.H.I.P., Embedded, Linux on July 22, 2017 by asteriondaedalus

So Target had finally dropped prices of sound bars with aux input to AUS$49 so I can deal with the wife’s nagging about the BOSE wifi sound system with a $9 C.H.I.P. and a $49 sound bar.



Perfect for the bedhead in the main bedroom and the window sill in the guest bedroom or in the book case in the wife’s study.

I only bought two as we had the speaker tower in the backroom.

Now, given all the problems I had with debian server distro and the OPiZ, here I am using nmcli to setup the static IP for the wifi on the C.H.I.P. with no problems.

Given I had the 3-pin serial cable out, I just swapped it over to the C.H.I.P. from the OPiZ.

I flashed with the headless server version 4.4 of for the C.H.I.P..

I used nmcli to setup the wifi using the provided example.

I then used “sudo nmtui” and setup the static ip and then reboot.

I found the device on my gateway list of wifi devices … bute!

To install shairpoint-sync I simply followed the instructions at Hackster.

The trick is where the instruction asks for interpolation to be set to soxr I reset it back to basic.  I also set the alsa property:

audio_backend_buffer_desired_length_in_seconds = 0.5 (it was set to 0.15).

I did this because the audio would drop out briefly.  Evidence is the soxr interpolation takes a grunting cpu and there might have been some network problems.  So, between relaxing the interpolation and buffering more audio, the dropping of audio apparently has ceased – much to Madam’s delight.

The nuisance, the wife has given up her iPhone for a Samsung S8 – which she doesn’t like.

I found you can get Airplay running on Android so we could get by.  I bought her a new laptop but she hasn’t moved her iTunes to that yet.

She hasn’t installed iTunes on the PC that I built her.  iTunes is on her old laptop so there are some politics there to get that transferred – especially as I have my eye on her old laptop to be my 64bit Debian dev box.

So while the Airplay route is “comfortable” it is rather “complicated”.

However, she has an iPad that she now hardly if ever uses so it can be the server for the house music.

Too easy drill sergeant!

Too easy, that is, because even though I am using a debian based distro on the C.H.I.P., and essentially using the same tools to set up the C.H.I.P. as I was the OPiZ, I am having no problems with C.H.I.P. headless server.


Oh … yes, if she asks BOSE was bought out by Thompson.



Setting up node-red yet again

Posted in Linux, Orange Pi on July 20, 2017 by asteriondaedalus

Are you still with me? I wouldn’t be, it’s been such a pain. Because network manager appears flaky somehow.

On the distro the /etc/network/interfaces file told you directly to use network manager and nmtui. This intimated that you couldn’t edit up the interfaces file.

I got no joy when I edited the interfaces file, while trying to get around the flakiness that appeared to be incurred, but that could because network manager was the default service – and was not reading the file??

Now, on the distro, it looks like you can use nmtui/nmcli optionally but, of course, we have seen the network connection collapse.

Now I didn’t look to see if at some point /etc/resolv.conf was set by network manager to some flaky value and therefore breaking the connection.

Now we have that up our sleeves as we try try yet again again.

Yes, I have an alcoholic beverage on hand.

So distro installed and static IP setup.

First step, install node-red.

I will leave the system running until Sunday before I try installing emqttd as I want to give it a good burn in to make sure there isn’t something in the node-red install breaking the ethernet.

To stress the distro I set up a cyclic reboot in node-red with the following:


I just set an interval of 5 minutes on the injector.  The debug node will scribble the timestamp on the debug console when the interval lapses.  At the same time the OPiZ is rebooted.