Tivo’s decline

Posted: March 30, 2020 in COVID-19, General, TIVO
Tags: ,

Being stuck home right now and watching a lot of TV I am now noticing the limitations of my new TIVO Bolt OTA.

I’ve owned Tivo’s since they came out in 1999, in fact I still have my Series1 Tivo with lifetime service that I used with cable TV, I don’t use it anymore but I have it.  I bought four DirecTV Series2 Tivo’s and used them for many many years.  I finally dropped my DirecTV subscription and went strictly over the air (OTA) with two Series5 Roamio’s one with lifetime subscription and one monthly (I’m still using the one with the lifetime subscription).  I tried the Series6 Bolt when it first came out and it was an unmitigated disaster, it never worked quite correctly with my 4K TV.  Tivo gave excuses but it would periodically flash a red bar on the screen, after months of frustration with Tivo I gave up and put the old Series5 back up and took the Series6 off-line.  Roll forward a few years and I saw Tivo had a refurbished OTA Series6 Bolt for sale with lifetime service.  It came with a 30 day return policy so I bought it and retired the monthly Series5 OTA Tivo.  I figured that after so many years they must have it fixed by now.

So now I’ve had both a Tivo Roamio and a Tivo Bolt running for 3 months now, and I have to say, as much as I like the 4K screen quality the rest of Bolt is terrible.  Tivo removed some of the great features that the Series1 –  Series5 had for what its worth, here is what I think of them:

My first irritation with the referb Series6 Tivo is the lack of Thumbs up and down buttons saving your likes and dislikes for Tivo’s suggestions.  The old Tivo’s had a working thumbs up and down button and if you used them to suggest what you liked and disliked, Tivo made some great suggestions of other shows you might not have heard of and recorded them as space allowed.  Tivo has removed the feature, all of a sudden I find the free space on my Tivo collecting soap opera’s and other crap.  I start looking into why and realize that I can’t use the Thumbs up and down any longer to indicate what I like and don’t like.  I’m getting stuff that Tivo is getting paid to put on my Tivo.  So after  many years of use I’ve turned off Tivo Suggestions.  Great feature lost.  Not a good idea Tivo, not at all.

My second irritation: time, clock time, my Series1 and Series2 Tivo’s recorded programs exactly on time, they got their time from Tivo and it was dead on.  Since then all of my Tivo’s are about 1 minute off, they start 1 minute early and end one minute early, missing the end of some TV shows and the nightly news programs.  Granted in some cases that just cuts off commercials but not always and while you can tell the Tivo to extend the recording an extra minute long but then that slams into back to back recordings.  Just ugly.  You can’t tell the Tivo to shift everything 1 minute, nope there is no setting for that, nor can you set the time of the Tivo, so you have to get used to a 1 minute offset.  Not a good idea Tivo, not at all.

Another reason I liked Tivo was the ability to skip commercials.  I was able to fast forward through them on my recorded shows which was great, later models allowed me to hit a button and skip over the commercials in the more popular shows after Tivo had time to map them.  Great feature, too bad most of the shows I watch were not popular enough to get mapped.  And now with the Edge you can turn on auto skip, again only for the mapped TV shows but a nice feature.  However on this Bolt Tivo is now injecting its OWN commercials just about every time you play back a recorded show.  So far I’ve managed to figure out how to skip them but it’s a pain in the tail and I worry that Tivo might just make it impossible to skip their paid commercials. If I skip too many TIVO commercials the TIVO reboots, now that is a special feature I must say. NOT.  On top of that I paid for a lifetime subscription to Tivo so I could avoid commercials, not be given more of them, if you want to force me to watch commercials then provide the TV guide for free and refund my lifetime subscription. Mandatory Tivo commercials, not a good idea Tivo, not at all.

Finally Tivo changed the fantastic navigation that had been in place since the Series1 Tivo, it was in the Series 2, and Series5.  You could easily flip between the active channels move between settings all with the arrow buttons, never a hickup never a problem.  Nothing was deeper then 2 or 3 clicks unless you were deep in settings adjusting something.  If you try to use the navigation you now have to use a menu bar and the exit button to get in and out of the menus, just extra BS, it gets frustrating, Tivo don’t fix what is not broken.  Also now at the top of the hour and the half hour it’s nearly impossible to shift between active channels, you have to use the right arrow to bring up the active channels as soon as the pop up they pop back… Great. The Tivo is overloaded within it’s menu system.  For years folks have tried to copy Tivo’s interface because it was fantastic, now Tivo has solved that, the current interface is terrible.  Not a good idea Tivo, not at all.

I now own the last Tivo’s I’ll ever buy, it’s a shame really, what was a great product has become a runner up, and not even a close runner up in my opinion. For years I’ve recommended Tivo to everyone I know, even my friends in Australia had Tivo’s before Tivo introduced the Series3 Product in Australia.  What will I buy? I have no idea, as frustrated as I am at my Series6 Tivo I hope it lasts a long time, I suspect it will be a very frustrating search to replace my TIVO’s there are other devices out there, Amazon, Tablo, Sling, or go the DIY route with MythTV/Kodi.  At some point I’ll replace both Tivo’s with something else but likely it won’t be half as good as the old Tivo’s were.

What interesting times we live in today. COVID-19 has been declared a pandemic and has spread though out most of the world and certainly though out the US. We are not ready to deal with something so contagious so we are going into lock-downs, shutting down service businesses, keeping people 6′ away from you. One of the things I keep hearing is the lack of ventilators could be a major problem, that we could be thousands of ventilators short. If the lock-downs work then maybe we will be OK and not need all of the ventilators but who knows?

I got to thinking about it and there was another time when we ran short of ventilators/respirators in the US, that was during the Polio epidemics in the late 1940’s and early 1950’s. Now polio has been around for a long time likely since the time of the ancient Egypt and the pyramids and before. Since 1916 onward a polio epidemics have showed up somewhere in the US most every year, but in the late 40’s and early 50’s the epidemic’s were progressively larger and in 1952 the polio epidemic was the worst outbreak in the nation’s history and over 21,000 people were left with mild to disabling paralysis.

One form of that paralysis was only treatable with a ventilator and back then a ventilator/respirator was an “iron lung” which is a negative pressure device. You create a vacuum in a container that a person is in with their head sticking out of the end, this pulls air into their lungs, then you let go of the vacuum and regular air pressure forces the air out of their lungs. Repeat this 12 to 20 times a minute and you have them breathing. A convenient device? No you are restricted to living in the box so to speak but it beats dying. Over time positive pressure ventilators/respirators were invented, much better and far more convenient. These are tricky to build, you can’t over inflate the lungs without great risk and possible death so not something to play with.  Being a scuba diver I know the risks involved with over inflating the lungs.

Now when the late 40’s and early 50’s polio epidemics broke out they ran short of ventilators/respirators too. But because the devices were simpler and somewhat safer, there was an article published in the “Modern Mechanix” magazine for a DIY Iron Lung replacement called “Emergency Wooden Respirator” This was in the January 1952 issue. Apparently in 1949 a bunch of volunteers built this thing and kept an 8 year old child alive until a “conventional iron lung” could be obtained. Now it had to be run by a doctor or registered nurse but it worked and they could be built fairly easily if you were handy.

Got to wonder, if we end up short thousands of positive pressure ventilators, can we as volunteers, once again jump into the breach and build an updated version of these “emergency wooden respirators” to keep people alive until a regular positive pressure ventilator is available? Looking at the plans at http://blog.modernmechanix.com/diy-iron-lung/#mmGal it does not look like it would be too hard to design and build an updated version 70 years later. I mean a couple sheets of ½ plywood and some 2×4’s to make a cabinet, a rubber inner-tube and electric motor and some gears to make a low pressure vacuum pump. I can think of improvements already, we have household vacuums that can easily power several devices, solenoids and linear motors that can open and close air valves.

Perhaps we Makers need to start now and give this a think, if we are lucky we won’t need any homemade ventilators but if the proverbial excrement truly hits the air circulation device perhaps we should be ready with a new design. Something easy to build and control.  I mean we Makers build things cause its fun, or it’s cool or we need something, this could be important. Personally I hope not, I hope they stop the COVID-19 here in the US well below the available ventilators, but if they don’t knowing how to knock up a workable system could save a life. Food for thought.

Sometimes convenience costs too much

Posted: December 11, 2019 in BBQ, General, Home
Tags: ,

I volunteer on a local Community  Emergency Response Team (CERT) and we are lucky enough to have gotten enough donations and grants to afford a command trailer that we have fitted out with first aid gear, radios, computer, monitor, video feeds and most important heat and AC.  We use it to keep track of weather and such we we work various community events.  In a real emergency the police or fire department might come in and take over as a primary HQ for the duration of an emergency but that is why we have it.

Anyway in the last year we added a propane RV generator instead of an external gasoline generator that made a huge racket.  We have 2 40 lb propane tanks to feed the generator.  With both tanks full we can generate power for 24+ hours, quite nice.

Because the tanks are 40lb size you can’t just take them to the exchange places at the supermarket or a big box store, you actually have to fill them at a propane refill station.  I was tasked with helping one day and we went over to a local store that had a propane station for refills.  They charge by the gallon for propane be it 1lb or 100lbs.  Easy right?  So they put a tank at a time on a scale and start filling.  One tank was dead empty, the other still had some gas left.  About $40 and change later we paid and left.  And I started wondering how could we fill 2 40lb tanks for $40 and change?  One tank was dead empty and the other did have some gas but I pay $18-$19 for a 20lb refill tank at the grocery store.  Hmmm……. Now the grocery store is just around the corner so very very convenient especially when I run out when we are grilling dinner and both of the tanks I own are now empty.  (I have two tanks just to avoid that but somehow it still happens).

The price difference of two (2) 40lb tanks compared to one (1) 20lb tank was just too much for me to ignore, so I went home grabbed my empty tank and went to the propane filling station.  We dropped the tank on their scale and sure enough it was dead empty.  They filled it to 20lb and the price was less then $11.75!  Yikes.  Then the kind gent that was filling the tank pointed out that I had been paying for 15lbs of gas at the swap station not 20lbs.  It said so right on the label from the tank swap company.  So lets see, if I had bought 15lbs of gas I would have paid $8.93 for 3.57 gallons of propane so I paid almost $10.00 extra for the “convenience” of the grocery store!

Now granted a 20lb propane tank has to be re-certified after 12 years (the month and year is stamped into the collar of the tank and again every 5 years after that.  I use at least 4 tanks a year usually more so I’ll be saving at least $40.00 – $50 a year by filling my own tank to 20lbs instead of swapping my tank for 15lbs.  I can replace the tank with a new tank for less then $30.00, problem solved and I end up saving at least $450 – $570 over the 12 years.  I’m sure that I could shop around and find the swap tanks cheaper but no where as cheap as filling them at a low cost filling station.  Really “Sometimes convenience costs too much”.

Do your own math, for those of you who burn propane how many tanks a year do you burn?  I have a friend who uses at least 2-3 x what I burn they have outdoor heaters to go along with their grill for winter use and they REALLY suck up the gas.

Funny, I tend not to blog much but every once in a while I get the urge.

Not too long ago someone asked me what I really love doing. As in what would I do for free every day if I could (assuming I did not have to worry about paying the bills and such). I thought about the question for a while and looked back over my years as a developer and manager of technical types and realized that I love creating new things that are needed by someone, I also love teaching folks about technology. That explains why some jobs in my past have resonated with me more then others.

I recently took a small contract that was really fun, I got an email from a gent that wanted to send Morse Code via light. He wanted to be able to type a paragraph of text and send it over and over again via a light and not just any light, a bright enough light to cover a mile or more of distance. He had a few more requirements:

  1. It had to be self-contained, and portable
  2. Water resistant to water mist and or light rain
  3. Easy to use, he did not want to learn Morse Code, just wanted to type text and have it sent as Morse Code
  4. Able to send the text as Morse Code somewhere between 5 words per minute (WPM) and 75 WPM

As it turns out I am an amateur radio operator (HAM) here in the US and I have my general license (still studying for my extra license), so I know about Morse Code but I can’t actually send or receive it. I tried back in the 70’s to learn it but never could wrap my brain around it. Seems to fit in the same general area as speaking and understanding other human languages besides English (I can’t do that either). I’ve tried to learn Spanish, Italian, Esperanto and Klingon. I’ve never had any success, the closest I’ve come is I can count to 39 in Spanish….. and that was with 6 years of training in elementary school.

Hardware

Thinking over his requirements, I realized I needed some kind of a waterproof case about briefcase size, perhaps a bit deeper then a normal briefcase to allow for a large light to be stored in the case when not in use.

Clearly needed to be some kind of embedded computer to create the text and control the light. Cheap and small, how about a Raspberry Pi (Rpi) model 3B? It’s small, easy to program, has lots of general purpose input output pins (GPIO) and has an HDMI monitor output. Perfect. Of course if you are going to have a computer you need a keyboard/mouse and a display. MonitorInLidAll simple enough. Now what kind of light will be bright enough to be seen a mile away and yet be controllable to be able to send Morse Code. Needs to be bright, really bright. Can’t use Halogen, that gets too hot and will keep glowing even when the power is removed, incandescent same problem, florescent does not turn on fast enough and keeps glowing also. LED fit the requirement – it turns on and off fast and it’s very bright. When you replace a household 100 watt light with an LED you usually replace it with an 8 watt (W) LED, so what if I use a 100W LED? I hunted around and find a 100W spotlight that is normally used on trucks that go off-roading. Now that is BRIGHT, slight problem however it uses 12VDC – 30VDC for power and requires up to 8 amps of current.  Video of a super bright LED light flashing on a blue wall.

We have a computer and monitor that use 5VDC to run, the LED light that requires somewhere between 12V and 30VDC and is high amperage at least compared to the GPIO pins of the Rpi. For easy portability powering it from 12VDC makes sense, that is easily available from a vehicle or a wall power supply. Some bigger trucks use 24VDC so keep that in mind when designed the circuit….. OK I found a DC to DC step down power supply that can handle up to 35VDC input and can output 5VDC regulated for the Rpi and Monitor. Now all I had to handle was the current for the LED spotlight. First thought is use a cheap 5VDC mechanical relay, the Rpi can control a 5DCV relay easily, except one problem. Sending text at 75WPM means that the transition speed between on and off is fast, very fast, in fact much faster then a mechanical relay can handle. So back to the drawing board…… Wait one, how about a solid state DC relay? 3 – 32VDC input for control – 5VDC input from the Rpi check that works, can switch 5 – 200VDC output – the LED light works on 12 – 30VDC, check that works too. Alright a solid state relay it is. Solid state relays can generate heat so make sure I get a heat sink made for the relay. Some miscellaneous other parts, wires, mounts, case, etc and we are off to the races:

So far we have about a $800 parts list:

  1. VideoSecu LCD LED Monitor TV Wall Mount
  2. SAE Cable – iGreely Solar Weatherproof SAE Socket Sidewall Port
  3. MUYI 2 Set Inline Fuse Holder 10 Gauge Waterproof Pigtail Blade Fuse Holder
  4. Kenowa Portable Monitor 11.6 Inch 1920X1080 IPS with 2 Mini HDMI USB(5v)
  5. Logitech K400 Plus Wireless Touch TV Keyboard with Easy Media Control and Built-in Touchpad
  6. RS Components Raspberry Pi 3 B+ Motherboard
  7. Miuzei Raspberry Pi 3 B+ Case with Fan Cooling
  8. Seahorse SE-720 Waterproof Protective Hardcase Without Foam (Black)
  9. DROK Buck Converter Voltage Regulator DC 5V Power Supply
  10. Blue Sea Systems DualBus 100A BusBar – 5 Circuit
  11. Universal Compact Bench Power Supply – 30 Amp Regulated
  12. Universal 6″ LED Spot Lights For Cars – 100W Bright 8000LM LED Off-Road Spotlight
  13. TinaWood SSR-25DD Solid State Relay 25A 3-32V DC/5-200V DC
  14. 8’ Aluminum angle
  15. A 1/8” sheet of Aluminum to bolt the computer hardware too.
  16. Misc bolts, pop-rivets and connectors.

Time to build the system into a solid system. I took the Seahorse case and built an aluminum frame that had 3 compartments, 1 for the LED light, 1 for the computer, relay and DC-DC power supply, and one for the keyboard storage. The entire frame was pop-riveted together, painted black and then the frame was riveted to the 1/8” aluminum sheet. Then nuts and bolts were used to secure it inside the case.

The LED compartment had a slot to allow the LED to be bolted down so the LED could not bounce around in the case, if that happened it would be a disaster, the light was big enough and heavy enough to break everything else in the case if it broke loose. The Monitor mount was bolted to the inside of the lid of the case and the flat panel monitor mounted to it.Computer-Power-Relay

Now wire up the Rpi, monitor, solid state relay and step down power supply. Plug in the external power and it works, it powers up and I get the Rpi logo on the monitor. Fantastic. Now we need some software.PowerSupply

Software

I had told the gent that I was going to use Open Source software on his project, fortunately he knew what Open Source software is so I did not have to explain that to him. I installed Raspbian on the Rpi and did a search for any Open Source application that sent Morse Code, I found only a few. I downloaded the source code to all of them and had a look. My original plan was to crib as much as possible from an application and only write the controlling aspects. No luck there. The few applications I found were not suitable for the project. Most were for learning Morse Code, the best was fldigi that is a radio control application but it was far too complex for the project.

So I had to design from scratch an application that could take a paragraph of text and send it via flashing the LED light. I called the command line application “morse”, I know really original. I used the “C” language as I wanted the application to be compiled and fast. Morse code is “interesting” it’s all about timing, more about that below.

Quick Primer on Morse Code

Morse Code is all about the dot. All the timing in Morse code is based off the time of the dot. So:

  • A dot is one time unit.
  • A dash is three dot time units.
  • A dot dot or dot dash or dash dash separation is one dot time unit.
  • A letter separation is three dot time units.
  • A word separation is seven dot time units.

How fast a dot is depends on how many words per minute you are sending, and from there cascades the rest of the timing. There are two type of timing: “Standard” and “Farnsworth”, the “morse” application can do both types. For more info lookup Morse Code on a search engine.

I designed the application in several sections.

  1. First I built a header file that was a lookup table of dot and dashes for each Morse Code letter and punctuation. I ended up building the lookup table for the most of the entire ASCII table with either dots and dashes or NULL’s for things not in Morse Code.
  2. The next thing I did was write the code to display a letter from the lookup table from that I added the ability to process and display an array of text. That all ended up being in a single C file called “display_morse.c”.
  3. Now that I could display text, I needed a way to load a text file into memory so it could be displayed, that ended up being in a file called “process_file.c”.
  4. Next I needed a way to tell the application the name of the file to load, speed to display it, how many times to loop displaying it, etc. all of that ended up going into a file called “process_command_line.c”.
  5. Of course if you are taking command line input it might be handy to also have config files that set the defaults so you don’t have to use the command line options, that ended up being in a file called “process_config_file.c”.
  6. Finally all “C” applications start with a main() function that is in the file called “morse.c” and the include file called “morse.h” which contains the master structure of variables needed to control the application.

The application is under the gpl v2 license and is available on github  It does use two library’s one of the library’s is specific to the Rpi to run the GPIO pin that controls the LED light and would need to be replaced if a different embedded hardware system is used, the other library is to parse command line options and can be used no matter what hardware platform is chosen.

It was truly a fun project and met his needs. It’s used on a really large field where they fly drones and don’t allow any radio communications except the drone controllers. Turns out there are apps that will read Morse code signals sent on light by cell phones! Who would have thunk??? So you can receive Morse code via your cell phone for short range communications but for truly long range well that is where a special project like this comes in. So if you need a special device and you can’t buy it on Amazon or at Target or some other store, and you really need it, get it touch with me and likely I can create it for you.

 

I started a company about 18 months ago, Secured by THEM. It’s a small company that I created to help small businesses be more secure on their networks.   There are bigger business that do this but they are not targeted at small businesses.

It was shocking to me what I’ve discovered since I opened the business: Any company with a cable modem as their primary Internet access has it set up incorrectly.  If you get your Internet connectivity from a cable company your cable modem is your first line of defense against Internet intrusion (being hacked).  If it’s not configured correctly it leaves a gaping hole in which crackers can reach in and infect your machines.

Apparently the tech’s that install cable modems are taught to pull a cable into the house or office, attache the cable modem to it and power it up.  If it boots and turns on the correct lights in the right order, it’s “good” and ready for the customer!  Usually the cable person attached a computer to the device and if they can reach the cable companies web site they are done.  If the cable modem has a standard default password like “password” the tech will change that some something random and write it on the side of the modem, but now a days, most new cable modems come from the factory with a random password assigned.

Little or no testing is done and little to no configuration at all.  What makes this even worse is how little you can do to correct the situation especially if it’s a “business” installation,  you’ll have a little more luck with a “home” installation.

If you are a business class user with many cable companies business class service you are out of luck you, can’t get the password and you can’t log in, the only thing you can do is buy a firewall and ask the cable company to bridge the modem to the firewall. (And of course setup the firewall correctly.)  I’ve watched some of the folks do installs and they leave the modems as they come out of the box!

If it’s a home based business you have the password to the cable modem (it’s usually on the side or bottom of the device) so you can log in and correct some basic mistakes.  But depending on the company and the cable modem you might be better off buying a firewall too.

Lets talk about what settings I consider to be  critical:

  1. Firewall functions turned on and set to the highest settings that allow you to get work done. (Medium or High)
  2. Universal Plug and Play protocol  (UPnP) turned off. The UPnP protocol “Internet Gateway Device” is not secure and can be used open your firewall up and make it easy to access machines in your network.
    1. See http://www.upnp-hacks.org/igd.html
  3. Primary WiFi network security using WPA2 or better security turned on.  WPA1 and WPA2 were cracked in September of 2017 and requires patches to be secure.
  4. WiFi Guest network turned on with WPA2 or better security turned on. Never leave WiFi access unprotected, never.
  5. If possible turn on 2 or 3 separate Guest networks, one for any device you own that leave the network and come back (phones and laptops) and one for Internet of Things (IoT) devices, friends and acquaintances” that ask for WiFi access.
    1. Coffee Shops can be places of infection.
    2. IoT devices in many many cases have little to no security and no security updates available.  More security issues in 2018.
  6. Remote access turned off.
  7. Turn logging on, it’s normally turned off.

Settings I consider to be important but you might not, or might not have.

  1. Static IP addresses via the DHCP server for each computer on the network.
    1. MAC address lockdown on the DHCP server so that no computers can get an IP address on the network without being manually added.
    2. You might only have this for the WiFi connections, some devices limit MAC address lockdown to only WiFi.
  2. Remote logging of cable modem logs to a computer that can store them for a couple of weeks vs the usual couple of hours or a day.

This blog went a little longer then I expected, so I’ll pick up with my next blog showing how to secure a Motorola Cable modem.  From there I’ll show setting up a Linux Firewall.

Pondering

After writing the pseudo code for the watering program, I let it simmer for a few days and then started on real code.  First thing I did was write a config file in the json format.  The target was to describe the watering zones in the system. ow many there are, should the program use syslog to log actions, and finally is there a rain moisture gauge attached and if so what kind is it (for now I only tackled a digital gauge that is either open or closed on GPIO 15), and there is a version number so I know what the file might contain as it evolves.  And yes the zones are 0 based, this file is not really meant for human consumption, though its pretty easy to read really.

Config.json

It looks something like this:

{
    "version": 0.1,
    "controller_name": "this watering system name",
    "log": 1,
    "zones": {
    "total": 8,
    "zones": [
       {
           "zone": 0,
           "name": "Human name of zone 0"
       },
       {
           "zone": 1,
           "name": "z1"
       },
       {
           "zone": 2,
           "name": "z2"
       },
       {
           "zone": 3,
           "name": "z3"
       },
       {
           "zone": 4,
           "name": "z4"
       },
       {
           "zone": 5,
           "name": "z5"
       },
       {
           "zone": 6,
           "name": "z6"
       },
       {
           "zone": 7,
           "name": "z7"
       }
      ]
    },
    "gauges": {
        "rain_moisture": {
            "present": 1,
            "bus": "GPIO",
            "type": "D",
            "device": 15,
            "signal": "NO",
            "use": 1
        },
    }
}

Watering

Once that was done and tested I located an open source json parser library that could parse that in easily.  No point in reinventing a wheel when there are perfectly good ones available.  The parser I ended up choosing was parson.  It’s lightweight and pretty easy to use. You can find it here and it uses the The MIT License (MIT) so all good open source stuff. Next I needed a watering program stored in json format.  So it contains the human name of the watering program, an option to use or not use the rain moisture gauge, then the zone info, including the count and zone info including zone number, how much water to deliver, the amount to deliver at one time, and a version number so we can track the file as it evolves.

wp1.json

{
    "version": 0.1,
    "program_name": "3 second watering",
    "use_rain_moisture": 1,
    "zone_info": {
        "total": 8,
        "WaterCycleExtraDelay": 30,
        "zones": [
            {
                "zone": 0,
                "WaterLength": 3,
                "WaterCycle": 2,
            },
            {
                 "zone": 1,
                 "WaterLength": 3,
                 "WaterCycle": 2,
           },
           {
                  "zone": 2,
                  "WaterLength": 3,
                  "WaterCycle": 1,
           },
           {
                  "zone": 3,
                  "WaterLength": 3,
                  "WaterCycle": 2,
           },
           {
                  "zone": 4,
                  "WaterLength": 3,
                  "WaterCycle": 2,
           },
           {
                  "zone": 5,
                  "WaterLength": 3,
                  "WaterCycle": 2,
           },
           {
                  "zone": 6,
                  "WaterLength": 3,
                  "WaterCycle": 2,
           },
           {
                  "zone": 7,
                  "WaterLength": 3,
                  "WaterCycle": 1,
           }
        ]
    }
}

Got that done, used the json parser to read that into the application.  Now we are cooking.  That sets up 8 zones to be watered 3 seconds each (that makes it easy to test) with a cycle time of 1 to 2 seconds to each zone will get run at least twice and 2 of them will run for a third time. So then I wrote the main code that will actually run the watering program and it’s working.  It’s not final, it has some bugs to be fixed but it works….

What remains to be done?

What remains before I can start testing it with some alpha/beta testers?  Some code cleanup add minor features, really it’s pretty much ready, it reads a rain sensor now (NO  or NC) it waters according to cycle, it knows time and date.

OK, sat down over the weekend and did a bit of pseudo code for the watering program.

Easy when you think of it:

  1. Grab command line to see what watering schedule to run
  2. Load system config so I understand my hardware
  3. Load the designated watering schedule
  4. Set up a loop to run all of the zones, if zone is not active or does not have any more water time go, loop to next zone, else:
    1. Check the global gauges to see if we can water, if not exit program with reason
    2. Check zone gauges to see if the zone can be watered, if the zone gauges say no water, zero the zone and go back to the top of the loop
    3. Determine how long to water, either to the limit of the soil or for the full zone time
    4. Start watering the zone
    5. Sleep for the determined time
    6. Stop watering the zone
    7. Go back to the top of the loop and keep doing it until all water delivered to all zones or we are bumped by gauges.
  5. Shutdown any specific hardware as necessary (make sure the water and the pump (if you have one) are off.)
  6. Exit program with status

Now there are some nuances there, logging and other bits but really that is it.  Overly simplistic and lots of detail to pay attention to but at the highest level no need to check things second by second.  And if for some reason I determine I have to check things more frequently than at each zone change I can by using threading but I don’t currently see the need for it.

So the first thing I decided to have a look at is what format are my data files?  Gave that a lot of thought, XML, YAML, JSON or some home cooked format.  After careful consideration of both the input web program and the watering program I decided on JSON for a bunch of reasons, its light weight, there are standard validation tools that can easily tell me if the file if formatted correctly, and its easy to write a json file from web software and their are a bunch of parsers under open source licenses so I don’t need to reinvent the wheel.  Finally it’s pretty easy to hand craft a json file and get it correct so I can get the watering program done and tested without the web front end.

In some ways I don’t love JSON, the pure form does not support comments in the file.  Several parsers do support C and C++ style comments but its not part of the standard as best I can tell.  Of course some people don’t believe in comments so it matters not to them but I do like them..  Oh well the rest of the file format I like well enough.

The other thing I thought about was possible devices attached to the sprinkler system to determine if I should actually water now, or things on the Internet I can reach out to, they are:

  1. Weather report
  2. Temperature gauge (don’t water if too cold)
  3. Rain moisture gauge (don’t water if raining right now)
  4. Rain metering gauge (don’t water if we got enough water in the last day, tricker as we have to have something monitor this all the time)
  5. Wind gauge (don’t water if the wind is blowing too hard, you will just water the neighbors yard)
  6. Ground moisture gauge (one for the entire yard or one per zone, if the ground has enough water now why add more?)

Additionally some things you need to know are:

  1. How many zones are active in the system
  2. Does the system use a pump to pressurize the water, if it does you need to turn it on for each zone to water
  3. Do you want info logged about how much water is put out and what was skipped (if anything because of gauges)

The metering rain gauge is bothering me, I thought I’d only need a web front end and a watering program but to track a metering gauge will require monitoring it all the time.  So I guess that will call for a daemon program that watches the gauge if you have one and accumulates water over time so you can decide if you need to water at all. Hmm, I think I leave that to last, or maybe someone else will code that since I don’t even have such a gauge, though I know they exist.

On to the next step coding the load the config.json file into memory and parse it.  Language well that will be “C” since I prefer that over Python.  IMHO Python is nice for proof of concept and quick one off scripts but I really prefer “C” for the watering program.