Tuesday, May 24, 2016

Routing redundancy

The SmartThings devices got me thinking about internet connectivity. SmartThings pretty much requires an 'always-on' connection to operate. While my primary ISP is pretty good with it's connectivity, I know a few things they don't cover or don't cover well. The first is 'last mile' redundancy. The 'Last Mile' meaning the connection between my home and the last redundant point in my ISP's network. A car takes out a pole between my house and that point, I'm without internet service until repairs are made. The other area not covered well is device maintenance/log information. A few years ago my ISP had problems with delivering a good signal. It was up, it was down and getting past the tier 1 folks and their "let's reboot again" script was impossible. Turned out the ISP was getting a number of complaints just before the Super Bowl that their Pay-Per-View was failing. It was then they 'miraculously' found the problem and replaced a failing board. I had logs going back 3 months that would have told them the same thing. So if I have devices in my home that need to talk to the internet to keep running, I need a backup solution.

I have worked on large router networks for a number of years and devised all sorts of interesting backup solutions. Applying my knowledge with various Open Source packages I came up with a overly complex but fun solution. A few weeks ago I picked up a second router, a Nexx WT3020. It is so small that I lost it or a couple of weeks (yes, really). A tiny thing with 64M of ram, 2 Ethernet, a/b/g/n WiFi and a USB port. My primary router, the Ubiquiti ERLite-3 works really well and handles the primary traffic load just fine, but without some trickery I can't get it to do LTE backup (via Freedompop). The WT3020, with OpenWRT, will handle backup duties (with a filter) for some of the traffic. I plan on setting up VRRP and RIPV2 to handle directing the traffic properly and IP tunnels to deal with poison reverse issues. So far I have the Quagga ripd working on my primary router, primary server and the WT3020. All are using RIPv2 to my primary router properly. I had experimented with vrrpd between my primary router and a Pi 3 but it appears that OpenWRT doesn't use vrrpd, instead uses keepalived. I now have a very simple setup with VRRP working. I intend to take advantage of a lot of the options of KeepAlived such as status scripts and interface tracking. After getting Quagga ripd, IP tunnels and KeepAlived working I can now begin working on getting the LTE modem working. It works fine on my Windows 7 Laptop but I haven't been able to get it to work under Linux. I really need to brush up a bit more on the LTE modem. Once I understand it and the uqmi software I should be able to make connectivity to Freedompop and figure out how to build the proper filters. I'll also post my findings on my Routers notes page.

Tuesday, May 17, 2016

Sometimes it's the little things

I've been trying to get the Arduino environment for the Atmel AVR, the Microchip PIC32 and the ESP8266 working. Can't say that the Arduino IDE is one of my favorite environments to work with. The library structure is maddening (wait, there are 2 similar libraries and there's an error and you won't tell me where it is?). I'm glad that I can use an external editor, too bad I can't call a utility to tell it to compile and update in an easy fashion. There are Makefiles I can get and I will look into those. It's not the worst environment but it does make supporting the programs (sketches) a pain. Oh, and forget about debugging without using print statements.

Now, I recently tried to add the latest ESP8266 environment to the Arduino and ran into the infamous: "(platform esp8266, package esp8266) is unknown". I found a number of solutions but none were quite clear about the fix (below). Seems that when I initially install the ESP8266 it installed the 1.6.4-673-g8cd3697 package of the ESP8266 (found in ${HOME}/.arduino15/packages/esp8266/hardware/esp8266/1.6.4-673-g8cd3697). Because I had switched over the a new release (2.3.0-rc1) but I failed to remove the previous release, I got the '... unknown' error. Once I found the fix ( rm -rf ${HOME}/.arduino15/packages/esp8266/hardware/esp8266/1.6.4-673-g8cd3697 ), I was able to properly compile sketches for the ESP8266. Hopefully this post will help someone else to find it quicker. Sometimes an internet search gives you too much general information or too out dated information, or both.

Arduino "(platform esp8266, package esp8266) is unknown"

Monday, May 16, 2016

Out with the old, in with the new

I alluded to this in a previous post but now let me clear this up a bit . I've removed my Vera 1 (using Z-Wave) and the last of my Insteon (with Misterhouse). I really never liked the Vera, the UI was terrible and the limited amount of RAM made doing too much troublesome. I did like the reliability of the ZWave but the reliability of the Vera required me to write some code to reboot the router every once in a while. The Insteon also had it's problems. Every few weeks (months?) we'd get a power hit and the PLM would hang. It required that I pull the plug on the PLM (and then plug it back in). I also had some issues with reaching devices on the other 'phase' through the Insteon wireless bridge. The newer Insteon PL/Wireless may have fixed that but it require me to swap out what I already have. After looking at the current technologies available I decided that ZigBee and ZWave were the less expensive and more flexible route. So I've gone with SmartThings and for a short period of overlap found it to be more reliable. I also have the Hue and TCP bulbs but I'm not sure I'll purchase more of either. I prefer to go the external plug and, in some cases, switches rather than more hubs. The ZigBee plugs at least don't have the nasty white LED that the Insteon devices had. Oddly enough, my friend has Insteon and has had no issues. So he'll inherit my older Insteon devices.

On the other side of the software suite. I now have Misterhouse sitting idle but I plan to change that. I've added an MQTT interface to SmartThings. I'll have Misterhouse share the topics. Hopefully this will provide a nice floor plan interface to the SmartThings devices. More on that later.

Thursday, May 12, 2016

I made it to Wiki (WAF)

Okay this is kind of funny, my book got quoted (yea), but not for what I would have expect (hey, at least someone read it ;-)). While up on Hackaday, I found an interesting ESP8266 Weather Station project. There I found that Christian Moll had credited a German magazine named: 'ct'. With being the first to use WAF or as ct put it Women Acceptance Factor (lost in translation?), in 2006 (Glossar: WAF). Chris found another link: WAF (Wikipedia) where my book was referenced for SAF. I wasn't the first, I just recall starting to use it in the 90's on the newsgroup: comp.home.automation. In fact, in the mid 90's we started to see a rise of women in the newsgroup so we started using the alternative SAF since we never knew if the spouse was going to be male of female. That's the term I used in my book and that's what I was credited for. It's not a bad thing to be credited with. :-)

Maybe someday, someone will quote my book for HA. At least I still find it useful. And since I have a reference on Wikipedia, I'm famous ... for today. ;-)

Wednesday, May 11, 2016

Ketchup? Catsup? Catch up!

Wow, I've been very busy since my TCF HA presentation on March 19th. The presentation went better than expected. I had prepared my presentation and I was all set to present working home automation when I discovered I was missing one library. Unfortunately I couldn't fix the problem in time for the presentation. So I rewrote the presentation. Because of that, I thought the presentation was a disaster but I was told by several people they thought it was pretty good. There was another HA presentation, Pat Palmer's, after mine but from a user's prospective. I thought that her presentation was pretty good. Next year, I have to have the Dollhouse and all the automation working. I still have to post my 2016 presentation (dang I am behind). But it should end up on my Presentations page.

Meanwhile I spent a lot of time working on some new ideas. So rather than do a brain dump here, I've decided to break up this blog post as it's now about 10 pages long. If I break it into several sections it will be easier to digest and I won't have to worry that it all makes sense as a single post. I'll cover my work on SmartThings, Vera, Insteon, Node.js, Node-Red, MQTT, Docker, Z-Wave, ZigBee, Tasker, Freedompop, LTE modem, VRRP, Quagga, DHCPD, IP Tunnels, Nagios, QEMU, PyDio and D3.

The short story is I'm sticking with SmartThings despite the issues, I like the ZigBee devices and I've removed my Vera and the last of my Insteon. I still have some X10 (mostly wireless stuff) and the WiFi modems are a pain in Linux.