Archive for the Networking Category

node-red on docker – problem solved

Posted in Docker, HypriotOS, Networking on December 24, 2019 by asteriondaedalus

So, I gave up on my OPI Zero as the house server, because it kept disconnecting. I did then try to buzz out a second OPI Zero, but with the same result.

I had the RPI 3B+ I bought and then got shod of thethingbox, as it didn’t run the node-red out of box so that flows were preserved on reboot.

I decided to go for broke and bomb the RPI 3B+ with HypriotOS.

I then tried out the instructions on node-red site for node-red on docker. Good.

Tried the mosquito MQTT server example. Not so good. The node-red would not connect to the MQTT server. Typed the example it, quadruple checked it. Nothing.

Gave up. Worked out how to install Snap onto HypiotOS.

Why would you I here you say. Well 1) I had the shitz up because I couldn’t get the dockerised node-red talking to the dockerised mosquito broker from the relatively simple instructions and 2) it kinda makes sense that apps like mosquito broker and node-red are saner as Snaps.

So, worked fine as two Snaps of node-red and eclipse-mosquito.

Still bugged me that I couldn’t get the docker versions running.

Also found my RPI 3B+ was dropping off the network. That put paid to the idea I had dodgy OPI Zero boards. That was a harder ask, in any event, since two flaky boards? You had to be plain unlucky.

So, culprit is, in fact, my old Netgear wifi extender. An interent search finds, indeed, that wifi extenders are notorious for dropping off. On top of that, for some reason I could not login to my wifi extender using the usual mywifiext.net. Although, that problem cleared itself after a couple of hours, so who knows what goes on when I am not monitoring the thing. Yeesh!

It was too long a stretch to blame the wifi extender for the docker problems as the web page found the node-red fine, the node-red not connecting to the mosquitto broker was internal to docker, so would not be affected by the wifi extender problems. The wifi extende was up more than it was down so I soldiered on.

So, the wifi extender aside, I did rip out the Snapped apps and retry with the docker examples. In fact, I opted to drop eclipse-mosquito since it did not have an admin channel. I was going to go with my fav, emqttd, but found it had become emqx.

So, pocking around I found that the emqx was up. Same problem, no connection with the node-red container.

The node-red site recommended:

docker run -it --name mybroker eclipse-mosquitto

I beefed that up to be:

docker run -it -p 18083:18083 --name mybroker emqx/emqx:v3.2.7

That gave be the penulimate arm64 version of emqx, running with admin accessible. I found the admin port up and running so …

Turns out the error was in the node-red example at the node-red site. The error starts with:

docker run -it -p 1880:1880 --name mynodered --link mybroker:broker nodered/node-red

What the node-red instructions tell you is to use “broker” in the MQTT node in the node-red flow. Turns out you actually need to use “mybroker” to get the connection. Once I used “mybroker”, I got a connection and all was fine from then on – save for the wifi extender dropping in and out.

Punked it!

Posted in C.H.I.P., Networking on July 30, 2017 by asteriondaedalus

So, the joke I had with Mike Brady, the chap who maintains shairport-sync, was that the problem I was having with dropping of audio was that I was listening to my wife’s punk music.

The acid test for the fix I have used (basic interpolation and longer background buffer) was to pump The Living End to two of the C.H.I.P.

Voila!

2rooms

Of course, Madam was too consumed by her Sunday afternoon sitting of Criminal Minds to appreciate the success … so she told me to turn off the Backroom link.

So, the one for her office is ready, just needs some fiddling to fit the speaker on top of the storage cabinet.

I am now looking at setting up one in the gazebo in the backyard and one under the veranda in the front yard (we have a pool area in the front).

PEP

Posted in Arduino, IOT, MQTT, Networking, Wifi on July 20, 2017 by asteriondaedalus

So, following up after a previous promise I got myself a cheap arduino touch screen that was on sale, to act as a Programmable Entry Panel or PEP.

I will use the Wemos D1 and the Arduino core fore same to try to port the associated library onto Wemos D1. That way I can have a control panel via MQTT.

Yes, there wińļl be a Android version as my wife got herself a Samsung – though so hates it.

Saves me the hassle of working in iOS.

Ah, the thick plottens!

Posted in Linux, Networking on June 24, 2017 by asteriondaedalus

So, even with the static IP set on the parallella the TerraTerm console keeps disconnecting after a time.

Then it dawned on me, the connection was being broken because the PC IP would expire and pick up another from the DHCP in the router.

So, the unwritten story is that you need to set the IP address of your working PC to static as well – so that IP addresses at both ends of the connection persist.

Now that I have set my PC to static IP, TerraTerm does not close down.

Finally, a new mqtt based node-red server

Posted in Linux, MQTT, Networking, node-red, Orange Pi on June 21, 2017 by asteriondaedalus

So, much pain but lotsa learning!

Final story.

 

If you are using:

  • OS: armbian.org debian server: ARMBIAN 5.31 stable Debian GNU/Linux 8 (jessie) 3.4.113-sun8i
  • Erlang/OTP: V9.2/19
  • EMQ: 2.2
  • Orange Pi Zero 512kb (and fragged by expansion board ūüėČ

Ignore the service definition at the emqttd site

DO NOT CREATE /etc/init.d/emqtt Рbecause systemd is installed in ARMBIAN 5.31 and systemd uses UNIT files (as emqttd.service below).  The /etc/init.d/xxx file should be ignored if the UNIT file is there but why clutter and have junk around.

Then do the following (from root):

mkdir /opt/emqttd
mkdir /opt/emqttd/bin
cp -R emq-relx/_rel /opt/emqtt/
mkdir /usr/lib/systemd/system
nano /usr/lib/systemd/system/emqttd.service

---- inside of nano ----

[Unit]
Description=emqtt daemon
After=network.target

[Service]
Type=forking
Environment=HOME=/root
ExecStart=/bin/sh /opt/emqttd/bin/emqttd start
ExecStop=/bin/sh /opt/emqttd/bin/emqttd stop

[Install]
WantedBy=multi-user.target

---- exit and save from nano ----

chmod +x /usr/lib/systemd/system/emqttd.service
systemctl enable emqttd.service
reboot

voila!

Thanks awfully to @turtleDeng.

There is, of course, a new problem.  Both node-red and emqttd services start every time the OPiZ boots.  However, for some reason (tonight for the first time) connection to LAN is not coming up every time.  It comes up with no IP, no gateway, no DNS addresses???

Reboot a second time and it comes up.

This new problem means I will need check after brownout, or cycle power on ISP gateway (where the OPiZ will get its power … assuming there is 5volts on the USB port on the gateway).

 

Gag!

Posted in Networking on July 25, 2016 by asteriondaedalus

So, bombed a C.H.I.P. with shairport-sync.  This is a neat Airplay client app.

Only problem is my old house seems to throttle back the wifi throughput with its double brick walls.

Pumping the music through the wifi router in the lounge (from my PC on my desk in my hobby room) the audio at the desk was choppy and honestly useless.

I tried bombing a second C.H.I.P. but got the same result.

So, as I had a wifi extender on my desk I connected PC and C.H.I.P. to that and voila!

Mostly good, though it did kaput and loose sync after half a dozen songs.  It took a restart of the shairport-sync and a couple of attempts at iTunes to reconnect everything up.

So, I downloaded the NETGEAR Wifi Analytics app to do a quick survey. ¬†Not really much difference in bps but I wasn’t even getting peak performance a metre from the wifi router.

As the Wife insisted on no cables from Foxtel to television in the lounge a wifi extender is in use so I half suspect some interference (perhaps). ¬†Not to mention we cannot have the router in view, as that is “ugly”, so there may be other structural interferences.

In truth though, more or less the same performance as the android app experiments using kodi on my phone.  Same difference, choppy.

I might need a good wifi extender in the ceiling to pump wifi at a high enough rate to TBD speakers in ceiling.

 

OpenSprinklette

Posted in Embedded, ESP8266, IOT, Lua, MQTT, Networking on June 29, 2016 by asteriondaedalus

So, just got delivery of my 5 WeMOS uno clones …

 

arduino killer

… and 5 …

5v 4 Channel Relay Shield Module For Arduino

… we are now ready for OpenSprinklette! ¬†All up AUS$11.00. ¬†Only four channels but add a second unit for sum total of AUS$22.00!

So, a little work as we need to convert the 12volt AC to DC, should work a treat as the WeMOS board is happy to take 9-24V and also provides the 5V the relay board needs (apparently the 3.3V outputs should be okay *whimper*).

Now, since the “leak” (and the $3K water bill for the quarter) I will fit flow sensors to ensure flow is within expected range – so the unit can raise alarms. ¬†Got 4 from Aliexpress for US$12 (or US$3 per sensor) which is better than the AUS$15 per sensor LittleBird is pinging people for similar devices. ¬†Just needs a 3.3V zener and a 220 ohm resistor to adapt the 5V output of the sensor to the 3.3V inputs on the WeMOS. ¬†Will build that onto a protoshield. (Anyone know what the connector type is from the photo below?)

flow

The NodeMCU provides NTP so I can run timers on WeMOS.  MQTT to the ODROID-W server (in the house) to pick up the watering times, weather off internet to decide upon whether or not to water etc.

A second two will be used for remote control of back and front yard lighting.  So remote ON/OFF and IR triggered to boot.

 

Hot damn!

Posted in MQTT, Networking, node-red, ODROID-W on January 3, 2016 by asteriondaedalus

node-red-pi

node-red running on my odroid-w.

I have my old blackwidow working with a relay shield so I can drive sprinkler valves but I could not sort mqtt onto the older dopey wifi shield Рjust lazy.  So I will use node-red to drive tcp chatter to drive the relays and drive that with mqtt via the node-red.  That way I can integrate the board gently, using its current libraries.

Next experiments include, yes, sorting that static IP story.

Then getting mosquitto up and running.

There are a few warnings in the node-red install that I need address (upgrades of dependencies).  Otherwise I am looking at a thingybox the size of a matchbox.

Sensibly though I am looking at a small 220VAC-5VDC module to build the whole thing into a 3 Pin Plug Pack Case.

case

Yes, yes.  All would have been easier with a fresh download of the Jessi distro Рsince it comes with node-red.  But I do like the labour.

Still, the final version will be on a fresh Jessi distro so that I only need the mosquitto install to get this rolling.

Extra Sensory Perception?

Posted in Embedded, Hardware, Networking, Wifi on May 12, 2015 by asteriondaedalus

What ever it is, the ESP 8226 has read my mind.  Including being able to run LUA and so include MQTT and also things like Actors, CSP, FSM.

esp

 

Especially with NodeMCU on board.

NodeMCU

 

Now with ESP 8226+NodeMCU+MQTT, don’t forget Node-Red.

For my MQTT broker I am using, of course, emqttd as it is erlang based.

For connecting from python on PC, Raspberry Pirate, Beaglebone Black, one needs paho-mqtt. ¬†MQTT has topic much like ROS does … hmm … more reason not to need ROS broker.

In any event … get it … event … never mind, on Android one can use MyMQTT to hook into broker to push and subscribe as a test tool.

Finding that pesky IP

Posted in Networking on June 16, 2013 by asteriondaedalus

With all that is going on within my home wifi (development boards added, hosts turned on/off, wife’s laptop etc.) the IP addresses for everything tend to be fluid.

To keep track of the IP addresses turned out relatively simple, I just downloaded Net Scan onto both my ACER tablet and my Samsung Galazy SII and I can get a peek at what is going on.

There are still quirks, the wireless extender and everything attached to it is labelled “NETGEAR”, but that may yet be sorted out with a little work.