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"