Archive for the MQTT Category

Swapping out …

Posted in MQTT, node-red, Orange Pi on May 19, 2017 by asteriondaedalus

… or in.

To give my cluster back an ODROID-C1, I got a 512M Orange Pi to host the mqtt and node-red for my house automation.  It is tini, even with the case ( a couple of max boxes in size ).  So, un-obtrusive to boot.

I will get a couple more once I have sorted some software to monitor my barking dogs.    Python based signal processing to detect the dog back and then, perhaps, hooked into sprinkler zone the dog barking is detected in.

I have an IR sprinkler guarding the side of the house.  Neighbors complained that they’d been barking daily for 12 months, why wait 12 months before telling me?  So they became set in their ways.  However, the sprinkler works the dog psychology as it breaks the fixation on the noise.

However, of course, I want to be a little more sophisticated.  I want to record the activity so I will get a camera for the OPi later.  Wifi it up to the home PC.  Because it has GPIO ports it could also drive a solenoid valve, a horn or a shaker (marbles in a coke can will distract the dog as it doesn’t like that type of noise).

Untitled

Parallela turned up so it and the C1 will be fitted this weekend.

I relented on the idea of an old multi cpu server.  I am fickle … I know.

Short cuts

Posted in ESP8266, MQTT, NodeMCU, OpenSprinklette on December 18, 2016 by asteriondaedalus

The chappy doing OpenSprinkler gave me the best idea yet for the 24VAC to 5VDC to power the OpenSprinklette stack (Wemos D1 R2, fiddly bits including VAC2VDC and pullups, relay board).

Rather involves using a LM2596S-5.

I have in my bits drawers 10 LM2596S-ADJ based modules that go for US$2 a pop in packs of 10 so I will start with that for the prototype.

lm2596-psu-01-a-450x450

For the VAC2VDC the secret is to add a 3A diode (cathode to +ve volts input) of the PSU board.  It then likely passes for the circuit at the OpenSprinklette blog.

In fact, if you solder the pullups onto the two naughty GPIO pins you need to, either on WEMOS D1 R2 or the relay board, you could get by without an intermediate board.  There is still the conditioning circuits for the flow meters, but again, since we are using mqtt there is the option of a separate system for that.  I think we are already convinced that the rain gauge can twerp to an mqtt topic for example.  Although, there may be traction in a shield board for people who want no more than four zones and one unit – at least with the rain gauge input and 24VAC to 5VDC … oh and those pesky pullups.

Note we still need do something like string all the relay commons together now don’t we.

I guess the more interesting thing going on with the rain input of the OpenSprinkler is the use of a surge protection across the rain gauge input that has a Transient Voltage Suppression diode.  The selected value appears to be 48V which seems a lot but the gadget is used for ESD threats to the board (aka lightning – not strike likely but nearby EM field, up to a point).

This is actually necessary especially when there is  likely a long “antenna” from the rain gauge to the unit.

Might be less need if an ESP8266 is connected at the gauge and the solar panel and charger (we’ll need a battery to run at night time) are similarly “close by”.  Already solved in any event.  

Hmmm.  Lightning detection

Ah ha! Digital rain gauge spare parts!

Posted in ESP8266, MQTT, NodeMCU, Wifi on December 17, 2016 by asteriondaedalus
rain-gauge

Rock it to me baby!

So, get this, for US$15 you can get a rain gauge that does naught but yep, still yep and yep, then maybe nope.

That is, the cover has a funnel and water drips in and cycles the rocker!

 

simple

Simple tich?!

 

That likely needs nothing more than one of the ESP littlins …

esp8266

… to chirp tich/toch onto a mqtt topic.

It’s getting REAL!

Posted in ESP8266, Lua, MQTT, node-red, OpenSprinklette, Wifi on July 12, 2016 by asteriondaedalus

20160712_183121

So the four-4-US$12 flow sensors have turned up.  The minimum measurable flow rate appears to be 1 litre a minute.  To put this in perspective Bob Hawke (ex Australian Prime Minister) sculled a yard glass (1.4 litre) of beer in a record (for the time) 12 seconds.

In comparison irrigation “emitters” tend to be in the ranges of:

  • 2,0 liters/hour – 1/2 gallon per hour
  • 4,0 liters/hour – 1 gallon per hour
  • 8,0 liters/hour – 2 gallons per hour

Now this will be per emitter so you will need around 8 times 8,0 liters/hour “emitter” in a line to get a 1 liter/minute flow by napkin scribbles.  A whopping 30! 2,0 liters/hour “emitter” will be needed to get a 1 litre/minute flow in a line.  Note, there may well be more than enough “emitter” to turn the paddle but that will depend upon the individual installations.

Not really a problem as the intention was to use this as a leak detector as the rate will be driven up but the leak, especially if your dog has dug up and chewed through a hidden hose, as evidenced by …

20160617_083246

… mind you that one didn’t need a leak detector to find.

These sensors are advertised as low precision in any event so really not a problem.  So this won’t be of use to meter your water usage.

I am playing with the idea of higher precision flow sensors – to set time-versus-budget constraints  – but I will roll that in as a separate option as such a flow meter can likely go on the input rather than output lines, and as we are using MQTT the high precision flow-sensor can also be separate unit to the valve controller/line flow sensor.

All the signal integration will occur in the main host.

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.

Tossing the coin …

Posted in ESP8266, Lua, MQTT on December 2, 2015 by asteriondaedalus

… is it the hardware or the software?

Not having any luck with the ESP8266 (as an ESP-01).

Seems I have to re-flash it over and over.

All I do in load the mqtt library and then create a client.  It then seems after a couple of minutes the chip hangs and then I get the chip jamming my bluetooth and I think now also my wireless networking at my PC.

If the led is glowing dimly rather than brightly seems to be the warning.  This sometimes happens when I plug in the USB.  That is I don’t get a bright led, it just barely glows … and of course my mouse then stutters across the screen as it is being jammed.

Not sure that it isn’t also temperature related as I did have the thing plugged in almost permanently this last week.

It may be a problem with the board design given the problem with the USB power tripping the problem and then its the potential for  also seeing the mqtt tripping it due to some bug.  Will take a little work to sort out since there seems to be two routes to same problem.  The potential hardware one though is the killer.

It will likely not be much use in the applications I want to use them in as I don’t want to be cracking boxes and jiggling bits all the time.

Still, I am curious.

When I tried a build tool on the web, to reduce the distro footprint, the crack up pumped wingdings to the terminal.  The full distro not so much.

Both times the mqtt.Create() call would close up shop after a while and the light on the board would dim and the jamming would commence.

If I can’t use them for reliable mqtt clients they’ll go in the bin.

The real problem being that nodeMCU is no longer actively supported.  Likely, was a curious side effect of hackers opening hardware design.  I guess they thought other so-called opensource hardware was making money.  However, Chinese knockoffs of the ESP-xx range abound.  Someone will have to front up to take over the baseline.

The other quirk.  I for some dumb reason decided to run the tools in my GoogleDrive folder so that any files was creating from the ESPlorer IDE would be backed up.   Go figure, the IDE creates a *.lck file when it runs (who knows why).  In any event the strange thing was that GoogleDrive would pick it up and you could not delete it.  That meant once you closed the IDE you could not open it again.  Found a tool on Microsoft site has “special powers” and so I got things working again.  I also moved the application folder back onto my trusty D drive.