Another Pi story

In 2015, my friend told me about the Open Sprinkler project that allows you to attach a Raspberry Pi 1 or 2 to a controller for your Sprinklers. I was onboard when I heard about this. The ability to control my sprinklers from my phone just sounded awesome! (Here is a link to the APP if you are interested) Before this switch, I had to run to the garage, put the system in test mode, then RUN back to the zone to watch it. Very annoying!

Purchase

I purchased a kit from Ray’s Hobby – Ray’s hobby use to sell them on his site, but it has since been moved to Open Sprinkler. I purchased this one (Mine being the Open Sprinkler OSPI v1.4), they have upgraded things since then. They now support the Raspberry Pi 3 and 4 which are much better! The kit comes with a board, extension, that your PI plugs into (see image). Plugging the Pi into the board is a bit scary to me. I’m always worried i’m going to break something. This thing has been running smoothly until just recently. This thing was flawless, it would come back to life each year and I wouldn’t have to worry.

2020 Resurection

I turned on my secondary water two weeks ago and wanted to start watering my lawn. The OSPI was no where to be found on the network! Nothing came back when hitting the static IP that was setup for it. I brought the bridge, that was providing a wired connection to the device, into the house to debug. After researching how to configure this CISCO WAP device, my friend set it up the first time around, I was able to determine that it was working correctly.

The fear of taking the Pi off the expansion board was high, but there was nothing to lose, so I just went for it! The Pi has a DVI port and a couple USB slots, so debugging the board is super easy. I plugged it into the Pi and booted it up and I received a ton of errors. The memory card was BAD! Apparently, backing up the card wasn’t a high priority in my mind! It should have been!

The friend who told me about his, was the first one I called to see if he had any information about building a new card. He said he could copy his and see if that would work. He has an old Pi with a MiniSD card and mine has a MiniSD to MicroSD expansion board on it.

I have to explain something. Since the SD card was built 5 years ago, I was expecting to have all sorts of problems updating to the new version of the software and firmware.

Attempt 1

With my friends MiniSD copy, I took out the expansion board and tried to boot from the MiniSD….NO luck! My Pi wouldn’t even read the card and boot. One of my windows 10 machines could read the card, but none of the others. I only had a 32 gb MicroSD and his was a 16gb MiniSD. Finding a free piece of software to take a direct copy of the 16gb to 32gb card was difficult, so I gave up.

Atempt 2

I had wasted a couple days wit this Mini to Micro SD problem and decided to just try rebuilding a Micro SD card with the newest version of Raspbian and OSPI Firmware. The guides are pretty straight forward and easy to understand, so building a new copy was very easy. I got the software all installed and built and ready to be plugged into the expansion board and give it a try.

The system booted up perfectly and joined the network without any issues. I was super anxious to actually try each zone, but they worked perfectly! Nothing better than having things work the first time around. The worry I had was unwarranted! The only problem I had was with the timezone. The timezone was set up correctly, but the web site (APP) would show EST time. After about 10 tweaks and reboots, it resolved itself.

Dead Grass.

My grass is still trying to recover from the lack of water. The brown spots are starting to turn green. The hardest part for me is figuring out how much to water and when to water. Fertilization is another problem of mine, I never know when to do it, so I pay someone for that.

Should you buy it?

This really isn’t a review of the OSPI, just my joy in owning one and trying to revive it. I would definitely suggest looking into Open Sprinkler and getting one set up! The old way of running to the garage to adjust the timer and the run-once times is a joke! (or I’m just super lazy)

You’ll notice a link to OpenThings when you are on the OpenSprinkler site. They have a broken link to a Garage Door opener that I’m SUPER interested in. I’ve always wanted to get one, so I can easily check my garage door when I’m laying in my bed wondering if I left the garage door open. I have another friend who built his own with an Arduino and Python. I haven’t dared go down that route yet. #dreams

Little break

I took a little break last week. There was no real reason other than I was busy coding! There are times when I really get involved in something and I can’t stop coding. This was one of those times! Working from home and a little side project has been keeping me busy, but there is another project I’ve been working on for fun.

Story

A bit ago, I wrote about our building maintenance worker shutting off our AC unit and the servers were about to melt down when my boss went in to clean. We haven’t had an incident sense, but there is no one in the office to keep an eye on the server. How would we know if the server was melting down? …Hmm. I decided to try and build a temperature sensor for the server room.

The Project

I am a huge fan of the Raspberry PI and have done several projects. The Parking Lot Project is one of them. This time, I took a Raspberry PI and a USB Temperature Sensor and hooked them up into a makeshift temperature monitor for our server room. The system will send out an email when the temperature reaches “warning” temperature and an “emergency” temperature. Let me tell you about the setup. I’m not going to tell you everything I’ve done and show code. If you want that, I can share it.

  • Raspberry PI 3
  • Case – This is probably my favorite case that I’ve used so far.
  • Raspbian OS
  • USB Temperature Sensor
  • NodeJS
  • Python & Pyteams – Used to post the current IP Address to Microsoft Teams when the system boots up, so I can find the IP address. Very important
  • Temper-Python – Used to read the sensor.
  • Smart Plug – This is also key when the server stops working and you have to reboot it from home.
  • Sqlite – I’m currently just writing the logs to a local DB. I really want to change this
Before placing it in the server

Grabbing the temperature

I wrote a little tool, in Node, that calls “temper-poll” every 15 minutes to read the temperature with a cron job. This is a super simple script that grabs the temperature and inserts it into the DB along with the time. I really want to change this and sync the dates with a server. What if the server shuts down? If I can see the temperature trend, it may give me an idea of why the server is down. (Was it climbing to it’s death?)

Web View

The next piece was the fun part. I am not a UI guy, but I like to play one sometimes. In recent interviews at the HackerX events, they are always looking for a Full Stack individual. (see “Out of My Shell” post) I think that is where I had the most fun on this. I decided to deviate from what i’m use to,Bootstrap, and go with Semantic-UI and Jade. It’s been a bit of a learning curve.

What you see in the image is a week of tweaking. I’m still not happy with what I have but it is ok. I’m sure I break a lot of UI rules, but it is functional.

Last week I decided to add an “Average” temperature line that, I was hoping would tell me how the current temperature relates to the average. The average is hard to show when the air conditioning is kicking on at random times and the heat outside, etc. (that’s my guess) As of this writing, the temperature has been the same for 7 hours. It is making me nervous. It’s hard to see but the temperature is 65.9 for the last several hours.

What is next?

This has been a fun little project that has kept me a little busy. It’s a super simple concept, but it’s a bit hard to debug remote and keep it up. The smart plug helps. I’m sure I’ll be tweaking this a bit here and there. A few things I want to do.

  • Figure out why the temperature has been the same.
  • Sync the temperatures to an offsite DB

This has been pretty fun. I hope it doesn’t fail me when the air conditioner goes out.