Archive for the Wifi Category

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 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.

Almost there

Posted in ESP8266, OpenSprinklette, Wifi on December 17, 2016 by asteriondaedalus

I got a prototype shield today to sit between my WEMOS D1 R2 and the quad relay board to work on my OpenSprinklette design.  I will get a PCB made once I debug the design.  It will need a 24VAC to 5VDC on it to power the WEMOS and the relay board.  The 24VAC will come from the wall plug from the old sprinkler system.

Not to mention a couple of pesky pullup resistors and an input for flow meters, though that will take some thought, and of cause ports.  So the flow meters might sit on a WEMOS mini as an afterthought.  Still brainstorming that aspect.

I am still setting up one of my ODROID-C1 to be the mqtt and red-node server.

I will buzz out the system with my PC install of red-node in any event – for the moment at least.

I decided I will add a dip switch to allow for 15 modules.  I will keep one for a broadcast so all on/off.  Most people can get by with 1 or two modules in any event.  So yes, module ID will be 1..15.  Software will sort the zone to module story – of course.

The use of google calendar will mean using NTP protocol isn’t as important but it might serve as a network alive function.  I will need think about response to network down.  All relays open circuit is good general response.

Still, I think we need a watchdog to catch other issues, like the google calendar connection down, so maybe a timer that shuts the zone off after 45min and then calendar events can be set at 1/2 hour increments.  You just set two 30min back to back to get an hour.

I am also playing with options for zones.  The broadcast to all zone can be the calendar entry without title.  Otherwise, a comma delimited set of zone numbers in the title of the calendar entry can be used to set individual zones on/off.

The various weather gadgets are great for prediction but I will need look at moisture and rain sensors.  I found you can get shields for the D1 mini that are lipo battery chargers so I am thinking of a set up with solar power for on house and gazebo roofs for reporting rain and then same in garden for moisture.

Though, the moisture ones would need to be dog proof.  Hmmm.  Bury them, but would the wifi reach the surface?

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.

Phew!

Posted in Arduino, Wifi on May 17, 2015 by asteriondaedalus

Niggly problems when setting up the Blackwidow to talk to home wifi router but, go figure, I wasn’t paying attention. When setting ssid[] and security_passphrase[] arrays one need use you local ssid and passphrase for your router as opposed to the ssid set in the code example AND remember to set “security_type = 3” for WPA2 – obviously had a newbie moment 😉 The other curl ball thrown is that the board seems to take a couple minutes to connect to the router (into which does not appear to turn up on any site I have perused).  I thought it had not worked but McAfee piped up (after a few minutes) and warned “192.168.0.112” had connected to network (which was the static IP address I gave the Blackwidow).  Once Blackwidow is connected to router it appears more reactive. Next step to integrate in the Arduino mqtt library.  4 relay shield on order from China ($6) and I have already cracked open the current watering controller to look at swapping out the signals to the new board.  They are only 12volt signals with a common to all watering solenoids – too easy drill sergeant!

POST SCRIPT

Go figure, some work to port MQTT library as it uses Ethernet library (or Wifi library) not compatible in first instance with WiShield library for BlackWidow.  However, I do note deep in the Client class used in the MQTT client we have buffer marshalling for sending on sockets.  Problem is the BlackWidow examples are using UDP.

One interesting discovery however was the way BlackWidow example built the UDP example it was not intuitive but it clicked they are using virtual methods in the library for user to define.  More than that it introduced be to PT_THREADS for Arduino.  A neat way to do limited threads on Arduino.

I may dabble a little with a MQTT port I can simply stick with HTTP or UDP examples (we are only talking about toggling 4 relays after all).  OpenHAB can work with HTTP or UDP (as well as MQTT) so no show stoppers.

PT_THREADS are, however, interesting.

In hind sight

Posted in Arduino, Nostalgia, Wifi on May 15, 2015 by asteriondaedalus

Looking at it realistically, OpenSprinkler hardware is likely a no-go for me.   Why?

When I looked at it rationally, I have the skills and the technology and I have also lamented the “maker” mentality before (buying things and plugging them together rather than designing and constructing).

Besides the $80 for the OpenSprinkler hardware is about what I paid for the Blackwidow board, a few years ago now.  I used the Blackwidow on a now decommissioned project – so it is sitting there wanting to be used.

BlackWidow

Use me !

 

Why waste it?

Besides a four relay shield is in the order of $6 instead of $80.  I have found a mqtt library for Arduino so will need to integrate that with the wifi (rather than ethernet) library etc.

I might even be able to mod the OpenSprinkler software to control relays via mqtt, instead of driving GPIO pins directly.

Yes, one could go NodeMCU and a $4 four relay board and get a controller under $20, and I will for extensions to the irrigation system.  I just need to get the Blackwidow out of the parts draw doing something useful.

 

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.