Monday, August 8, 2016

Sensing Temperature and Doing Something With It

A few weeks ago my defrost controller in my freezer died <link>. One of the two relays had just quit conducting current. These things are sealed, and I didn't want to just clean the contacts and have it fail, so I modified the code a tiny bit and switched to the other relay. About two weeks later, the other relay died. One relay lasted a couple of years and the other one a couple of weeks. Both relays would click, but it appeared the current just couldn't get through it. Sigh.

I ordered another two relay board with the same relay as a replacement. I seems almost all of the relay boards for the Arduino use exactly the same relay. When I looked at the specs more carefully, they are rated for 10 amps, but only a fraction of a horsepower. I'm pushing them at the limit by running the compressor through them. But, ... I can get replacement relays for about twenty cents if I buy 10 or more of them, so maybe I'll just put in a relay socket and rotate the relays on some schedule. I could also come up with my own shield board and use a nice big quarter horsepower relay in there. I'll look into that later, but I needed the freezer running properly; I installed the new board with the two relays paralleled to (hopefully) double the life by cutting way down on the surge current each relay had to handle.

A few days later I had visitors with small kids. The kids were fun and enjoyed the desert and especially the pool when the afternoon was around 115F. However, the frequent trips to the freezer to get ice and little hands managed to leave the freezer door open a little bit and the evaporator on the bottom froze up.

I drug out the heat gun and melted the ice and the freezer took off and started working again, but this was the second time in less than a month that the freezer had given me trouble. Clearly, I needed to monitor it somehow.

I thought about using various methods to look for ice build up on the evaporator, or sense the airflow that should be moving through it, but they were too complex for a simple job like this, so I decided to just monitor the temperature in the freezer and set off an alarm of some kind (email, text message, big red light, siren) when the temp reached some level. I already have a temperature monitor that runs on batteries <link>, but I didn't really want to put one of those inside the freezer. Mostly because I'm not sure it would work at temps below zero Fahrenheit, and the moisture would probably kill it anyway. Since I already had an Arduino in the top of the freezer running the defroster, why not just attach a temperature sensor to it and get the reading that way?

Also, since the Arduino has an XBee attached to transmit when the defroster is running, I could transmit the temperature to my house controller and actually log it to my database server up in the attic.

It took a couple of hours to come up with the first version of the Arduino code and another couple of hours to figure a way to get the temperature sensor inside the freezer. I wound up actually drilling a hole in the freezer and feeding the sesnsor down inside where it could catch the airflow inside. I just can't praise these little temperature sensors enough. I used one of the sealed DS 18B20 sensors that have a stainless steel can over them:

These have a wire long enough to run where I needed it and are as easy to read as the regular 18B20. Nice solution with no calibration required.

When I got the Arduino part running, I went to my house controller and added code to catch the XBee message which now contained the temperature as well as the status of the defroster and started saving the data to my database. Then, I modified my status web page to display the freezer and set up some code to grab the reading out of the database and display it for a 24 hour period.

While I was doing that I realized that I was already grabbing the power usage of the freezer using an Iris SmartSwitch so I couldn't resist saving that data as well <link>. Now I could display both the power usage and temperature on the same graph. Heck, now I can see the health of the freezer at a glance and (maybe) catch a problem before it melted all my frozen food making a nasty mess that would take hours to clean up, and cost a bunch of money.

I was standing back, watching the blinking lights on the freezer and looked over at the fridge ... I really should do one of those for the fridge also, shouldn't I? I went back over to my box of parts and drug out enough pieces to build another device. This time I didn't need relays because I wouldn't actually be controlling anything, just monitoring stuff. I wound up with these pieces to build one of these:


The board in the upper left is an XBee shield that allows me to choose which port I hook the XBee serial lines to. I use the serial port for debugging and then use SoftwareSerial to enable a couple of digital pins to control the XBee. The XBee is lower left; the Arduino is center beside a 4.7K resistor. You HAVE to have the resistor for the sensor, far right, to work. Since I managed to grab a handfull of Arduinos for three bucks each some months ago, the whole collection, including the XBee cost less than $25. I powered the entire mess with a wall wart that I picked up for a buck or so and used one of my many USB cables for the power cord. Straight forward and simple project.

I also modified the code for the Arduino such that the name of the device is taken from the XBee and used in the message I send. That way, when I build one of these for the freezer I have out in the garage, there are no code changes needed at all, I just name the XBee to match the device I hook it to.

Then, I made the same kind of changes to my controller code and database as the freezer and I can monitor the fridge exactly the same way. I took the easy way out on the web display and just added a couple of tables to the html to display the current temp and a button so I could get to the graphs for each of them:


Since getting the highest and lowest values for a 24 hour period is a database query, I can display them. I added the status of the defroster to the freezer because it can get warm for a few minutes in there when it's running, and I didn't want to get excited when I saw a higher reading if that was what was causing it.

The indicator on the fridge is on because I haven't decided what to set the indicator to yet. I want a few days of data before I start setting up alarms to tell me something is wrong. I'll probably wind up setting it to 50F or so though.

When you click on the 'Chart' button for the freezer you get:


The wide jumps in power are the compressor turning on and off; the narrow spikes are the ice maker doing its thing; and the jumps that go off the chart are the defrost cycles running. I need to do a little tweaking on the chart to keep that from going off the top. Notice how the temperature rises slowly and then crashes down when the compressor turns on? There's a little interaction between the temperature changes and the frozen items in the freezer that causes some 'ballast' effects. It's all good and everything is fine.

Similarly, the fridge graph looks like this:


This looks cleaner because there's no ice maker or defrost cycle to clutter things up.

It's nice being able to actually see how the appliances are working and what level of power is actually being used. I still have to decide what values I'll set up for alarms for the devices and implement them in some fashion. I'll probably just send myself email telling me to take a look, because it takes a few hours for something bad to happen when the fridge or freezer acts up. The big thing is that now I can.

While I was doing this I noticed how easy it is to save my own data locally and then do something with it. For years now I've been using cloud providers like Xively, GroveStreams, etc. for this. I'm going to totally reverse that decision. As I've said a number of times, I hate depending on some provider out there somewhere to save my data for me. When the internet goes down, my data just drops on the floor and disappears; saving it locally for a year or so is not that bad and I have complete control over it. I won't have to rely on the provider not changing the interface, changing the storage price, changing the manner they deal with me, etc. Home automation and monitoring is a multi-year endeavor and internet companies work on a month by month basis. Not a good combination.

Don't get me wrong, I love the IOT (Internet Of Things) idea, but to me, it means being able to get to MY things over the internet without having to rely on someone else's company policy.

All the code for this is in github if you want to grab something.

Friday, April 8, 2016

I Guess I'm not Really Annoyed at the Raspberry Pi

But, I just spent three days recovering another one. Almost exactly a month later than the last failure of one of my Pi's, the one serving as a house controller lost the SD card as well. Not terribly surprising, since I replaced the card at roughly the same time as the one that failed last month, but man it's annoying not being able to update the device without getting the latest OS (Jessie).

My whining last month (link) was because there was no way to do the update, upgrade cycle without Jessie being installed. This time I expected that, but I didn't expect them to have changed the way the USB handled USB serial devices. Took a few hours of poking around to figure that out, and of course, it was relatively simple to take care of.

In the interim, my Pi 3B came in and I got it running. That little thing is a whole lot faster than the preceding generations. It almost runs like a laptop. Boot up into the Xwindows system is pretty quick and it works exactly as expected. I didn't experiment with the blue tooth and wireless yet, but they seem to work just fine; the wifi connected to the house on the first try. I don't like wifi for controlling things around the house; the reliability just isn't good enough, but it's nice to have available. Blue tooth is a waste for my purposes, but it makes the boards sell better, so who am I to complain.

I didn't install it as my house controller because that would limit how I got to play with the new board, so my house is still running on a version 1B Pi. I hate the form factor of that board though, so I'll definitely be upgrading it to the Pi 3B to get the better form factor. Especially since I've already gone through the pain of upgrading my software to Jessie.

Lessons were learned. It was really inconvenient having to turn the darn lights off myself. My bedroom was dark when I went to bed; I actually had to turn on the overhead lights all by myself. I'd forgotten how to run the control panel on my pool and had to hunt down the manual for a couple of things. I couldn't check the garage doors from my phone and actually had to drive home once to be sure it was closed (it wasn't). Stupid water heater wanted to run during peak period.

The only thing that didn't drive me nuts was the house thermostats; they're mostly autonomous, so they took care of themselves.

Obviously, I depend too much on a single device. I guess I'll split functions to different devices and do things like have a default configuration for the water heater that always shuts down the electric element during peak periods. The pool will have a dedicated device that makes sure it doesn't run during peak periods. This will be easy since each piece has it's own code that has been made independent of what machine it runs on; I've just been complacent about setting up such a system.

Yes, it will mean more little machines that will have to be backed up somehow so that failures aren't hard to fix. There will also be problems with the stupid power supplies failing. Most of my power supplies have failed at least once; the manufacturers just don't understand that we need a good supply for these things at a reasonable cost.

Speaking of Pi power supplies. I just got a couple of these from Gizmo Junkies.
It's a real power supply that was actually designed to power one of these little computers. It actually supplies 5.3V and can slam out well over an amp of power without getting hot. I haven't pushed it to the limits to see what happens, but they do things like supply a REAL usb power cable so you don't get a huge voltage drop over the cable. I got mine on Amazon (prime shipping), but they're cheaper on the Gizmo Junkies site. I might just save up some money and get a few of these to scatter around the house. They only take up one plug on a power strip and you can change the cable and power Arduinos off of them as well.

Sorry about the randomness of this posting, but I'm still a bit frazzled from trying to remember all the packages I had installed on the Pi to make it work.

I think I'll rebuild a tractor hydraulic cylinder or fix the fuel system on my gas string weeder (again) to recover.

Thursday, March 10, 2016

Woodpeckers and Destruction

I don't really hate woodpeckers, but it gets real close. These winged engines of destruction are everywhere here, and constantly work to annoy and dismantle things. It's early spring here and the males are all out looking for girls. They do this by perching on my chimney caps (aluminum spark arrestors) and peck away in a particular rhythm.



Some woodpeckers sound like a machine gun, others peck 6-7 times then pause and repeat. Some do the three shot shuffle over and over. It appears that each chimney cap artist has his own riff and is very proud of it. All of them scared me at first, entertained me for a day or two, then just became annoying. Every morning begins with the staccato drum beat of some girl hunter seeking attention. I much prefer the neighbors rooster.

The noise of my chimney caps being pounded by a woodpecker carries a long way, and the jerk doing the pounding hopes it will attract a good looking gal woodpecker for amorous intent. If they do attract a female, then they get busy which leads to needing a place to nest. My winged pests are Gila (pronounced hee la) woodpeckers and often (too often) nest in holes in my precious Saguaro (pronounced saw wa ro) cactus. They actually drill holes in the side and move in; laying eggs and nurturing the next generation of annoying little flying cretins.



Sure, a BB gun and a little practice could lessen the impact, but not only were they here first, they are protected. Not sure why they are protected, there's about a hundred around here and more next door, but who's going to argue with a game and fish officer holding a ticket book? Someone told me they are classified as migratory and fall under some treaty or other that prohibits killing migratory non-game birds. Mine don't migrate any farther than the neighbors house; they're here all year. To be honest though, I have taken an air-soft gun and done a little target practice from time to time. Those things (air-soft guns) are horribly inaccurate at any distance and I never managed to hit one. It did teach the woodpeckers to fear me; when I walk outside, they're gone; off into the trees to screech at me to leave the area.

The little pests even hang off my hummingbird feeder and chase the hummingbirds away to keep the sugar water all to themselves. I had to stop putting bird seed out for the quail, dove and cactus wrens because it also attracted the woodpeckers. Once they got to hanging around the house, they decided to eat it.

I have vigas (pronounced vee gaa) sticking out of the house as decorations. They simulate the building techniques of the native builders of hundreds of years ago. The Spanish that came later adopted the same techniques and having logs sticking out of your house became something cool. The problem is that the woodpeckers began to drill holes in them. Once the holes penetrated the finish layer, the wood dried out and made the vigas sound hollow. When the woodpeckers hear a hollow spot, they assume there are bugs inside and drill away, which makes more spots dry out. Yep, a vicious cycle of destruction that leads to a viga that is full of cracks and holes eventually causing it to fall apart. I've repaired them several times over the years; once actually taking them down and filling all the cracks and holes with recommended wood repair materials and then putting them back up. I used really good elastomeric paint heavy caulking to keep the weather from eroding them.

Totally wasted effort, the woodpecker attacks destroyed them. Take a look at one of them:


Yes, all that damage was caused by the protected Gila woodpeckers around my place. Let me show you another one:



Notice there's no log end sticking out of the hole? That's because it finally dried up enough that the fasteners wouldn't hold it any more. It's on the ground broken and looking really sad.


Obviously, I'm losing my battle at protecting my vigas. I decided that wood just wasn't going to cut it; I needed some other solution. I considered forming sheet metal into a cylinder and putting that up, but I couldn't find a sheet metal shop that was cheap enough to do it, and the metal would look like ... well pipe sticking out of the house. Maybe I could cast them out of concrete and put that up. When I looked into that the mold became a nightmare of complexity. That kind of project should be left for something large and beautiful. Besides, concrete is really heavy. Then I went looking on the web for someone else that had this problem and it turned out there was a product that looked perfect.


This is a fake viga cast out of polyurethane foam. It looked like the perfect solution: Sun survival is relatively good, and excellent if there is a good paint protecting them. Light weight. Hollow so a mount can be put inside. They don't dry out. They look like wood if you are a few feet away. The only problem is they are a bit pricey and shipping is a factor because they are pretty big.

I ordered and received two of them to try out the idea. Of course, the first thing I did after unpacking was to flip one over to look at the insides.


The hollow interior is just perfect for making a mount. All I had to do was chop up a piece of pressure treated wood and mount it to the house, then slide the fake, er uh, faux viga over it and drive in a couple of screws.

After cutting out a bunch of debris from the hole, removing the sealing caulk from the edges I put my newly made mount in and shoved the faux viga into  the hole over the mount. A couple of weather proof screws later, it was mounted.


I still have to caulk around the edge and do some painting, but it worked. Based on experience, painted plastic lasts essentially forever in this desert, so the replacements should outlast me. If a woodpecker does poke a hole in it, I'll just fill it with silicon seal and paint over the spot. A simple once-a-year inspection should keep me from having this problem again. They won't mold, rot, attract termites; GREAT!

I still have the other one to install and then I'll order two more. My plan is to spread the cost over time replacing the worst of the originals with each order until I'm done and can stop worrying about woodpeckers destroying this part of my house.

Until the next battle with the vermin.

Wednesday, March 9, 2016

My Weather Station is Back Online

Yep, I got it working. About a week ago my weather station Raspberry Pi died, and predictably, I couldn't get it back up without major work <link>. It's all better now running on a Raspberry Pi model B. Yes, I know that isn't the latest of the Pi series, but I had it already, OK.

The Raspbian Jessie booted to a graphic user interface directly, not to a command line. This was a bit of a surprise because I usually bring up the Pi's I have headless so I don't have to hunt down enough equipment to bring them up on my TV. But, since I had the stuff handy from trying to get it working before I gave up and just reloaded, it came up and I configured it, then stopped the GUI. Loading the GUI makes the boot sequence much longer and I usually just use putty on a laptop to control these machines, I don't need it.

Contrary to many posts out there, the configuration screens worked just fine. I was able to assign a static IP address and finish the configuration easily. There was a little hunting through the various menus and icons to find things, but that's part and parcel of any first time installation.

But installing my stuff turned out to be somewhat harder than I expected because, as usual, every piece of supporting software had changed and I had to hunt down what I needed. I used the latest (as of the date on this post) version of libusb, it was 1.0.20, which was several versions later than the one that I would get from a normal apt-get on the Pi.

This version worked well and had a few 'gotchas's' in it that I had to stumble through to get it to work. There was enough documentation and forum postings out there that I found to help me through the process.

I also used the latest rtl-sdr. It was pretty easy as well, but also had a couple of things that I had to chase down. Then I loaded the version of rtl_433 that I had set aside so I wouldn't have to keep making my changes in that code. With the poking around I did in libusb and rtl-sdr, this piece was super simple.

I hooked them all together by starting things on the command line and it worked well. I was able to read the weatherhead RF signal and save it off to my database. The interface I have to move the data around for viewing worked just as it had before. The only thing left was to implement start up  and restart using systemd instead of upstart.

For those of you that wonder why I needed all this, let me describe what's going on a bit. The usb implementation on the Pi is kernal based and not easily modified by the user. That means I had to get libusb and install it. libusb is a user space interface to the usb capabilities on Linux. Then, I had to be able to read one of those sdr radios so I could find the RF signal from the AcuRite weatherhead. I posted about this earlier <link>. Now that I had the signal, decoding it requires rtl_433 which is a piece of software that was developed to decode the signals of many of the wireless devices available such as thermostats, temperature sensors, door bells, weatherheads, etc.

So, it's software piece piled on software piece piled on ... Sure, I could have incorporated all the things I needed into one piece of software and just ran it, but that's not what leveraging software is all about. You use the piece that does the job you need and add special tweaks specific to your implementation. That saves time and doesn't cost much if anything.

With it working and the only piece left being restarting the processes, I dived into systemd. First though, a tiny bit of background. Unix (and linux came from unix regardless of what people say) has to have something to get it going. This used to be the init process. Init would load the various pieces of software and handle how they interacted. Over time init was replaced with various other things that had more features or less bugs. As is rampant in unix and its derivatives, everyone hated something about each of them. Raspberry Pi uses an operating system called 'Raspbian' which is Debian modified to work specifically on the Pi. There are a ton of other operating systems and the choice of which one to actually use is totally up to the person that installs it. I chose to use Raspian because it was the one the folk that produced the Pi chose to supply. I figured it would have the most support and documentation of various forms over time.

The Raspian that I installed with my first Pi used Sys-V init. This system five init is really old and complex to use. I hate complex, so I replaced it with the clearly superior init process call 'upstart'. Upstart is cool and easy to use once you install it. However, the Debian folk decided that the init process 'systemd' was better and moved to it. Raspberry folk went with the trend and moved to it as well.

That was the decision point that caused me to have to rebuild the weather station Pi from scratch. Upstart wouldn't allow the Pi to boot up at all with the new Jessie level OS that you will get when you update your Pi. But, I did all that and now I faced the dreaded systemd configuration. I looked at about a hundred web sites that discussed how to use systemd to handle starting and restarting a process, and quite honestly, was about to give up because everything was too complex and peppered with 'try this' to give me enough confidence to dive in.

At this point I want to mention that following Linux questions on a forum is so predictable. Someone has a problem and asks for help with it. The first response is to ask for more information about how the system is set up, what they saw that wasn't mentioned in the question, and usually some test or other that can't be run because the problem won't let them. Then a response asking them what they are doing. Then a response that says they should be doing it another way because that way is so much better. Then several posts about how it should be done regardless of the original intent. Lastly, the thread ends with no resolution because the discussion has wandered off into never, never land.

I saw that over and over. I finally stumbled across a blog posting (love blog postings) that whittled all the crap down to something amazingly simple compared to what I had been clicking through for hours <link>. Neil cut all the crap out and just showed how to handle a simple case. I didn't have to dredge through long discussions of 'units' or 'forking' or relative merits of daemons; I could just take his example and use it. It worked first try for one of the processes and third try for the other.

Then I configured logrotate to handle the log files I use for debugging and I was done. Finally.

I still have to back up the SD card and store the image on my NAS, and I'll probably back up the other Pi's just to be somewhat safer (obviously you can't actually be 'safe'). I'll also update my github repo for the various things I changed along the way, but that won't assure me of no problems the next time, just make it somewhat easier to recover.

What will really make it easier the next time is what I learned this time.

Sunday, March 6, 2016

I Wanna Talk About My Neighbor and a Big Hole in the Ground

As I've driven you nuts with in the past, this is Arizona USA, and it gets hot here. That pushes our electric bills through the roof for about half of the year. Some of us are taking measures to lower this expense and still maintain a good standard of living. Doing this isn't cheap in the short term, and most of us that pursue lower costs hope to live long enough to recoup some of our outlay.

It's not likely, but it gives us hope.

I have a neighbor that is going for it in a big way. He's working on geothermal cooling for his house. Sure he could have hired a company to come out and destroy his property and put in some half-baked system that he didn't understand, but instead he bought a backhoe and went to work. In this description (I have his permission) I'm not going to mention how close a neighbor or give any directions to his place. I'm also not going to name him, we'll call him George for this discussion. It's not his desire to have a bunch of people stopping by to look at his work or some government official taking credit for it.

So, George got the idea when he put in a well without a well bottom pump. Instead he used air pumped down the hole to percolate the water a few hundred feet up a pipe into a storage tank. For those of you that understand this, that means no moving parts at all in the well; nothing to break or have to be removed periodically for maintenance. Slick and it works like a charm. He had a little trouble intially with the ground level compressor, but it's all worked out now and runs every day. This was a big win and will pay for itself (the pump part, not the water well) in a short time.

First, he has a huge obstacle to overcome - the heat. The hole can't be six feet deep and cool anything because, like the cold country, the surface temperature reaches down that far. He decided to go deeper and wind the hose that will carry the cooled fluid into a big pit. He'll then pump the cooling fluid up to a heat exchanger of some kind transferring the cool to potable water that can be used to condition the air in some fashion. Current thinking is to just use a swamp cooler and circulate the water with the geothermally cooled water.

His backhoe is bigger than mine and he started the project by digging a small area a couple of feet deep. If you've been a reader of mine, you know what the soil is like here. It's basically rock held together by caliche with a shallow layer of extremely sandy organics for a surface. I did a post about a simple one cubic foot  hole I dug and what I got out of it that you can look at to illustrate the situation <link>.  This led to changes in his technique, modifications to the backhoe, and tons of debris (literally tons).


Here's his backhoe and the really cool rock screen he made to separate the rocks from the finer material (can't call it soil). For those millennials out there, the backhoe is the thing with wheels. To use the screen he dumps the material he dug out on the far side and the small stuff falls through leaving the rocks behind. Then he takes the rocks and piles them somewhere out of the way. The small stuff he'll use to refill the hole.


This is the beginnings of the hole. Notice what I was writing about the composition of the ground: a tiny layer of sandy organics and rock bound caliche the rest of the way down. Ever wonder why the desert doesn't have trees? Now you know.


There was a big granite rock over there that had to be dug around.


And, sometimes, bad things happen to the equipment. This took some time to fix, and wasn't the only time the machine broke down. From the beginning of the project to now, he has rebuilt most of the digging parts of the tractor. Only minor problems with the motor, hydraulic pump, and such, but everything that came in contact with the dirt had some time wasting problem or other.

But, let's look at the hole again. Here it is a little deeper.



And, here it is finished.



Notice that it has a ramp leading down into it? That's so he can actually get the backhoe down into the hole to dig, and then get the dirt out. Also notice how the dirt layer seems pretty deep on the far side; that's where the rain washes down and carries some mud with it. This project has been going on for months, so some weathering is expected. Here's a shot of the bottom on the hole, he back filled it a little to cover the rocks.


Eventually, he'll install coils of flexible pipe in the hole, protect them to some degree and then fill the hole back in. Pumping water down into the pipe will circulate it through the cooler material down there, and then he will transfer the cool into his house. This will work to warm a house also, but not much need for that here. Bet you're wondering where the rocks I talked about are.


There's several piles like these; here's another one.



No, not all energy saving projects taken on by individuals are small. Sometimes to have an effect, you have to think bigger than a tiny computer and some wall switches. The beauty of doing this kind of thing is that your skill set increases exponentially. It makes you understand the reality of what can be accomplished.

I'll be following this project over the next months, more later.

Thursday, March 3, 2016

How Can I Possibly Be Annoyed at the Raspberry Pi

Yes, they're all over the place and my Google news feed keeps telling me about how wonderful they are, but I almost threw one across the room today. The story is that my weather station Pi lost its SD card; they do that sometimes due to the heavy usage the cards aren't designed for. I've had it happen before, and thought I was prepared this time. You guessed it, I wasn't.

Yes, I have backups of the system, and backups of the software; the problem is that I didn't expect the folk that control the Raspberry Pi software to close some doors on me. You see, after I decided to update and upgrade the OS on the Pi, it wouldn't boot. I like to stay reasonably up to date on my stuff, but often wait a while to get the latest OS and tool changes. With the other non-technical projects I've been working on, it's been a few months since I took the time to update the little machines. During this period Raspberry Pi went from Debian Wheezy to Jessie.

Besides the usual wondering who the heck thinks up these silly names, I thought now would be a good time to update my systems. That was my first mistake; my second was when I didn't read ALL about the changes in Jessie. You see, they decided to use 'systemd' as their default init process and I switched to upstart quite a while ago because it was better. There's a few hundred pages out there on what's best and why, but I don't really care about that; I just want something that works, and I can keep updated.

Fine, I'd switch to the default for the Debian Jessie, but you can't update over a Debian Wheezy that has upstart on it; that makes the machine unbootable. To add insult to injury, this all happened when I was trying to update Wheezy. They don't update Wheezy, they switched me over to Jessie and just left me hanging.

Literally. Yep, hanging on a console message with the machine unable to boot.

I know how to get out of this mess and catch my machines up to the latest, but I really hate having to do it. At least it was my weather station and not the control system for the house. So my plans are to update to Jessie, then load all the packages I use to run this stuff, and finally to update my startup scripts to use the init they want me to use. Probably about three or four days of fooling around for the weather station, then I get to do it all over again for the house controller.

I want to be up to date with the latest because, eventually, the Pi Zero will be back in stock and I really want to play with it. No, I won't worry about updating something that will become a control part inside something else; I'll just use it like some other chip. I'll have to be careful to isolate any code on one away from the OS and come up with ways of starting processes that don't involve the OS, essentially treating them like little black boxes. At $5, I won't much care if they fail and have to be replaced. Sort of takes some of the fun out of them though.

The very next iteration of my devices will NOT use the unix facilities to start and stop processes or to monitor what they do. I'm going back to basics and working out ways to handle it that don't rely on some programmers data politics.

Subject change. A few folk have expressed disappointment that I haven't been posting about my tractor rebuilding, dog door, trenching, culvert, and other projects for the last few months. When I told them that the projects weren't technical, they said, "So?" I didn't have an answer because I've written about rattlesnakes, dogs, shades on the patio, etc.

Sorry tech weenies, I'm going to go back to my old ways and talk about surviving in the desert with a bunch of technology included. It just may be hydraulics, water flow, pruning techniques and such as well as little tiny computers and hacking into strange devices. Heck, I may well post about the technical aspects of using snake shot to control the varmints that try to kill me, as well as my continuing war with woodpeckers.

But my Pi 3B is already on order.

Monday, November 2, 2015

Battery Operated Temperature Sensor: The Batteries Died

The previous entry on this project is here <link>.

I worked on this project earlier this year and put it into daily service back in April. The batteries died last night (this morning) at 4:00 AM, earlier than expected. They lasted 5.5 months and had the same rapid decline to 2.7 volts that I saw when I was running it in accelerated mode to understand how to do this.

Basically they coasted along dropping a little over time and then just dived, relatively speaking over a couple of weeks to a level where it wouldn't work anymore. This seems to be the normal behavior of alkaline batteries, so nothing new.

I am disappointed that it took less than six months to die though, but it died two days after my TV remote control died and I changed those batteries around the same time as this device. I remember because of the coincidence of having the remote need batteries around the same time as I started the long term test on the sensor. Could be the life of the cheap batteries I'm using.

The device was set for 115 seconds off and 5 seconds on and I can easily change that to a much longer off period if I need to, but I'm not sure I want to. Having the temperature available at two minute intervals is nice and fits with my longer term plans for temperature control in the house.

On the reliability front, this thing has worked day after day without a hiccup. I use it to turn off the bedroom and outside lights when I go to bed every day and sometimes just to show it off. Never gave me a problem unless the controller it talks to was having problems because I changed something there. It's still a bunch of components on a proto board though. I couldn't find an enclosure to fit it that I liked and decided to wait until I could buy a 3D printer to make something for it.

My tractor and the terraforming work around the house ate up the money I was setting aside for the printer and that has been postponed until I finish that stuff. Keeping flood water out of my house and repairing ruts in the driveway will always take precedence.

I put some more of the exact same batteries in it, and it's beside the bed again doing exactly what it's supposed to. I'll check on it from time to time and see what develops over the next six months or so.

Maybe by then I'll have an enclosure for it.