So what that does it every time there is a keepalived state change it notifies that script. That script then runs additional scripts based on the state. So when it goes to “MASTER” or at boot time (which is why i have to put that sleep statement in there) it runs usb-connect.sh. Which just has a couple commands
Notice line 5, the priority is a higher number than in openhab1. This means that when the boxes communicate they will negotiate who gets to be master. Then either box can start openhab and whoever is running openhab gets the USB z-wave stick.
So lets do a brief summary of what these pieces of software do for me and what I currently have configured.
Openhab – “a vendor and technology agnostic open source automation software for your home.” That is what the site says openhab is and they are right. Openhab is a core home automation system that has been designed to work with MANY different vendors and systems to make your home smart. I have friends that got stuck with z-wave because they spent a bunch of money on z-wave and don’t want to replace it. But there is also belkin stuff, wifi modules, home built devices (this is a BIG problem for third party controllers.) Later on in this post you will see that I have used this agnostic approach to home automation to my benefit.
Mosquitto – “is an open source (BSD licensed) message broker that implements the MQ Telemetry Transport protocol versions 3.1 and 3.1.1.” Okay, not quite as cut and dry as openhab. So I’ll see if I can help. MQTT (MQ Telemetry Transport) is a system in which devices and services can connect to a central system and communicate via very small, very efficient messages back and forth. This efficiency helps in speed and bandwidth. A device can connect and just wait for commands, a service can send a message to the mqtt server which in turn immediately passes it to the device connected. MQTT is EXTREMELY more robust, but that is a simple paraphrase description of it.
MQTTWarn – “a pluggable MQTT notifier.” Hmm, not as helpful, but now that you know what mqtt is you probably understand this a little better. Jan-Piet Mens, the creator of mqttwarn and a very nice guy (I have personally had experience working with him in trying to accomplish various things) created this wonderful middleman piece of software. Its almost like grand central station, or your telephone switch board, or the traffic cop. Its a beautiful thing, I use this personally to do the following.
update dashboards in my office with current battery power on a couple devices using owntracks to get the battery data and pushing info to dashing dashboard.
Show current bandwidth usage from my router (python service I wrote to query snmp data from my router and publish via mqtt and then pushing info to dashing)
Pushing various alerts to prowl/growl
Push notices of events to my kodi installations
OwnTracks – “Your location companion.” OwnTracks is an application that can run on android and IOS devices that uses the internal GPS info and reports back to your mqtt server. This allows for a little better sense of privacy about our tracking info, but lets be honest if you have your phone on you, you are probably being tracked. But it doesn’t mean we have to give our info to everyone, so we use our own systems to track us. This also reports battery info with the location data it sends back to the system. Why would you want this? Well I use it to detect when I am home for presence detection. I also use it to have my home automation system know when I am leaving the office each day.
For devices I have integrated, I have..
a couple z-wave devices
2 phillips hue lights
2 belkin wemo switches
Logitech Media Server (squeezebox server) for media
So what am I doing moving this?!?! Well, this is a good question. The system does work in its current setup. However, as every project must, there has to be a very high WAF (Wife Acceptance Factor) if the project should ever be allowed to leave your workspace… Since I am pushing very hard to start putting some bigger pieces in the rest of the house (home built IR blasters, wall panels, in-ceiling speakers for voice notifications) I needed to increase the WAF. So, I have found that there are 2 things that make this much easier.
Must be easy to use. UI is key here, if others in the house can’t use it, its junk.
Must work. If the wife can’t turn on a light because something is down, its junk.
Those 2 key pieces of info really fit and help. So UI I believe I already have covered with a nice easy touch interface available on EVERY device in this house including some tangible remotes. So number 2 is the obstacle to tackle. It must work. So redundancy/fault tolerant is key. I have 2 seperate esxi environments in my setup here at home so I am going to place 2 openhab systems in virtual environment with heartbeat, failover and a virtual IP. To share the physical z-wave stick I am taking the raspberry pi and using virtualhere to share the 1 USB device with both controllers. This does still present a single point of failure for z-wave stuff. But it is not all the system so its better. If anyone has any thoughts on how to add redundancy to that Im all ears.
So here is what my goal is for my controller setup.
So you have seen my woes. I learned ALOT about 3d printers during the build and trials and tribulations. But once I had it pseudo working the first thing I wanted to print…. UPGRADES!!!
“#$%^& YES!!!! Print your own upgrades!” I yelled at the printer!
I printed a new fan shroud that has a vent to help cool the plastic as well as a slot for a 9 gram servo motor.. Why you may ask? Well, its for the auto bed level!
This seemed like the holy grail at the time, it is still pretty cool, but I have found it does put some extra wear and tear on your z-axis nuts and rods.
I basically build it based of this guys videos
This is still a pretty cool feature. I have even used the time it takes to auto level to change my heat bed temps by using some custom “start gcode” in CURA
G21 ;metric values
G90 ;absolute positioning
M82 ;set extruder to absolute mode
M107 ;start with the fan off
G28 ;move Z to min endstops
In short, my CURA profile has the heat bed set to heat up to 55 degrees. I personally like it at 65. So once that initial 55 is hit for the heatbed and the hotend it starts this custom G-Code. That first line says “set the head bed temp to 65” then it moves on to some of the other settings. The G28 and G29 are related to the auto bed leveling. So while its probing various points, the bed is heating up to my desired temp.
Its funny I have this little guy printed in black abs, black pla, red pla and gray pla in my house.
This hurt. For over a week I had my printer ripped back apart.
I will show a few more pics of the build and then go into some MAJOR things I learned. Some links to really good resources and some pics of various prints I have done.
This was the picture after I got a lot of the main support structure together. I thought I was getting close to being done. Oh how wrong I was..
All of this info so far happened in the time between Wednesday and Saturday that first week. So Saturday night the wife is off to work, the kids are pre-occupied. PRINTER TIME.
So I am putting on the heat bed the the y-carriage support (that acrylic plate in the middle.) You have springs you put over the screws so that it has constant pressure keep the plate level. I am pressing these things in…. crack!!
Yep, broke a piece of my printer before I even plugged in it.
I was devastated. However, not the end of the world. I continued on and just jammed a sticky note pad in there… don’t judge me. Desperate times called for desperate measures!
At that point I stepped away for 2 days and began working on it again going into the new week. Electronics time!!!
Now we have to hook up all that stuff.
Look how clean a RAMPS board looks before you hook everything up.
So I get everything hooked up. I’m done. Lets hook it to the computer, upload a test pattern for the motors and make it move.
Why isn’t it registering…. Why is that power light coming on and fading out…. Did I get a bum arduino mega? No worries!!! I have an extra one from another project, lets test it.
Out comes the magic smoke…. 1 of those little green stepper motor boards was on backwards and fried not only the arduino mega, but the mega, the RAMPS and 4 of 5 stepper motor drivers. Thank you amazon for having just that kit available for someone like me.
Now I am considering just setting it all on fire, molding it into something, and calling it “3d printer art” but we have it powering up now. So I had to give the dining room table back to the wife (she hates when I take over the table for projects)
So its time to start trying to print.
HA!!! I wish it was that easy. 1 simple word for anyone considering 3dprinting. CALIBRATION!!!! Do it. Do it again. Keep doing it.
That clicking sound in the video. Yeah turns out that is bad. I was having problems with the motor being able to push the filament through the nozzle.
Calibrate your temperatures! Make sure you aren’t too close to the bed. Sigh. This went on for awhile.
So much heat transfer into the extruder that it softened and jammed up. I cleared this SOOOO many times.
Look on the top of that heat block. See that little bit of leakage? That became the bane of my existence. Long prints and I would get a random build up of that plastic, it would drop on my print, cool, and snag the head.
Fixed the jamming with adjusting my cooling settings and print head temp.
Fixed the leaking head by pulling that throat tube out and putting some plumbers tape on it. Shouldn’t have needed it, maybe it was a bad tube, but worked like a champ since.
I had another problem later with all the vibrations my heating element fell out of the heat block. That was weird. Had to tighten everything down again.
Thermister broke… Replaced that.
Replaced nozzles a couple of times due to bad clogging (nozzles are cheap, order spares, you may be able to get acetone to dissolve a lot of the clogs, but who wants to wait multiple days)