Whole Home Audio Rig

So a while back (let’s not talk about how long ago) I found the site of HazyMat

Multi-zone audio: a discussion of the options

He seemed to have found a great solution for doing some work on whole home audio.  This is something I have been trying to find a good solution for myself.

I decided to test this out myself using the XAP 800.  xap800_l

 

 

 

maxresdefaultI picked this thing up on ebay for $24 bucks.  So I did some testing and was able to do some audio routing via serial port which means I can use Openhab to control the audio matrix.  Not the same matrix.  But as I have shown before, the connectors might be a pain in the butt to try to wire everything up.

ClearOne XAP-800 Professional Audio Conferencing System Pic 4

Screw down terminals are great but not convenient if you have it mounted in a rack.  Which is what I wanted to do with mine.

So how do we make this better?  A patch panel!!!
19-inch_rackmount_Ethernet_switches_and_patch_panels

So I started looking around.  I could do a keystone jack patch panel.  But then doing rca keystone jacks were going to be way more expensive than I wanted to spend.  $24 bucks for the audio rig and Im looking at $100 bucks for the patch panel….. NOPE!

So here is what I decided to do.  Use a 2u blank rack plate.  Like this one.  72621Buddy 069of mine had one laying around.  So far $0.  I know what you are thinking.  “Hey genius you don’t have any holes…..”

 

I know.  I got it.  Relax.  I busted out the blue painters tape and made some markings for the holes.  IMG_0678

 

Now off to the drill press.  Few drillings later we have swiss cheese!!

IMG_0679Had a super cheap pack of RCA jacks show up.

81DOZmuhh9L._SL1500_
Initially I was planning on doing all my cable management through the middle, so I had red on top and black on the bottom.  But then because I had the top and IMG_0687bottom row offset from each other it didn’t make sense.  So I ended up swapping them around.  I then soldered speaker wire to the back of each jack.  It took a while, but it was worth it.  Wired up to the screw terminals I now had a nice pretty panel.

IMG_0937

 

So I wanted to get things labelled up.  But my label maker is junk.  The sticky tape just falls off.  So I could paint.  But then it looks messy.  So then it hit me.  Vinyl!!!

I was able to pick up a craft cutter for super cheap (<$35) and designed up some labels, ordered some white vinyl.

CUT!!!

IMG_0939A little transfer paper and a crooked eye and I now have some much nicer labels.

IMG_0943

 

Now it’s all mounted up in my rack nice and pretty.  I have my main computer in my office routed through the device as an input source, and then my main speakers as an output.  Then a media center raspberry pi routed as another input.  It’s now mixed with the audio from my main computer.  Both computers using the same speakers.

 

Is it hot in here? Home Automation AC addition

So my Super Villain lair is super secretly located in my converted garage… shhhh.

So we found out that Florida is a rough place to be a super villain.  It’s hot here.  So I needed a way to help keep my lair cool.  So many full moons ago my minions held a Staples store for ransom till they gave me an AC unit.
lx_140_set

 

This thing is huge.  It’s a 14000 BTU unit.  I have an exhaust vent that goes up through the ceiling and vents outside.  It is actually pretty good at cooling down my lair.  But it is another AC unit that can use up some power.  Since the Super-Wife is not a fan of paying giant power bills, I have to turn it off when I am not in the office.  This was one reason thy the remote was very handy.  But.  It’s 2016.  Hello!  Just a remote?  That’s it?  HA! Right!

I have worked on trying to automate this thing for awhile.  A while back I used the Arduino Infrared Library to read codes from the remote, and then blast them back out.  But it didn’t work… I thought maybe it was using revolving codes.  Nope.

As it turns out, HVAC units have a tendency with their remotes to not send simple codes like “On”, “Heat”, “Fan-High”, “Temp-Up”  as you might think.  TV’s and even some small wall mounts use basic NEC hex codes.  Not this monstrosity.  No no.  After working on this thing for weeks I found an article that spoke about maybe my buffer size for reading the code wasn’t large enough.  The current RecvBuff was set to 100.  I was filling up all 100 locations.

So I changed it in the IRRemoteInt.h file.  Set it WAY higher.  Turns out my remote was sending 228 pulses.

client-pulse

 

So I decided to try to decode some stuff.  Lets try changing the temp.  228 pulses and most of them are the same.  Turns out my HVAC remote sends FULL state code every time you push a button.  To test this theory.  I set my HVAC to 72 degrees.  Went into a different room with the remote, pressed temp up until I was at 74 degrees.  Back in the office, the display still says 72, remote says 74.  I press up, the HVAC screen jumps straight to 75.  Full state!!  So that’s good to know, but a pain in the ass as I would have to do some SERIOUS work to decode the blocks and find out what changes to what.  But I never really need to do anything other than turn it on and off.  So lets find something simple.

I now have the following arrays of values


unsigned int powerOn[227] = {3400,1700, 450,1250, 450,1300, 450,450, 400,450, 450,450, 450,1250, 450,450, 450,450, 400,1300, 450,1250, 450,450, 450,1250, 450,450, 450,450, 400,1300, 450,1250, 450,450, 450,1250, 450,1300, 450,450, 400,450, 450,1300, 400,450, 450,450, 450,1250, 450,450, 450,450, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 450,450, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 400,450, 450,450, 450,1250, 450,450, 450,450, 450,1250, 450,450, 450,450, 400,1300, 450,1250, 500,400, 450,450, 400,450, 450,450, 450,450, 450,400, 450,1300, 450,1250, 450,450, 450,1250, 450,450, 450,450, 400,450, 450,1300, 400,450, 450,450, 450,450, 450,1250, 450,1250, 450,1300, 400,500, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 450,400, 450,450, 450,450, 400,500, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 450,400, 450,450, 450,450, 450,450, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 500,400, 400,1300, 450,1250, 450,1300, 400,1300, 450,1250, 450,1300, 400,1300, 450,1250, 500}; // UNKNOWN 3659AD56
unsigned int powerOff[227] = {3400,1700, 450,1250, 450,1300, 400,450, 450,450, 500,400, 450,1250, 450,450, 500,400, 400,1300, 450,1250, 450,450, 450,1250, 450,450, 450,450, 500,1200, 450,1250, 450,450, 450,1250, 450,1300, 400,450, 450,450, 450,1250, 450,450, 500,400, 500,1200, 450,450, 400,450, 450,450, 450,450, 450,450, 450,400, 450,450, 450,450, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 450,450, 400,450, 450,450, 450,1250, 450,450, 450,450, 400,1300, 450,1250, 450,450, 450,450, 450,400, 450,450, 450,450, 400,450, 450,1300, 450,1250, 450,450, 450,1250, 450,450, 450,450, 400,450, 450,1300, 400,450, 450,450, 450,450, 400,1300, 450,1250, 450,1300, 400,450, 450,450, 450,450, 450,450, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 400,500, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 450,400, 450,500, 400,450, 450,450, 400,450, 450,450, 450,450, 400,450, 450,1300, 400,1300, 450,450, 450,1250, 450,1250, 450,1300, 400,1300, 450,1250, 450}; // UNKNOWN 6BF20402

243448-Don-t-Judge-Me.-I-Was-Born-To-Be-Awesome.-Not-PerfectWith those values set in my arduino code I can now turn my AC ON and OFF in my office.  Cool haha, get it?  cool?  Shut up.  Don’t judge me.

 

 

 

 

So I did that work, and that was the end of it.  I didn’t really do anything more with it.  I wanted to figure out a good way of interfacing to it.  Earlier this week I found the following article on the OpenHab community.

MQTT IR transmiter/receiver

This turned out to be just what I needed.   I didn’t even realize I needed this, but it made perfect sense.  In short, use a tiny esp8266 chip with an IR LED and MQTT.

You can get them even cheaper from China.

AliExpress.com Product – 2015 New version 1PCS ESP8266 serial WIFI model ESP-01 Authenticity Guaranteed,Internet of things $1.79 Each.

arduino_dust_sensor_ESP8266-1I had one already laying around…. but where the hell is that tiny bastard!?!?!?!

Like finding a needle in an electronic haystack.  But I found it.

 

 

Threw in the code, built a programming jig for it.  Programmed it and BOOM!!! MQTT messages turning on my AC.  Nice!!!

069But that’s not home automation genius!

I know!

I’m getting there.  Geeze!!! Some freaking people am I right?

So time to hook this up in OpenHab.  I already have an MQTT broker configure in OpenHab for my OwnTracks setup.  So we need an Item created first.  So I setup a new Items file called “HVAC.items”


Switch Office_ac "Office AC" {mqtt="&gt;[mqtt-home:esp8266/02/sender/RAW:command:ON:ON],&gt;[mqtt-home:esp8266/02/sender/RAW:command:OFF:OFF]"}

Next let’s add to the sitemap.


Switch item=Office_ac

f1afa6d8e96b6f69bb5c73776177af24Try to keep up, I know it’s crazy difficult with all those configs and what not..  I need a drink.

Sweet.  Now I have a simple on/off switch for my AC.

……still just a remote jackass.

Really..

 

Really…..

1234931504682 (1)

 

 

 

 

C’mon.  Can’t we be friends?

I mean, you can be pinkie pie.

FANMADE_Pinkie_Pie_and_Rarity_friends_forever

Ok cool.

So for the AUTOMATION part, (I’m not bitter), we create a new rules file.  HVAC.rules


rule "Turn On AC"
when
Time cron "0 17 15 * * ?"
then
Office_ac.sendCommand(ON)
end
rule "Turn off AC"
when
Time cron "0 30 22 * * ?"
then
Office_ac.sendCommand(OFF)
end

So now, each evening around the time I start my crazy battle with traffic home (see here), my AC in my office will turn on then turn off each evening at 10:30.

So where do I go from here?  Well, the next step is to use my previously mentioned OwnTracks setup to see precisely when I leave from work and if I pass through a location which indicates my trip home, it will turn on the AC.  This way, it doesn’t matter if I leave work early or late, my AC will know and have an hour to cool down the Lair before I get home.

 

baby-its-cold-outside-14192655214ng8k

 

 

 

 

 

 

 

 

Traffic (actual cars) Woes

So in the last 2 weeks I have been put to the test of patience and road rage.

giphy

Last week there was a guy that decided to take his dog for a walk on the over pass and decided to stop and contemplate jumping.  This closed down a 3 lane highway and the 2 joining lanes completely in morning rush hour.  Diverted traffic was diverted to a 1 lane exit.  I sat in traffic for 3.5 hours!!!! At that point I called the office and said “i’m working from home, it will take me hours to get there and 30 minutes to get home.”

That was pretty rough.

This past week was obviously not as bad.  But 4 out of 5 days this week my normally 45-50 minute commute was 90 minutes.

So normally I spend 4hrs 10min on the road commuting in the morning and roughly 5 hours in the evenings (traffic gets worse)

But this week was almost 7 hours in the morning and 5 in the evening.

12 hours……

I don’t think you heard…. 12 HOURS!!!!! Just driving!!! It’s stupid.

traffic-zzz

 

Man I could get a lot of work done driving a tesla!

 

 

 

So I had this dream this week, very strange I know, and some of the details I am omitting here because well… some of it was quite sexy…. but that’s not the part I am hiding.  There was another device in my dream that I have thought about making before and in my dream I had it done.  But it had a new feature…. it told me if my drive to work was going to be longer than usual……

I know I know.  “Just watch the news you jackass!”  I can hear you all saying that.  However I cut the cable many many many moons ago.  I don’t get the news.  Two.  Well, my past brain problems have led me to a life where I don’t watch the news often because the news is generally bad and I find myself a much happier well adjusted member of society if I don’t watch the news in the morning.  But I got side tracked.

So after the wife telling me
Untitled

I decided to look into this thing that my brain was hinting at.  So I spent some time looking for mapping/navigation api’s.  I found out that TomTom has one.  Pretty good to, you can tell it what kind of vehicle you have, and if you want traffic to be taken in to account and all kinds of stuff.  So I got an api key and started coding against it.  Pretty neat.  68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f752f343034323534372f746f6d746f6d2e706e67

But then I found this.  This turned out to be pretty interesting by itself since I currently use a dashing dashboard for a few things internally.

I set it up for myself in dashing and it works nicely.  So we are close, but not quite what I am looking for.

So I decided to keep working, and thinking, and eating chips.

Wait.  No chips.  Just working and thinking.

I decided what I needed was 2 fold.

  1.  Traffic time must be in my Home Automation system so I can create rules based on the time.
  2. The times must be stored somewhere so I can get a new idea of “average” drive time.

I got it.  Create an item in Openhab.  Update said item periodically.  I already have openhab mysql persistance enabled.  This will work.  I will be able to run data reports based on time of day (aka MORNING during the week) and see what the average/no accident drive time is and over time even see how much time an accident add’s to my trip on average.

So now in my openhab I have the following ITEM configured in my home.items file.

Number WorkDriveTime "Drive Time [%s minutes]"

and in my home.sitemap file

 Text item=WorkDriveTime

I have a cronjob that runs every 5 minutes that just fires off a php file to get the tomtom info, convert seconds to minutes, round it off and update openhab.

My simple php file is here.


<?php
$string = file_get_contents("https://api.tomtom.com/routing/1/calculateRoute/28.3852,-81.5639:33.8121,-117.9190/json?routeType=fastest&traffic=true&travelMode=car&key=YOURAPIKEY");
$json = json_decode($string, true);


$DriveTime = round($json["routes"][0]["summary"]["travelTimeInSeconds"]/60);

if ($DriveTime != 0) {
sendOpenHabUpdate("WorkDriveTime",$DriveTime);
}


function sendOpenHabUpdate($item, $data) {
 $openhabserver = "http://192.168.2.90:8080/rest/items/" . $item;
$options = array(
'http' => array(
'header' => "Content-type: text/plain\r\n",
'method' => 'POST',
'content' => (string)$data,
),
);

$context = stream_context_create($options);
$result = file_get_contents($openhabserver, false, $context);

return $result;
}


So with this now running in my crontab I have my database slowly updating with drive times.

Oh. If you want to get a key for TomTom yourself just go to http://developer.tomtom.com/

So what do I have in store for this. Well, there is another value that comes back in this specifically related to “delay from traffic” so I may add this in as another number item to track. But the plan is to know before I leave the house if I should take a regular coffee or a giant coffee to get me through the morning commute. download

New Firewall Status!

So a couple weeks ago I wrote about the new firewall setup.

Quick update on the status of that.  I built it out.  Got it working.  yay!

294989But I want more cool stuff.  So I have a business class fiber line run to the house with 5 static IP’s.  So I decided to see if I could get pfsense to do failover router.  You know, because why not.  I tried to get pfsense to install on this old thin client I had.  No go.  WAY TOO OLD!!!

So I moved on.  I too my esxi box and with the second nic ran it to another small unused switch of mine.  I then configured esxi with a second virtual switch that uses that NIC on the new physical switch.  I know, I could do that with vlans.  Duh!  But I am waiting for a cable for my switch so I can configure said vlans.

vSphere ClientSo with this new physical port I was able to build a pfsense box in my virtual environment.  I configured it with dual nics, 1 in each switch.  As you can see here.   My routers are named voot1 and voot2.  Named after the voot runner from the show Invader Zim.   My main network scheme is based on characters and vehicles from this show.

So now I have a physical router configured with one of my public ip’s   x.x.x.253.  Internal its configure as x.x.x.2.  I then configured my CARP ips.  You create a virtual IP for both lan and wan.   External is x.x.x.250, internal is x.x.x.1.

pfsense - New Page (1)

Set the outbound nat to use the .250 address and we are golden.  Setup all the carp sync settings to push the settings to the backup pfsense.  This works BEAUTIFULLY.   I was so amazed as how easy it is.  I just make a change pretty much anywhere in the main router and its automatically sync’d to the backup.

Once the backup is sync’d it’s time to test.   Reboot the primary.  Network dropped and didn’t come back up until the primary fully booted…

stewiegriffin-familyguy

Ok.  I got it.  The arp change caused some problems with the esxi side.  There is a switch security feature that blocked it.  You have to set the switch to accept promiscuous mode….. $%^& I think my switch is a slut.samantha_jones_promiscuitypromiscuous

 

Ok.  So now that my switch is acknowledged as a slut, it works.  Reboot primary router and the backup comes online, takes over the gateway x.x.x.1 and the external x.x.x.250.  This is awesome for various servers that I have in different datacenters that have ip security configured.

So this all went great, but the original reason for the upgrade was my old hardware choked itself out with my ipsec tunnel to AJ doing the encryption/decryption.  So we need to get the tunnel back up.   We got some time over this weekend to get the tunnel working.  We now copy back and forth at 30mbps.  30!!!!!   Fully maxing my fiber line over a secured tunnel and my cpu was only at 25%.  WIN!!!

 

BUT!!!!!! We have this awesome failover working…. will the tunnel come up on the backup too?   *checks the backup router* well the ipsec tunnel config was sync’d.  So what happens if I reboot the primary now….

NO EFFING WAY!!!!!  My tunnel re-establishes to AJ on the backup router too!!! HAHAHAHA this is awesome.

So Aj had asked me about a raspberry pi project on friday called pi-hole.  From the website..

“The Pi-hole is an advertising-aware DNS server that prevents ads from being downloaded. Once installed, configure your router to have DHCP clients use the Pi as their DNS server and then any device that connects to your network will have ads blocked without any further configuration. Alternatively, you can manually set each device to use the Raspberry Pi as its DNS server.”

But it seems like something that screams virtual machine.  I didn’t want to tie up a raspberry pi just for dns.  Turns out pi-hole doesn’t require pi hardware.  So it is possible to put in a vm.  So I configure a tiny ubuntu server and install pi-hole.

curl -L install.pi-hole.net | bash

Very simple.  But it works.  So I build out the vm.  Export it as an ovf and ship it off to AJ over the new tunnel.  He brings it up in his virtual environment and gets it working on his end.  Now to update our respective DHCP servers to tell our networks to use the new adblocking dns.   But… what if it’s down.  Ads/banners coub-1137363

There is a tunnel…. use each others as a backup!!!  Beautiful.

No my pi-hole is the primary on my network, AJ’s is secondary, and if both are down for some reason the network defaults to google.  services_ DHCP server

How well does pi-hole work?  Why do I keep saying pi-hole?  It sounds dirty.

pi-hole pi-hole pi-hole pi-hole pi-hole pi-hole pi-hole pi-hole

Yep.  Still sounds dirty.  But I got distracted.

Pi-hole Admin Console

That is insane…. 1726 ad’s blocked today.  We were gone for 4 hours and it’s still that high.  Crazy.  But you should see some sites without their ad’s.   Interesting.

This week/weekend has been pretty cool for getting some network stuff done.

 

New Firewall Build

So I have been running my home network on a home built router for well over a decade now.    Many moons ago when I lived in my apartment a client of mine was working on converting Eckerds to CVS stores.   As part of said conversion he had a ton of this little MaxTerm thin client machines.

3759951495_91064ca6e9

Which was not bad at all.  It has a little bit of memory, enough cpu to run as a router and an expansion slot.   Throw an extra network card in there and there you go.  Next to no power router.  I have been running http://m0n0.ch/wall/index.php since the beginning.  M0n0wall is now a dead project.  It will be missed, it sparked some of the great pieces I use today.   pfsense, freenas ect.   I have the last version on my little thin client and it runs well.

geek-is-coolBut like everything, eventually you run into something that makes you move on.  I had this recently.  Remember the great data apocalypse of 2015?  Well, that has sparked many changes in my backup replication plans.  One being that a buddy of mine and I are building secondary NAS systems for our freenas to put in each others server racks.  Yes, my buddy is a geek too.  So as part of this secondary nas setup.  We are going to be doing replication across the WAN.  Even though it uses SSH communication to do the replication.  We both felt doing an encrypted tunnel between locations was better.  Plus would let use gain access to each others resources without having to open unnecessary ports.  So we setup a nice encrypted tunnel.  Time to test some transfers…..

150kbs a second……..What-Meme-13

Now I never said I was a smart man.  But there is something wrong there.   AJ’s wan is 150/150 MEG!!!! (thank you FIOS) and mine is 50/50 also on FIOS!!!

No no no.  No sir, I do not want another.  I want the one I originally asked for!!!!!

Who broke that chair!!?
images

Ok.  I am calm now.  WTH is going on.   Checks the traffic graphs…

That’s not it.

Checks CPU graph on thin client….
hell-fire-1

Stops file transfer and checks again….
i_call_upon_the_power_of_ice_and_snow_by_fromzerotohero-d60aqs9

What the hell!?!  Now who broke THAT chair!!!!??

4565396395_c89b9c22f3_b

So it would seem that doing the encryption is causing a problem.  The cpu is just choking on the encrypt/decrypt over the tunnel.  That kind of sucks.  However we are also running on an old piece of hardware (12 years old?) and running on and EOL firmware.  Ok.  New Router time.

So this weekend I begin working on my new pfsense router.

Using this Intel D2500CCE Atom D2500 Dual LAN motherboard.

51mMt8cv6CL

Amazon

With a 2 gig memory chip this is ready to go.

I will post an update after I have this in and running for awhile and testing the encrypted transfers.  To see if it really is all in the cpu.

Green Sprinkler System Project (part 1)

So I don’t know why, but I have over the last year or so really gotten into doing things with renewable resources (mainly solar).   Well, lets say interested in.  I have a couple of solar panels I play with but nothing crazy.

So one day I get this crazy idea in my head.  I need a rain barrel.   But for idea_lightbulbwhat!?!?!  I had no real need for a Rain Barrel.  But this suddenly consumed me.  I NEEDED a rain barrel.  I checked craigslist and found an ad for someone getting rid of one.  Just needed to pick it up.   DONE!.
Now I had my barrel.  Now we need some water collection.   I looked around.  Rain collection can get expensive.  I saw collection systems over $100!!!!  That was crazy! That’s too much!!!

Much

 

I came across this Instructable – Rain Barrel and Diverter

This was right up my alley.   A couple bucks later I had a bunch of PVC and one saturday (when my step-dad was in town) we threw it together in no time.  Tested it out….  yes, I sprayed my waterhose on the roof to test it.  What’s it to you!?!?  pee_hose

So then when I regained my proper maturity level we waited for a storm.

 

Hahah b%^&*es I live in FL.  It rains like every 17 minutes during the summer.  So that night my son and I being the geniuses we are,  well, he was just following me, went outside with the flashlight to see how our water collection was doing.   Very surprisingly with just one section of gutter we were getting alot of water fast.   Before morning the barrel was full.

Here is what my setup currently looks like.  2015-05-30 18.08.34

 

 

 

 

 

This works surprisingly well.  However, I haven’t gotten to the point.  What am I doing with a 55 gallon drum of water.   Well, nothing…. yet.   Well, we used it a couple times as a sprinkler for the kids over the summer.

IMG_0603I built a little test rig to test out some sprinkler heads, and the kids and dog just ran around in it.   But it worked with my little pump I got from harbor freight.

 

 

image_11850This is the one I have. Water Pump.  I got this little pump specifically for a couple reasons.

  1.  Cheap.  This little guy was 40 bucks.
  2.  12v.   Why does that matter?  Because I want to power it off a 12v battery.

 

I’m sure at this point you are thinking “OK there guy.  So you have a bunch of water, you have a pump that can run off a battery and you have some sprinkler heads.   So what are you getting at…… ”

You hear that?  That was the click of it all coming together.  I am making a self sustaining green sprinkler system.   Rain Barrel to collect the water.   Battery charged from a solar panel to power the pump.  Easy right?  No.  No.  No.

Getting in to researching solar and batteries has forced me to start working on a charge controller circuit for the battery to avoid over charging or over discharging.   Why not buy it?   Harbor Freight has some.  You are right, but I am cheap and just buying stuff would make for this to be a really boring blog.   I would just upload receipts all day.  No spank you.  This is more fun!

IMG_0602So where am I in this whole ordeal?  Well, not as far along as I would like to be.  But I recently was able to test the actual pressure of my pump.  It claims a max of 50psi.  Which is close to the pressure to your house.   But I needed to see some numbers and here they are!  That’s actually higher than I expected considering how rough this pump sounds these days.  I tested a few times and always 30psi or higher.  This is actually really good news.  This means I should have a decent water pressure for my sprinkler heads.   I do not have a large front yard, but I am still looking at 5-6 heads to get the coverage.  In the next week or so I will be modifying my test rig to support 5 heads and see if I can run all 5 or if I need to split it into zones.  I am not opposed to doing the zones split, but it would be easier not to.

 

So that’s where I am.  The plans as I finish this are below.

  • add additional barrels
  • micro-controller to control when to turn on and off the pump
  • that same micro-controller will read a custom sensor I am building to determine water level to report back to my HA system.
  • HA system will handle the scheduling of watering using advanced rules.  ex: is rain expected in the next 12 hours?  has it rained in the last 12 hours?  If either of those, no need to water.   Is there enough water in the tank to run the pump?

 

 

Some projects and upgrades

So I have a few things on order coming from china for some various projects.

I figured since I haven’t posted much lately I will post some pre-project dribble.

Phoenix Connectors – Aliexpress

phoenix connectors I have these coming to be able to connect audio up to my ClearOne XAP800.   ClearOne XAP-800 Professional Audio Conferencing System Pic 4 xap800_l

The XAP800 is going to be added to my Home Automation system to be able to control/mix/route audio from various sources to various destinations.  If you want to read more about what this can do check out my buddy here.

http://hazymat.co.uk/2015/04/multi-room-audio-options/

 

3d Printer Upgrades

Its funny.   The whole time I have had my printer I have been constantly wanting to upgrade.  Maybe because I built my printer from a kit and know each piece.  I look at upgrades thinking, this will help just a tiny bit more.  This will make it a tiny bit better.  But also, I enjoy these projects.  So I have what I can only hope are my last big round of updates.  Nevermind.  I just thought of one more.  Bowden extruder…. but that’s for another post.

Motor Coupler – Aliexpress
The motor coupler is going be to used to connect my 5mm drive shaft to my below 8mm threaded rods.

Lead Screws w/ Copper Nut – Aliexpress
Replacing my current threaded rods and nuts with some nice thick Lead screws and longer copper nuts should add some additional stability and durability in that I won’t have to replace the nuts regularly like I do now.

Aluminum Build Plate – Aliexpress
The aluminum build plate will replace my glass bed.   I have hard it does well for heat distribution but also I need it for the below proximity switch.

Induction Proximity Switch – Amazon
I am going to get rid of current auto level setup.   I am going to the inductive sensor so there is no longer going to be a swinging arm.  This will hopefully improve start up time, and keep better accuracy.

shoppingUT82quJXalbXXagOFbXSReprap-Prusa-i3-3D-printer-parts-Anodized-Aluminum-BUILD-PLATE-for-Heated-Bed-3D-Printer-RepRap.jpg_640x64061fxf9nPCFL._SL1100_

 

Random

20 555 Timers – Aliexpress
ne555I have these 555 timers coming because I plan to use them on a small solar charge controller project I need for my Green Sprinkler system Project.

 

100 Optocouplers – Aliexpress
111781498246_1A couple weeks back I designed and tested a small circuit that will detect when the 12v accessory line in my car is turned on and off.  Using these optocouplers I will be able to use this signal to either power on my raspberry pi in my car, or to tell it to turn off.  This is going to be useful so that the pi doesn’t turn off as soon as I get home, but will be signaled to turn off in about an hour.  This will give enough time for sync jobs to run, backups and any config changes I want to do.

So there it is.  Some of my up coming projects

  • Big Printer upgrade
  • Solar Charge Controller
  • CarPi Power circuit deally (i need a better name)
  • Green Sprinkler System
  • Home Automation Audio Router

juggling-businessman-image

This guys has his shit way more together than I do.  Look at him!  He’s wearing a suit….  I barely wear pants!!!!

 

 

 

 

 

 

Raspberry pi 3 give away

I am sure most of you know but earlier this week the Raspberry Pi 3 came out.  In addition to that you know I am a big fan the pi.   Not that pie. Ok I like pumpkin pie too.  Sue me.
mccormick-signature-pumpkin-pie-14800001rca-ss

 

Lucky for us there is a give away of this lovely new device.

Want to get your entries in?

Raspberry Pi 3 Giveaway!!!
IMG_4090-500x334

This lovely little device is now 64bit, faster 1.2g, built in wifi and built in Bluetooth.

Those last two features are a big plus for me.  Since I have raspberry pi’s all over the house. Now I don’t have to add a usb wifi.  The Bluetooth excites me for my car project to talk to my obd-II connection.

OpenHab crashing with Z-Wave FIX IT FIX IT FIX IT FIX IT!!

So,  my openhab system periodically decides to leave the building.  Appears there is a problem from time to time when the z-wave binding loses communication to the z-wave stick it gets upset and tells openhab to take a hike.

This is bad.  Once because it exposed something I missed in my fault tolerance.   I had compensated for network issues and full machine failover.  But the actual process going belly up…. ooops.  My Bad.

Soooo I see it crash while at the gym today and the only thing in my head….

gSHIj

So I appear to have done that.

Let me bring you up to speed on the current state of my home automation.  After the great NAS failing of 2015 I was forced to reduce some of my virtual environment.   I have not brought my secondary HA controller back online yet.  However, it appears that still using keepalived I am able to help address this random problem.

I have added in a new option in my keepalived.conf

 


vrrp_script chk_hahealth {
    script "/usr/local/sbin/healthcheck.sh"
    interval 10 # check every 10 seconds
    fall 2 # require 2 failures for KO
    rise 2 # require 2 successes for OK
}

vrrp_instance VI_1 {
   state MASTER
   interface eth0
   virtual_router_id 220
   priority 150
   notify /usr/local/sbin/notify-keepalived.sh
   advert_int 1
   authentication {
        auth_type PASS
        auth_pass fakepass
   }

   virtual_ipaddress {
      192.168.2.90
   }
   track_script {
     chk_hahealth
   }
}

So what this does is add a keepalived health check.   Every 10 seconds keepalived runs the script /usr/local/sbin/healthcheck.sh and gets an exit code of 0 or 1.  0 if all is good.  1 if the world fell apart.

Environmental concept. Some images in montage provided by NASA (http://visibleearth.nasa.gov/)

The code for this script is


#!/bin/sh
SERVICE=openhab;

if ps ax | grep -v grep | grep $SERVICE &amp;gt; /dev/null
then
 echo "$SERVICE service running, everything is fine"
 /usr/bin/logger "$SERVICE service running, everything is fine"
 exit 0
else
 echo "$SERVICE is not running"
 /usr/bin/logger "$SERVICE is not running"
 /etc/init.d/openhab restart
 exit 1
fi


Explanation:

So this script just checks to see if the openhab process is running.  If its good, exit 0.  If its not, exit 1 but go ahead and try to restart openhab.  When keepalived gets the exit 1 code it keeps track of it.  You will see in the config that there is a fall 2 line.  That means that if there are 2 exit 1 status’s keepalived will go into a failed state.  When the second HA box is back online this will force openhab to move over to the other one.  However, I have not seen this happen so far as openhab loads pretty quick so since there is 10 seconds between the checks the second check comes back with an exit 0 and resets the fall count.

 

 

 

 

MineCraft Nightlight Christmas Present

Ok, so my son is 8 and that means he automatically likes Pokemon and minecraft.
He also likes anything with LED’s (geek in training I believe… blinky oooooh shiny…. sorry, distracted.)

So awhile back I came across this post BLE controlled Minecraft nightlight.  I figured, this is perfect.  So I started order some parts (making a few changes of my own along the way) and printed out the cube and base.

Parts:
Adafruit Pro Trinket – 3V 12MHz
Adafruit Neo Pixel Strip
Capacitor
3d Printer
Adafruit BlueFruit LE Bluetooth module

 

2015-12-16 17.56.55

 

2015-12-16 17.57.19 2015-12-16 17.57.23

I then soldered up the led strips I had from a different project.  Finished wiring everything up based on Mr. McMillan’s guide.  One of the changes I made was I needed to make a different base piece.   The cover originally designed required some larger feet than I had for it.  So I designed a new piece.

Here is the alternate piece.  Thingiverse

2015-12-16 21.00.042015-12-16 21.00.012015-12-16 20.59.592015-12-16 20.23.34

Had an issue the weekend before christmas and had to order some replacements.  So here I was Christmas Eve soldering everything up.

2015-12-24 16.57.26

And I got it all working just in time.  So Christmas morning it was sitting beside all the presents already lit up.  I didn’t get a pic of it under the tree.  Kind of wish I had.  But here is a pic of it light up on my desk.

2015-12-24 17.50.24