John's Musings


Yeah, Me Neither

Home Automation Hardware

So you've decided to automate your home some, huh? But don't know much about it, huh? Seems you go to Walmart or Home Depot or Best Buy and the store areas of smart home components is getting bigger and bigger and everything looks SOOOO cool, but alas, it isn't and it doesn't all play together nicely. There are so many different standards and none seems to have prevailed yet. Here are some of the popular ones.

- ZWave

- Zigbee

- WiFi

- Bluetooth


There are others but lets just start with these. So you decided to take the plunge and buy a smart bulb. Seems the logical place to start. Then you get it home and realize the light bulb that cost you grocery money for the week WON'T WORK WITHOUT A CONTROLLER OR HUB. You look at the box and there it is in small print. Then you find out the hub is expensive and somewhat proprietary to the bulb. Then you buy another device and figure out it needs a hub too!.


But you're lucky. You got a wifi bulb which works from an app. Then you get another wifi device which works from an app. Then you realize the bulb must be in the on position all the time and YOU CAN ONLY CONTROL IT FROM THE APP. You went into the dark bathroom and your phone is in the other room and then you realize you didn't think this out as well as you should have.


So I guess what I'm saying is you need a plan BEFORE you embark on throwing a sea of money at making your home smarter. You need to know the conditions that are acceptable to you before you start buying expensive items.


There are hubs out there that control various protocols. I bought the Wink Hub 2 which seemingly does them all but I found it to have some latency issues. Also you have no control over getting deep inside the component and tweaking it's hidden settings. Wink is for simplification and not for a mythical power user like myself. Also I bought some Osram Lightify light bulbs which are Zigbee protocol and worked with Wink Hub 2. If I turned power out or something it seems I had to reconfigure the bulbs or maybe the distance from the bulb was just too far from the hub. At any rate it wasn't working well in my setup so I decided to get and stick with Z-Wave components. Not a fan of Zigbee and wifi seems so hackable. Nobody is going to run around and hack your Z Wave stuff (I don't think).


So I bought a few items and managed to get them to play nicely around an Open Source project called Home Assistant. Keeps you from using a dozen smart phone apps however the one and only controller I use is a Z-Wave protocol. It is the Aeotec 5th Generation USB stick.


AEOTEC 5th Generation USB Stick


Small, simple, and easy to program. More on that later.


I already touched on my first big home automation discovery.........The app controlled light bulb. When I wake up I just want to switch the lamp next to the bed on, not find the phone, find the app, etc. I very quickly came to the conclusion that wall switches that also work manually are most suited for normal home operation. Well, now I need to make sure my switches are either Z-Wave or Wifi. Were I to get a Zigbee protocol switch I'd need to buy another hub. Been there. Done that.

So I settled for GE Wall Switches 12722


GE Z-Wave Wall Switch


This allows me to use my program Home Assistant or the switch itself. Best thing is these switches can be wired up as three way switches. That is where you have 2 switches controlling one light. Like at the top and bottom of the stairs. BUT, you are tied to using ONLY the GE Add on Switch. The switch works great but I learned that the add on switch doesn't have a Z-Wave controller so that if you push it your Home Automation software won't report the change until it polls the light and sees that it is off. Polling is typically done every 30 seconds on Z-Wave. If you are obsessive compulsive and can't wait a few seconds for the switch state to change in your software the GE Add on switch is not for you. I'm told the HomeSeer line of switches add on switches report state. (Don't hold me to that). Me, personally, I can wait 30 seconds for the slider to slide over. It only bothers you when you're setting this all up or showing it off. In real world applications you turn the light on or off and then don't run to the computer to see what happened. Trust me, this is good enough.


So I have multiple Z-Wave switches in the house and just for fun I bought a Wemo Wifi Switch to put in the guest room.


WeMo Wall Switch


It works great but this switch is NOT a three way switch. Again you have to plan accordingly.


Now there is a place for smart light bulbs...........I use them in lights that I want to control to make it look like someone is home at night or at least awake. You know the light I'm talking about, the decorative one you never actually use in the living room. Or the front porch lamp that you realize you forgot to turn on AFTER you got all comfortable in bed. No more, I say to you. No more.


Not only can you control these lights from Home Assistant, you can automate them to come on at sunset and turn off at sunrise. I've done this with all my outside lights and some inside ones. They come on when the sun goes down and I never have to worry about it again.


So here's my current rough set up. Sensors across the top. Several for my Ring Pro doorbell, and Nest Thermostat. On the top left I have several hacked WiFi outlets I bought at Walmart. These use machine to machine protocol (MQTT) which I haven't discussed yet. These control the lamps in my house that I never actually turn on. Now I can give the dog light when I'm gone or make it look like someone is moving around inside. Also I have some relays which also run via MQTT or aRest platform. Right now these are experiments but I intend to deploy these as garage door openers and maybe yard sprinklers. As you can see I have 4 GE Z Wave switches and the one WeMo wifi switch. The automation set up shows for turning the lights on and off with sunrise and sunset and then also my LIFX lights and GE Z Wave bulb (Walmart $19) is in the garage. I'm going to tie this one into a motion sensor. I'll make it so the motion sensor only works from say 5PM to 7 AM to save a nickel or two a year. Also I can control my NEST thermostat from the Climate Section.






In another cool discovery I found I can add a web links section. Mine is titled LogitechMediaServers and these are links to my music servers.



Here's the media server. i think it's pretty cool I tied it to the Home Assistant program. Also, think about it, you could tie any other web app to this as well.



So I have multiple devices............and I've decided that the truly smart home is somewhat centered around smart wall switches and smart outlets. i prefer Z Wave and I prefer the smaller USB stick controller to the big gigantic hub. Also the Z Wave controller is LOCAL and most of the hubs are CLOUD. Yuck!

Wifi lamps such as LIFX are preferable to me than Phillips Hue which requires a hardware bridge.


For simple VOICE control you can get an Amazon Echo Dot and say "Alexa, Discover Devices". And then you can say "Alexa, Turn on Garage Light" or in the case of my garage light it is a GE dimmer bulb I can also say "Alexa, Turn on Garage Light to 50%". It is ONLY simple control if you keep Alexa local. If you chose to you can create Alexa actions but it is VERY GEEKY and you must open your Home Assistant instance up to the internet. Currently my Home Assistant instance is behind a firewall and is not accessible from the internet. And I know what you're thinking............"What good is that when you're gone?"


My answer to that is that I have a Virtual Private Network (VPN) that I can connect to and then I have full local control. In my mind it makes it a little more secure.


I have a smart lock and I guess I should have gotten a Z wave lock (yep, they make 'em) but I opted for bluetooth. I really like that I can have my phone or a FOB on my keychain and just TOUCH THE LOCK to unlock the door. To me that is better than clicking a slider in a web page or app. So again, every smart appliance needs to be thought out before you buy it. Yeah it would have been cool to control the lock from Home Assistant, but why? if someone is coming over I trust I can email them an encrypted access key. No more hiding keys.


My only regret is that I bought exterior security cams before I got interested in smart home stuff. My cameras, at least now, don't play nicely with this stuff. It's regrettable but hardly the end of the world. I love my camera system and it also was a very well thought out and contrived purchase. It suits my needs perfectly, I just can't view the cameras in the Home Assistant interface. This is NOT that important to me.


I guess the moral to the story is that NO MATTER, no ONE SINGULAR SOFTWARE OR HARDWARE PLATFORM WILL SUIT YOUR ENTIRE NEEDS. For now it is a mishmash of consumer products with no standard set in place.

Home Automation

Well, I don't know much about Home Automation, but I'm learning, and I like it. This journey started out with one goal in mind. To turn a single solitary light online from the internet in my front window to make the house look occupied when I'm on travel.


So I started an EcoPlug project and figured out how to set up a machine to machine protocol server (Mosquitto) and then thought......"Well, since I've got this server.........".


One Ecoplug turned into four, and then I learned to control mechanical relays with ESP8266 Internet of Things (IoT) chips. Then I bought a wifi LIFX colored lamp and then I bought two Orsam Lightify wifi lamps. Then I found out that the Lightify lamps wouldn't work because they used something called Zigbee which is a mesh network that hooks devices together. Then I found out there is another standard called Z Wave. Then I found out they sell hubs that do both among other standards. One such hub that I bought is the Wink Hub 2.


Now with all this I can add motion sensors, door sensors, more lights, cameras, you name it.


So now as you can imagine, I have several devices from several companies and several different apps to control them. Once again there is a program called Home Assistant that lets you tie it all together on a single control portal. Here's mine as it stands right this moment:



As you can see I can control my plugs, My lights, my relays and even my Nest Thermostat. As an added bonus it pulls in Plex Media Server, Chromecast, and my music servers (logitechmediaserver) as well.


Then you can take your devices and set automation up. For example my outside light and living room light are set to come on 30 minutes prior to sunset and turn off just before sunrise. (I need to tweak that a little). If you group your devices, as I have done here you can turn them all on at once or individually. Home Assistant also gives you the ability to add custom icons and custom names so now I know exactly what switch I'm controlling when I flip the switch. Just by adding some automation commands I can turn on outside lights at sunset and turn them back off at sunrise. I just worked through the first night of it and I'm positively giddy that it worked.


#Automation

automation:

  alias: Turn on lights when sun sets

  initial_state: True

  hide_entity: False

  trigger:

    platform: sun

    event: sunset

    offset: "-00:05:00"

  action:

    - service: light.turn_on

      entity_id: light.front_porch

    - service: light.turn_on

      entity_id: light.living_room_lamp




automation 2:

  alias: Turn off lights when sun rises

  initial_state: True

  hide_entity: False

  trigger:

    platform: sun

    event: sunrise

    offset: "-00:30:00"

  action:

    - service: light.turn_off

      entity_id: light.front_porch

    - service: light.turn_off

      entity_id: light.living_room_lamp




Home Assistant is kind of odd in that in the days of drag and drop you have to hand code a yaml file. And while it looks like computer code, you don't really need coding skills as the Home Assistant web site provides excellent tutorials for each device you can hook up and their forums are extremely helpful. Trust me, I've been on plenty of unhelpful forums and Home Assistant is great. Even asking the newbie questions, someone will help you and help you to completion of the task.


I'm just scratching the surface here and there are some Home Assistant gurus out there who would make your head spin with their impressive feats of automation with motors, servos, switches, lights, relays, cameras, cell phones, etc. In my mind it's a bit much but remember this is coming from the guy who only wanted to control one light previously.


By the way check out the level of control you have with the LIFX lights. You can control brightness and select from one of about a billion colors or even pick themes. I love this LIFX light. I love it a lot. However for $60 it should love me back.



Here's the problem as I see it though. Lack of standardization. I have plugs that run on machine to machine protocol and are wifi. There are wifi lights. There are wifi lights that need Zigbee protocol, there are devices that use Z wave. There is bluetooth, and IR remotes. Having a hub is almost a necessity as it allows you to not lock into one particular standard which can limit you.


And while the hub allows you access to all the standards and a larger variety of hardware..........good old hooking a wifi outlet up to lamp using machine to machine protocol (MQTT) allows for the fastest operation and response from Home Assistant. Having Z Wave and a hub creates latency between the device, hub, and Home Assistant. Having the device app open also seems to introduce weirdness into the mix at times. My Zigbee Orsam Lightify lights are very slow to react through the home assistant interface. The actual light comes on quick enough but the reaction time to the proper display setting on the Home Assistant page takes a few seconds. In short the light works fine, but the latency in the software is weird. I even had one light working fine that Home Assistant told me was "Unavailable". So did it's app. So did the hub app. But it was still accepting controls fine. Weird.


Another epiphany I had was that if you have a smart bulb in a regular lamp you have to leave the lamp on and it can really only be controlled by the app, or computer. There's something to be said for rolling over in bed and just not being able to flip the light on. It's not the end of the world by any stretch but it's not optimum either. So the thing to do is to install a smart switch in the wall. Unfortunately that involves messing around with the 120 volt mains power. Not a problem for me. The smart switch acts like a regular switch and can be wifi controlled as well. You get the best of both worlds. A switch that works normally on the wall that can be controlled from wifi.


Picked up a GE Iris Wifi enabled switch today at Lowe's. This by and large is the cats meow. Works with Z Wave which of course is what my Wink Hub 2 covers. I removed my old switch, wired this on in and added the device in the Wink app on my phone. It configured perfectly. I wired it with my recessed lighting back in my den.




If there's money to be spent the smarter money is on smart outlets and switches that go in the wall.


Stay tuned for more later as this evolves. Oh, and it will evolve.

Songle Internet Controlled Relay from ESP8266

I bought a Songle 2 channel relay from here with the hopes of hooking it directly to the ESP8266 GPIO and using it over the internet based on this excellent tutorial.


Unfortunately it just didn't work that easy. The digital GPIO signal from the ESP8266 is 3.3v and the relay just won't read that input on the IN1 or IN2 channel.


So you have to build a driver circuit for it. I used a 2N3904 transistor that I got from RadioShack here. Thank goodness my town still has a RadioShack.


Here's a rough and dirty detail.


This project uses Digital Pin 5 which is actually Pin D1 on the NodeMCU 1.0. Yeah, that's intuitive.


This is all from the flat part of the resistor towards you.


- From D1 a 1K ohm resistor goes to the base of the transistor. That is the middle leg.



- The Emitter, left leg, is tied directly to ground.



- The collector, right leg, goes to IN1 or IN2 on the relay. Also from the collector a 1N1004 diode goes to the 5v power source with the banded end at the 5v input. Put it in backwards and you are creating the condition to fry your transistor.



- The NodeMCU requires 3.3 volts (sharp eyes will see I'm using 5V to drive mine, and it works but it's wrong, kinda, sorta.)



- The relay Vcc requires 5 volts and of course ground is tied to ground.


Here it is on a breadboard layout. Nothing to it.




And here it is in action.




To drive both relays though you need to build another driver circuit for the other relay input. Also you need firmware to control 2 relay channels. I used this code I got from here. With this you just find the IP address of your ESP8266 and go to that page in a browser and you get 2 sets of on and off controls.








#include <ESP8266WiFi.h>
#include <aREST.h>
#include <aREST_UI.h>

// crée aREST instance
aREST_UI rest = aREST_UI();

// WiFi parameters
const char* ssid = "Your-SSID";
const char* password = "Your-Password";

// port conncetions TCP
#define LISTEN_PORT 80

// crée un instance du server
WiFiServer server(LISTEN_PORT);
void setup(void)
{
Serial.begin(115200);
// crée UI
rest.title("Relay ");
rest.button(2);
rest.button(0);
// donne nom et ID au module
rest.set_id("1");
rest.set_name("esp8266");
// connecte au wifi
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
// initialise le serveur
server.begin();
Serial.println("Server started");
// imprimme l'adresse IP
Serial.println(WiFi.localIP());
}

void loop() {
WiFiClient client = server.available();
if (!client) {
return;
}
while(!client.available()){
delay(1);
}
rest.handle(client);
}


Also you can configure this in Home Assistant to make dashboard switches.


switch 5:

  platform: command_line

  switches:

    arest_pin_two:

      command_on: "/usr/bin/curl -X GET http://192.168.20.102/digital/2/1"

      command_off: "/usr/bin/curl -X GET http://192.168.20.102/digital/2/0"

      friendly_name: Relay 1

switch 6:

  platform: command_line

  switches:

    arest_pin_zero:

      command_on: "/usr/bin/curl -X GET http://192.168.20.102/digital/0/1"

      command_off: "/usr/bin/curl -X GET http://192.168.20.102/digital/0/0"

      friendly_name: Relay 2



ESP8266 Hack of inexpensive WiFi Outlet

NOTE: This is a fairly involved project that requires soldering, Chip programming, setting up a server of sorts, etc. Took me two and a half days to figure all this out with lots of community help. Took me less than 30 minutes to do the second device. So it's a quick project THE SECOND TIME AROUND.


I AM IN NO WAY SHAPE, OR FORM THE AUTHOR, DISCOVERER, INVENTOR, OR ANYTHING ELSE OF THIS PROJECT. I am documenting this in easier to follow steps as it took some time to figure all this out because it is spread out in bits and pieces everywhere.


The original project (that I merely duplicated) is located at The Great Geekery. Before you do this project you for sure need to look over his original information. Wouldn't hurt to do a google search on "Ecoplug ESP8266" and read some backgound information on the whole thing. Very enlightening.


In today's blog I'm going to hack a wifi outlet to be able to be operated from wi-fi. Wait. What? These devices are made by KAB and branded with several different names such as WiOn, Ecoplug, WorkChoice, etc. In fact I ordered a Ecoplug from Walmart to be picked up in the store and when I got there received a WorkChoice. They may have different brands, different cases, but they are the same device.


They all contain the very hackable and very popular ESP8266 wifi chip which powers much of the Internet of Things (IoT) that you're always hearing about.


When people started taking these apart for reverse engineering they also discovered another dirty little secret. By using a program called WireShark that sniffs network transmissions and packets they discovered that these devices were SENDING YOUR WIFI SSID AND PASSWORD IN THE CLEAR TO AN OVERSEAS SERVER.


DO NOT BUY ONE OF THESE AND USE IT IN YOUR HOME. If you do realize that you have no expectation of security or privacy.


However you can hack 'em. Then they can't phone home. Here's the one I got at Walmart.



Now lets get to some hardware hacking. Remove the 4 screws in the back. The ESP8266 that we're going to reprogram is under the light brown shield. Remove the three screws holding it.



Now we need to solder 5 wires to the chip. Make sure the 2 holes are at the bottom and the chip is facing towards you. We are going to locate Power, Ground, Transmit, Receive, and GPIO0 which must be held low to ground on boot to put the device into boot loader mode so it can be programmed.



Also take note of the fact that right through the arrow line that says 3.3v's is an empty space on the board that is supposed to be populated with a reset switch. Dirty dogs removed the reset switch. Some of me thinks it was to make stuff like this harder. More than likely it saves .04 cents per unit.


Now take some breadboard wires and solder them on. I used 4 female ended wires with the GPIO 0 wire being a male end.



Now you need an FTDI programmer to hook from your computer to the board wires. I use the Adafruit FTDI Friend here. It costs $15. There are FTDI's on eBay for like $3 and even less. They use a fake FTDI chip and sometimes there are issues with drivers. I think they work just fine but I don't want the headache down the line.


HERE' ANOTHER POTENTIAL ISSUE. The FTDI programmer puts out 5v. The ESP8266 input power is supposed to be 3.3v. I have programmed 2 of these outlets and various other ESP8266's with 5v before. I've never had one blow up, HOWEVER, there are folks out there who have had them fry. If you put 5v into your chip be aware there is SOME risk involved with that. If you are the careful sort you can build a voltage divider with two resistors on a breadboard and chop your 5 volts down to 3.3. If you have a 1K ohm tie it to hot. Then take a 2K ohm and tie it to ground in series with the 1k. Right in the middle of those two resistors you'll be outputting roughly about 3.5v.



Now hook the chip to the FTDI like this. (from board to chip)

Vcc to 3.3v

GND to GND

Tx to Rx

Rx to Tx

GPIO 0 held to ground. I used an alligator clip to do this.



Now the hardware is ready. Let's get the software ready. i programmed mine from Arduino IDE on Mac OS X. Get the latest from here.


Now go on the toolbar when it is opened and go to Arduino > Preferences and add the following line to Additional Boards manager and Click Ok.


http://arduino.esp8266.com/stable/package_esp8266com_index.json




Now go to Tools > Board > Board Manager



Type in "ESP8266" and add the ESP8266 by ESP8266 Community Package (mine is already installed)



Now we need to add some Libraries. Go to Sketch > Include Libraries > Manage Libraries



Go here and download Homie Firmware. Download the Zip file. See the pic above? Go to add zip library and then navigate to, and then add the zip folder you just downloaded. It will install Homie into the Arduino Library. Now go to "Manage Libraries and search for and add the following packages:

ArduinoJson

Bounce2

PubSubClient

Async-mqtt-client (download and install as zip)

ESPAsyncTCP (download and install as zip)


Now lets load firmware. This was kind of weird and I'll explain it to the best of my understanding. When I downloaded the ino file from Scott Gibson's project I couldn't get it to compile successfully. I got with the developer of the Homie firmware project who told me the firmware code changed. So I think that between the time Scott wrote it and the time I found it the Homie firmware changed a bunch. Mind you I know nothing about code but I took the example below of Scott's code below and changed where it was failing (using a homie example as a template). SOMEHOW IT WORKED! Still, the tutorial advice I am giving below is the homie firmware example and you only have to tweak the Pin, LED, and Button stuff a little.


The only difference that I can tell between the two codes is it seems like that if you push the button in Scott's firmware it turns the socket on manually. The Homie IteadSonofButton example below does not do that. But, hey, it's a wifi socket. If it ain't wi-fi-ing .......unplug it and plug your thing in the real socket. I don't see much advantage to going manual. The whole point is to have a wifi controlled socket. Here is the code I tweaked. This is Scott Gibson's code. Feel free to use it if you want. It works. If you use the Homie example well then you know for a fact there should be no compilation errors. Copy this to a new arduino sketch and verify.


#include <Arduino.h>


#include <Homie.h>


#include <Bounce2.h>
#include <Homie.h>
#include <Button.h>


const int PIN_RELAY = 15;
const int PIN_LED = 2;
const int PIN_BUTTON = 13
;




HomieNode switchNode("plug", "switch");
Button button1(PIN_BUTTON); // Connect your button between pin 2 and GND


bool lightOnHandler(HomieRange range, String value) {
  if (value == "true") {
    digitalWrite(PIN_RELAY, HIGH);
    switchNode.setProperty("on").send("true");
    Serial.println("Light is on");
  //  switchState = true;
  } else if (value == "false") {
    digitalWrite(PIN_RELAY, LOW);
    switchNode.setProperty("on").send("false");
    Serial.println("Light is off");
//    switchState = false;
  } else {
    Serial.print("Error Got: ");
    Serial.println(value);
    return false;
  }


  return true;
}






void setup() {
  Serial.begin(115200);
  Serial.println();
  Serial.println();
  //pinMode(PIN_BUTTON,INPUT_PULLUP);
  pinMode(PIN_RELAY, OUTPUT);
  digitalWrite(PIN_RELAY, LOW);
  Homie.setLedPin(PIN_LED, LOW);
  //Homie.setResetTrigger(PIN_BUTTON, LOW, 5000);
  Homie_setFirmware("ecoplug", "1.0.0");
  switchNode.advertise("on").settable(lightOnHandler);
  button1.begin();
  Homie.setup();
}


void loop() {
  Homie.loop();
  if (button1.pressed())
  {
    digitalWrite(PIN_RELAY, !digitalRead(PIN_RELAY));
  }
  


}


OKAY THIS IS THE HOMIE EXAMPLE FIRMWARE BELOW. You still need to add the homie library even if you use the code above.


Now navigate to your Arduino libraries. In Mac OS X it is under "Documents"



Open your homie-esp8266-develop folder and go to examples. Open the one that says IteadSonofButton and double click the ino file




It will look like this after you alter the pin data as mentioned below:




We're going to change the value of the top 3 pins to this: (please bear in mind someone taught me this and that I wasn't smart enough to figure it out myself).


const int PIN_RELAY = 15;
const int PIN_LED = 2;
const int PIN_BUTTON = 13;


Make sure it looks like the picture above then click on "Verify" where my yellow circle is.



Now go into Arduindo under "Tools" and set your chip to Generic ESP8266 and then make sure all the other settings are the same. Make sure you have the proper Com Port selected as well. When I took this screenshot my FTDI controller was not plugged in. Again make sure you have it plugged in and selected.



If that works click on the right arrow next to the verify button and watch it upload to your chip.




HARDWARE HACKING COMPLETE!


Now the outlet should be in WiFi Access Point Mode. Check to see what wifi address it is broadcasting and connect to it.



Now go to this address to configure it. NOTE: IT WILL NOT CONFIGURE FROM A MAC. Must use Windows, or Linux, or Chromebook or Android or something else. The developer is aware of it and confirmed to me there was a bug.


http://setup.homie-esp8266.marvinroger.fr


TAKE NOTE OF THE DEVICE ID (the numbers and letters in the Wifi SSID after the dash) AND WRITE IT DOWN. It's just the mac address of the device but you need it later. If you change the device ID........WRITE THAT DOWN TOO. First thing you'll probably see is this:



If it does that I had to connect to my home wifi and then click on the setup link I posted above and get the page started and then quickly switch back to the Homie Wi-Fi Access Point. I think that is more of a browser cache thing than a bug of some sort. Anyway if you hit it right you'll see this below:



Now hit Next and fill in the following regarding your network credentials:



Now some other config. The broker address is the address of your MQTT server. I discuss that down below. You need an MQTT server before you can proceed. You can go ahead and fill this out if you know what the IP address is going to be of the computer where you install the server at. Note my mistake below.



Now finally, give it a name and then put your device ID in. Also check the box that says OTA enabled. After you hit next it should write to the device and restart and be ready to be controlled.




Run through the configuration. The only thing I couldn't figure out was the MQTT broker. This is the LEAST intuitive part of the process. Devices have their own protocol called MQTT which is a light weight protocol which runs on top of the http protocol. Anyway you need to connect to an MQTT server somewhere. There are free cloud ones however I just made my own. I installed a program called Mosquitto (yes, with two t's) on my Ubuntu Server. I won't get into the install and configuration of Mosquitto but it wasn't horribly hard and I will note it runs on Port 1883 and if you have a crappy home router it is easy enough for someone to enter port 1883 and turn your stuff on and off. So installing and turning on mosquitto is easy, but configuring it with security is kind of geeky. I run behind a good firewall appliance so my server is not accessible to the internet.


There are MQTT servers for every platform such as Windows, Linux and Mac. I just didn't want to install it on my mac laptop because when the laptop is gone, the mqtt server is gone and no home automation.


Okay so now I have this device configured. And now I have an MQTT server running. It was at this point I had zero clue what to do next. And it isn't intuitive at all. If you were the last person on earth no way you'd figure this out alone. Basically MQTT subscribes and publishes messages from machine to machine.


By the way........although I'm showing you the commands for using MQTT to turn the switch on..........don't look to me for too much help at this part of the tutorial. I'm slightly below beginner, noobie status on MQTT.


Ultimately I figured out (somebody told me what to do) that from my MQTT server I had to issue the following command to make the outlet turn on. Make sure you have the right topic name and device ID in your string here.


mosquitto_pub -t 'homie/382b78075571/switch/on/set' -m true


IF YOU USE SCOTT GIBSON'S FILE THE DEVICE TO CONTROL WILL BE "PLUG" NOT SWITCH. Here's an example


mosquitto_pub -t 'homie/382b780742c4/plug/on/set' -m true


I'll try to explain. The outlet broadcasts all the services it is running and you would be surprised how many. One of them is switch>set>on. True turns it on, false turns it off. So here's how it works.

- mosquitto_pub means we're going to publish to the outlet.

- The broker Topic is "homie". That is the default set in the configuration.

- The next field is your device ID or Mac address (unless you changed it)

- Now we're setting switch/on/set to true

Works like a champ.




Now I know you don't want to log into your server and issue a long command every single time. There are front ends for MQTT and one of the more popular ones is Home Assistant. Home assistant makes a webpage with a toggle switch to turn it on and off.



Basically once Home Assistant is installed you have to configure a file called configuration.yaml to see the switch and run the mqtt command. It isn't hard at all.


On your Mac where Home assistant is go to the terminal and type this:


cd ~/.homeassistant


sudo nano configuration.yaml


Add this to the bottom of the file: Be sure to .change your ip address on the 2nd line. Also change your Device ID's.


mqtt:

  broker: YOUR IP ADDRESS

  port: 1883

  client_id: home-assistant-1

  keepalive: 60

switch:

  - platform: mqtt

    name: "Wall Outlet"

    state_topic: "homie/382b78075571/switch/on"

    command_topic: "homie/382b78075571/switch/on/set"

    payload_on: "true"

    payload_off: "false"

    optimistic: false

    qos: 0

    retain: true

switch 2:

  - platform: mqtt

    name: "Wall Outlet2"

    state_topic: "homie/382b780749c1/switch/on"

    command_topic: "homie/382b780749c1/switch/on/set"

    payload_on: "true"

    payload_off: "false"

    optimistic: false

    qos: 0

    retain: true




That's it in a nutshell. Once you work through this MQTT thing once it isn't as bad as it seems and it then becomes easy enough to automate many more home items. Enjoy.




ESP8266 Weather Appliance

Found this cool project to create a weather appliance from an ESP8266 Weather Station. What's an ESP8266, you say? It's an Internet of Things (IoT) module that is wildly popular. You know the smart home outlets in Lowe's and Home Depot and Walmart that are internet controlled? They have ESP8266 modules (or similar) in them. Smart light sockets........Yep. Same. Those cool buttons at Amazon that order more Tide detergent when you press it...............You've got the idea.


This project can be found here but like most internet projects the instructions are frustrating as all get out. It's all there but not in a good, concise, intuitive method for dummies like me to follow.


This is based on an Adafruit Feather Huzzah which is probably the most expensive ESP8266 module but it it also probably the most mature and contains a battery port on board which is very cool.



You have got to solder two rows of male header pins on though so if you can't solder buy a beer for someone who can. That is probably the hardest part of the whole project.


You need a Feather Huzzah - $16 and a Featherwing TFT touch screen for about $25 to $30. Both items are frequently sold out due to popularity so if you find them in stock buy a couple of them. I had to get my Touch Screen off of eBay. The other items on the list such as the battery and switch are optional.


I'm going to try to not duplicate too much more of what is on the project page regarding hardware since they cover that pretty well. It's the software part that will drive you crazy. They make it sound more complicated than it is.


This is the part that drove me nuts because again the info was in the guide but buried in other links and links within links. I did this on a Mac so those are the instructions I'm providing here.


First and foremost to ever recognize the Feather Huzzah when you hook it to USB it needs a special driver, whether for Mac, Linux, or Windows. Download and then install the driver from here.


Now download Arduino IDE from here. The latest version as of this writing is 1.8.1.


Open Arduino IDE and then select Preferences. And add the following to the Additional Boards Manager Url's Line. Then click "Ok".


http://arduino.esp8266.com/stable/package_esp8266com_index.json





Now in the Arduino menu go to "Tools > Board > Board Manager (Sorry, my Huzzah board is already installed, yours won't be at this point yet).



Now in the search line type in "ESP8266" then click on the esp8266 by esp8266 community and an install button will appear. Install it.



Now quit and then restart Arduino and the Adafruit Huzzah Feather should be an option to select in the board dropdown as depicted above.


Set your frequency speed, Flash, and upload speed the same as in my pic above. Also plug in your Huzzah and select the port. On a mac it looks like this (/dev/cu.SLAB_USBtoUART).


Now go back to your toolbar in Arduino and click on "Sketch > Include Library > Manage Library"





Where it says "Filter Your Search" go through this list and install all your libraries as depicted. I'll only give the first example. All the others are the same.




- Adafruit GFX

- Adafruit ILI9341 Library

- Adafruit STMPE610

- WiFiManager for ESP8266

- ESP8266 Weather Station Library

- JSON Streaming Parser


Restart Arduino. I'm not sure it's necessary but it won't hurt. Make sure your board and port info are all correct.


Now from this page click on the green block that says "weather_station_color.zip". Also follow the directions beneath it for setting up a weather API key from WeatherUnderground.com


Open the file "weather_station_color.ino" from the zip file you just downloaded with Arduino. Maximize the window and go to the tab that says "settings.h" and add your weather underground API key and modify your location.



Once your key and location is in click the save button in Arduino




Now connect your Feather Huzzah via a micro USB cable to your Mac and then click on Upload



Now after successful upload of your sketch disconnect the Huzzah and follow the installation instruction on the Adafruit site, basically plug the Huzzah into the TFT touch screen. Soon as you boot it turns the Huzzah into a wifi access point to which you connect to and then input the SSID of your home wifi network and password and you should be displaying weather data.


Yer doing it!


I printed a 3D case from here. Turned out great.



LCD HD44780 Raspberry Pi 8 Bit Wiring

Had some issues with 4 bit wiring of my HD44780, 20x4 LCD which I use in a project in a tube amplifier. Every time the AC power is thrown it causes corruption in the LCD characters. Supposedly 8 bit operation is less susceptible to this behavior so here we go. ..........


Virtually every tutorial on the web is for 4 bit operation, and why not? Less wires, less pin assignments to add to your code..........it's just easier.


Here's how we wire it from the LCD (pins 1 through 16)

Pin 1 - Ground

Pin 2 - Hot (5v) pin 2 or 4 on Raspberry Pi

Pin 3 - Center leg of potentiometer for contrast (usually 10K ohm and they usually come with the LCD)

Pin 4 - RS pin 26

Pin 5 - RW to ground (DO NOT HOOK TO A GPIO OR YOU CAN REWRITE YOUR LCD)

Pin 6 - EN pin 24

Pin 7 - D0 pin 11

Pin 8 - D1 pin 12

Pin 9 - D2 pin 13

Pin 10 - D3 pin 15

Pin 11 - D4 pin 16

Pin 12 - D5 pin 18

Pin 13 - D6 pin 22

Pin 14 - D7 pin 7

Pin 15 - Hot (5v)

Pin 16 - Ground


NOTE: Pin 1 of LCD is the pin closest to the Raspberry Pi.

Pin 1 of the Raspberry Pi is the bottom left hand side pin. The pin above it has two red wires on it and is pin #2.



The remaining two pins on the Potentiometer go to hot and ground. Note that pin 2 I made a split jumper because there are only two 5v connections on the Pi. Three are required here. The black, negative wires can be placed on any Ground on the GPIO on the Raspberry Pi.




Also if you want to eliminate the potentiometer take the wire that goes from LCD pin to Ground (pin 3) and place a resistor in series with it. About 2K ohms will get you a nice clean display with perfect contrast. I have some small 4.7k ohm resistors and I twisted 2 in parallel together (2.35k ohms) and heat shrinked it up real pretty. Perfect display contrast and that totally elimates running another hot and ground wire down to a 3 leg potentiometer.


In order to fetch this information to display you need a python script from Github by jscrane. The file named lcd_lms.pl is the one you want. I usually click on that GitHub file which reveals the code in its entirety. Copy the whole code to your clipboard and do the following:


cd
mkdir lcdlms
cd lcdlms
sudo nano lcd_lms.pl


Then paste your code in. Once it is in find the line near the top that says this:


my $DEF_LMS = "rpi";


Change "rpi" to the IP address of your server


my $DEF_LMS = "192.168.20.138";


Hit CTL +X then Y and Enter to save the file.


Now make it executable.


sudo chmod u+x lcd_lms.pl


Now there are a lot of ways to start the program and a lot of Linux purists may poo-poo my simplistic method instead of using a fancy script which monitors it for life and resurrects it if it dies. I just start it from crontab at boot. The only gotcha here is the sleep command. I have a Raspberry Pi 3 and LogitechMediaServer starts in a matter of seconds. Consequently I have a Pi A+ which it takes about 2 minutes for LMS to fully start. Adjust your sleep command accordingly.


sudo crontab -e


add this to the bottom and adjust accordingly for the location of your file, your IP address and the name of your squeezelite player at the end.


@reboot sleep 25; /home/pi/lcdlms/./lcd_lms.pl -v lms -d localhost:13666 -l 192.168.20.138:9090 LCDpi


Should start at boot. Yer doing it!


Now for LCDProc.


Install lcdproc with these commands:


sudo apt-get install libany-uri-escape-perl libswitch-perl
sudo apt-get update
sudo apt-get install lcdproc lcdproc-extra-drivers
mkdir lcdproc
cd lcdpro
sudo apt-get install build-essential
sudo apt-get remove lcdproc
sudo apt-get install lcdproc lcdproc-extra-drivers


You can now modify LCDd.conf


sudo nano /etc/LCDd.conf


In /etc/LCDd.conf the following must be added to the driver section of the HD44780 section. (Note that the numbers are different and are the GPIO assignments of the Raspberry Pi NOT the PIN numbers).


For cut and paste below:


#GPIO Pin map page for 8 bit operation

pin_D0=17

pin_D1=18

pin_D2=27

pin_D3=22

pin_D4=23

pin_D5=24

pin_D6=25

pin_D7=4

pin_EN=8

pin_RS=7




A special driver is needed for newer Pi's and can be downloaded with the following command in a Pi Terminal. Make sure you point to this driver location in the

DriverPath=

section. I placed mine in /home/pi/lcdproc


mkdir lcdproc
cd lcdproc
wget http://sourceforge.net/p/lcdproc/patches/_discuss/thread/4c659fe3/b8f3/attachment/hd44780.so









Here's my /etc/LCDd.conf file in it's entirety. I've deleted the unneeded drivers for brevity. Your server section and driver section should contain the same information.


# LCDd.conf -- configuration file for the LCDproc server daemon LCDd
#
# This file contains the configuration for the LCDd server.
#
# The format is ini-file-like. It is divided into sections that start at
# markers that look like [section]. Comments are all line-based comments,
# and are lines that start with '#' or ';'.
#
# The server has a 'central' section named [server]. For the menu there is
# a section called [menu]. Further each driver has a section which
# defines how the driver acts.
#
# The drivers are activated by specifying them in a driver= line in the
# server section, like:
#
#   Driver=curses
#
# This tells LCDd to use the curses driver.
# The first driver that is loaded and is capable of output defines the
# size of the display. The default driver to use is curses.
# If the driver is specified using the -d <driver> command line option,
# the Driver= options in the config file are ignored.
#
# The drivers read their own options from the respective sections.






## Server section with all kinds of settings for the LCDd server ##
[server]


# Where can we find the driver modules ?
# IMPORTANT: Make sure to change this setting to reflect your
#            specific setup! Otherwise LCDd won't be able to find
#            the driver modules and will thus not be able to
#            function properly.
# NOTE: Always place a slash as last character !
#DriverPath=server/drivers/
DriverPath=/home/pi/lcdproc/


# Tells the server to load the given drivers. Multiple lines can be given.
# The name of the driver is case sensitive and determines the section
# where to look for further configuration options of the specific driver
# as well as the name of the dynamic driver module to load at runtime.
# The latter one can be changed by giving a File= directive in the
# driver specific section.
#
# The following drivers are supported:
#   bayrad, CFontz, CFontzPacket, curses, CwLnx, ea65, EyeboxOne, g15, glcd,
#   glcdlib, glk, hd44780, icp_a106, imon, imonlcd,, IOWarrior, irman, joy,
#   lb216, lcdm001, lcterm, lirc, lis, MD8800,, mdm166a, ms6931, mtc_s16209x,
#   MtxOrb, mx5000, NoritakeVFD, picolcd,, pyramid, rawserial, sdeclcd,
#   sed1330, sed1520, serialPOS, serialVFD, shuttleVFD, sli,, stv5730, svga,
#   t6963, text, tyan, ula200, vlsys_m428, xosd
Driver=hd44780


# Tells the driver to bind to the given interface. [default: 127.0.0.1]
Bind=127.0.0.1


# Listen on this specified port. [default: 13666]
Port=13666


# Sets the reporting level; defaults to warnings and errors only.
# [default: 2; legal: 0-5]
#ReportLevel=3


# Should we report to syslog instead of stderr? [default: no; legal: yes, no]
#ReportToSyslog=yes


# User to run as.  LCDd will drop its root privileges and run as this user
# instead. [default: nobody]
User=nobody


# The server will stay in the foreground if set to yes.
# [default: no, legal: yes, no]
#Foreground=yes


# Hello message: each entry represents a display line; default: builtin
Hello=" John's Awesome"
Hello="  Raspberry Pi"


# GoodBye message: each entry represents a display line; default: builtin
GoodBye=" Turn us back"
GoodBye="  on soon"


# Sets the default time in seconds to displays a screen. [default: 4]
WaitTime=5


# If set to no, LCDd will start with screen rotation disabled. This has the
# same effect as if the ToggleRotateKey had been pressed. Rotation will start
# if the ToggleRotateKey is pressed. Note that this setting does not turn off
# priority sorting of screens. [default: on; legal: on, off]
#AutoRotate=off


# If yes, the the serverscreen will be rotated as a usual info screen. If no,
# it will be a background screen, only visible when no other screens are
# active. The special value 'blank' is similar to no, but only a blank screen
# is displayed. [default: on; legal: on, off, blank]
ServerScreen=blank


# Set master backlight setting. If set to 'open' a client may control the
# backlight for its own screens (only). [default: open; legal: off, open, on]
#Backlight=open


# Set master heartbeat setting. If set to 'open' a client may control the
# heartbeat for its own screens (only). [default: open; legal: off, open, on]
#Heartbeat=open


# set title scrolling speed [default: 10; legal: 0-10]
#TitleSpeed=10


# The "...Key=" lines define what the server does with keypresses that
# don't go to any client. The ToggleRotateKey stops rotation of screens, while
# the PrevScreenKey and NextScreenKey go back / forward one screen (even if
# rotation is disabled.
# Assign the key string returned by the driver to the ...Key setting. These
# are the defaults:
ToggleRotateKey=Enter
PrevScreenKey=Left
NextScreenKey=Right
#ScrollUpKey=Up
#ScrollDownKey=Down




## The menu section. The menu is an internal LCDproc client. ##
[menu]
# You can configure what keys the menu should use. Note that the MenuKey
# will be reserved exclusively, the others work in shared mode.


# Up to six keys are supported. The MenuKey (to enter and exit the menu), the
# EnterKey (to select values) and at least one movement keys are required.
# These are the default key assignments:
MenuKey=Escape
EnterKey=Enter
UpKey=Up
DownKey=Down
#LeftKey=Left
#RightKey=Right


## Hitachi HD44780 driver ##
[hd44780]


# Select what type of connection. See documentation for availabe types.
ConnectionType=raspberrypi


# I/O address of the LPT port. Usual values are: 0x278, 0x378 and 0x3BC.
# For I2C connections this sets the slave address (usually 0x20).
Port=0x378


# Device of the serial, I2C, or SPI interface [default: /dev/lcd]
Device=/dev/ttyS0


# Bitrate of the serial port (0 for interface default)
Speed=0


# If you have a keypad connected.
# You may also need to configure the keypad layout further on in this file.
Keypad=no


# Set the initial contrast (bwctusb, lcd2usb, and usb4all)
# [default: 800; legal: 0 - 1000]
#Contrast=1000


#GPIO Pin mappage for 4 bit operation
#pin_D4=25
#pin_D5=24
#pin_D6=23
#pin_D7=17


#GPIO Pin mappage for 8 bit operation
pin_D0=17
pin_D1=18
pin_D2=27
pin_D3=22
pin_D4=23
pin_D5=24
pin_D6=25
pin_D7=4
pin_EN=8
pin_RS=7


# Set brightness of the backlight (lcd2usb and usb4all):
# Brightness is the brightness while the backlight is set to 'on'.
# [default: 800; legal: 0 - 1000]
#Brightness=1000


# OffBrightness is the brightness while the backlight is set to 'off'.
# [default: 300; legal: 0 - 1000]
#OffBrightness=0


# If you have a switchable backlight.
Backlight=no


# If you have the additional output port ("bargraph") and you want to
# be able to control it with the lcdproc OUTPUT command
OutputPort=no


# Specifies if the last line is pixel addressable (yes) or it controls an
# underline effect (no). [default: yes; legal: yes, no]
#Lastline=yes


# Specifies the size of the LCD.
# In case of multiple combined displays, this should be the total size.
Size=20x4


# For multiple combined displays: how many lines does each display have.
# Vspan=2,2 means both displays have 2 lines.
#vspan=2,2


# If you have an HD66712, a KS0073 or another controller with 'extended mode',
# set this flag to get into 4-line mode. On displays with just two lines, do
# not set this flag.
# As an additional restriction, controllers with and without extended mode
# AND 4 lines cannot be mixed for those connection types that support more
# than one display!
#ExtendedMode=yes


# In extended mode, on some controllers like the ST7036 (in 3 line mode)
# the next line in DDRAM won't start 0x20 higher. [default: 0x20]
#LineAddress=0x10


# Character map to to map ISO-8859-1 to the LCD's character set
# [default: hd44780_default; legal: hd44780_default, hd44780_euro, ea_ks0073,
# sed1278f_0b, hd44780_koi8_r, hd44780_cp1251, hd44780_8859_5, upd16314 ]
# (hd44780_koi8_r, hd44780_cp1251, hd44780_8859_5 and upd16314 are possible if
# compiled with additional charmaps)
CharMap=hd44780_default


# If your display is slow and cannot keep up with the flow of data from
# LCDd, garbage can appear on the LCDd. Set this delay factor to 2 or 4
# to increase the delays. Default: 1.
#DelayMult=2


# Some displays (e.g. vdr-wakeup) need a message from the driver to that it
# is still alive. When set to a value bigger then null the character in the
# upper left corner is updated every <KeepAliveDisplay> seconds. Default: 0.
#KeepAliveDisplay=0


# If you experience occasional garbage on your display you can use this
# option as workaround. If set to a value bigger than null it forces a
# full screen refresh <RefreshDiplay> seconds. Default: 0.
#RefreshDisplay=5


# You can reduce the inserted delays by setting this to false.
# On fast PCs it is possible your LCD does not respond correctly.
# Default: true.
DelayBus=true


# If you have a keypad you can assign keystrings to the keys.
# See documentation for used terms and how to wire it.
# For example to give directly connected key 4 the string "Enter", use:
#   KeyDirect_4=Enter
# For matrix keys use the X and Y coordinates of the key:
#   KeyMatrix_1_3=Enter
KeyMatrix_4_1=Enter
KeyMatrix_4_2=Up
KeyMatrix_4_3=Down
KeyMatrix_4_4=Escape



# EOF

Easy calendar instructions

Simple Steps:


Get a Raspberry Pi. I recommend the Zero for this project and I strongly recommend getting the Adafruit kit that has the adapters you need.


You'll need a wifi dongle too if you want to do wifi.


- Get a dakboard account and private url


- Download image


- Use Etcher to install image on micro SD card


- Boot


- Change user password


- insert your dakboard private url into a file. Notice I have obstructed my private url for security. You need the whole link.



- Get a dakboard account and configure the page they way you like it.


- Download a program called Etcher. It will write your OS image to your SD card. No typing in any long command in a terminal. Insert card. Download raspberry pi image, burn it.


- Download my image file. It will immediately download. Double click to extract the .img file. That is what you tell etcher to burn. Sadly the compressed image is 2GB in size, however this is WAY easier than configuring everything yourself.


Navigate to that .img file in etcher, insert a micro sd card into your computer and click "Flash!"




Once complete, place the micro SD card into the Pi. Ensure that the Pi is connected to ethernet for now at a minimum. It may be very beneficial for the first boot to hook a keyboard, and mouse up, and of course the TV you are going to install to via HDMI.


You can also Download a program called VNC Viewer. This will allow you to remotely view and control the desktop.


The hostname of the computer = pizerocalendar

The user name = pi

The password = calendar


You must know your IP address if you use VNC Viewer. Use an app called Fing on IOS or Android to find it. There are Windows, Mac, and Linux programs as well. If you are using a keyboard, monitor and mouse. Open the terminal and type


ifconfig



You can see my address under eth0 is 192.168.20.140


Now you can use VNC Viewer






Okay now open a terminal and type:


sudo nano ~/.config/lxsession/LXDE-pi/autostart


You'll see the following code


@lxpanel --profile LXDE-pi

@pcmanfm --desktop --profile LXDE-pi

@xscreensaver -no-splash

@point-rpi

@xset s off

@xset -dpms

@xset s noblank

#@chromium-browser --noerrdialogs --incognito --kiosk http://www.google.com


On the very last line you'll see http://www.google.com. Remove that part only and cut and paste in your dakboard private address from configuring dakboard.


Then hit the CTL + X key. It will ask you Y or N to save. Hit Y and then enter.


While you are in the terminal type this (I forgot to do it in my image file). Unclutter makes the mouse disappear after a few seconds.


sudo apt-get install unclutter


Now type


sudo raspi-config


Expand the Filesystem and change the user password. (Items 1 and 2) Please. Just do it.



Now reboot your computer. It should boot directly into a full screen Chromium browser with your dakboard page displayed.


While you have a keyboard, monitor and mouse hooked up you can add a wifi dongle and configure your wifi on your desktop as well. Same as Windows, click the icon, select your SSID and input your wifi password.


Easiest Raspberry Pi Wall Calendar Yet

What you need:

- Raspberry Pi Zero (or better)

- SD Card

- TV with at least one HDMI input

- Wall mounting bracket for TV

- HDMI Cable

- 1.5 amp power brick

- WiFi dongle (not needed if using a Pi 3 with onboard wifi)

- Micro HMDI to HDMI adapter (only needed if not using a Pi2 or 3)

- Micro USB to USB adapter (only needed if not using a Pi2 or 3)


Get a Raspberry Pi (Zero in my case for this project) and install the latest Raspbian Pixel on it. This is going to be hanging on a wall so there will be no mouse or keyboard but initially you have to set it up with one to make it easy. Might be way easier for a novice to hook up a small usb hub with a keyboard and a mouse especially since when you boot into Raspbian OS the first time and see the desktop you can easily click on the wifi icon in the upper right task bar and input your wifi credentials. It'll save you a ton of time. The only other way would be to hook the Pi to ethernet and SSH into it, set up a VNC session, enable wifi either by command line or desktop............You get the idea. Just hook up a darn keyboard and mouse for the first boot. Obviously we are using our TV here for a monitor.


Download and install the latest Raspbian Pixel on your SD card. Refer to here for directions.


You can do the next steps via SSH as well if you got your wifi enabled or connected via ethernet. But while the keyboard and mouse are hooked up, why not just do it? We'll do the wifi later in the instructions.


NOTE REGARDING SSH - THE LATEST VERSION OF RASPBIAN JESSIE-LITE DOES NOT HAVE SSH ENABLED. IN ORDER TO ENABLE IT AFTER YOU CREATE YOUR SD CARD you must add a file called ssh to /boot


Here's how I did that on a Mac. Right after the Raspian image wrote to the card I went to a terminal and typed


cd /Volumes

cd boot

touch ssh



There are a variety of ways to do this. I figured that was the easiest. If you are doing this from Windows or Linux you may need to google it to get the exact directions. Now lets configure our Pi knowing we can SSH into it if we need to.



sudo raspi-config




Go to "Interfacing Options"



Then enable VNC. (Even though I don't really go into why you're enabling VNC, and even though you don't need it for this tutorial maybe, you'll be glad later when the TV is hanging on the wall with no keyboard and mouse that you can access your Pi from a VNC session from another computer).



While you are in there after you hit the back command on the screen above go do option 1 to Expand Filesystem and option 2 to change the password.



Okay while you are in SSH or in your terminal also run the following commands:


sudo apt-get update


sudo apt-get upgrade


We're going to use Chromium browser since it is already installed on Raspbian Pixel as of Sep 2016.


Chromium browser is EXACTLY the same thing as Chrome just without fancy dancy licensing.


While you are hooked to a TV with keyboard and mouse enable your wifi. Coding it by hand isn't the end of the world but this is MUCH easier. It's pretty much done the same way as every other computer you've configured wifi with.




Now on any computer anywhere open a browser and go to dakboard and create an account. Once you create an account you can configure a webpage with your widgets. Just work down the list and play around until you get what you like. There is no right or wrong way.




You can check your progress by clicking on "My DAKboard" (4th from the bottom in left hand pane). Now go to your account page and we're going to grab the customized web page so we go straight to our calendar every time and don't need to log in. Copy the link below where it says "Private URL:". Mine is obviously partially obstructed for security reasons.



Okay back to the Raspberry Pi either on the desktop in the terminal or via an SSH shell.


Type the following:

sudo nano ~/.config/autostart/chromium.desktop

Paste in the following code (USING THE WEB ADDRESS FROM DAKBOARD I MENTIONED ABOVE)

Once again i have chopped the end of my address off just for security reasons.



[Desktop Entry]

Encoding=UTF-8

Name=Connect

Comment=Checks internet connectivity

Exec=/usr/bin/chromium-browser --noerrdialogs --incognito --kiosk http://dakboard.com/?p=850




Hit CTL key + x , answer Y for yes to save.


What we just did was to tell Chromium Browser to start up full screen every time you boot the Pi and log into your Dakboard that you configured.


NOTE: Here's a great big gotcha for you folks. Once you start Chromium browser in kiosk (full screen) mode it doesn't seem to want to get out of the way so you can do things on the desktop OS, like set your wifi for instance, or tell the computer to reboot. This is where logging in via ssh comes in handy. From a terminal on another computer on the same network do this:


ssh IPADDRESS -l user #(i.e. ssh 192.168.20.139 -l pi)


if it asks you to accept ssh keys yes/no say yes. If it tells you to get lost and your keys don't match type this to fix.


ssh-keygen -R IPADDRESS #(i.e. ssh-keygen -R 192.168.20.139)  #That deletes old ssh keys and allows you to ssh in again.


To kill Chromium browser


sudo killall chromium-browser


To relaunch just type chromium-browser or launch it from the desktop.


Moving on.

Lets keep the lights on, don't want the screen going to sleep.


sudo nano ~/.config/lxsession/LXDE-pi/autostart


Paste in the following code at the bottom of the file


@xset s off

@xset -dpms

@xset s noblank



Hit CTL key + x , answer Y for yes to save.


Sweet. Reboot to test.


sudo reboot


or


sudo shutdown -r now


This is what you should see when you reboot. Boots directly into Chromium with your Dakboard. You can add your own photos to a variety of web services. I used Dropbox.



Here's what the TV looks like. I double side taped the Pi Zero to the back. Very clean looking hanging on the wall.




I changed the layout a bit as well. I tried first hanging it in Portrait mode, which was cool, but this is also a smart TV with wireless and that deprived me of the ability to watch Hulu and Netflix while cooking if I wanted to.




If for some reason your TV screen doesn't quite go edge to edge and fill the screen issue the following command and uncomment the line (remove the #) that says disable_overscan=1


sudo nano /boot/config.txt



Hit CTL and X and then answer Y to save the changes.


If you see any pixelation make sure you have a good connection with your HDMI on the adapter end especially and you can add more GPU memory if need be. Go to raspi-config and then "Advanced" > A3 Memory Split. I set mine to 128


sudo raspi-config






Now you are basically done and can stop here. UNLESS you are a mythical POWER USER!


To get just a little more complex with this setup............Since I have this TV hanging on the wall which is always on I decided to make use of the fact it has speakers on it which are largely not being used. (It is also a smart TV so I can stream Netflix and Hulu, Vizio 24")


At home I have a music media server called Logitechmediaserver (LMS). It is available for a variety of platforms such as Windows, Linux, Mac, Raspberry Pi (ARM), and some NAS devices. My principal LMS server is installed on a Mac Mini. From there you go to mysqueezebox.com and make an account. Once you have an account you can add streaming services such as Spotify, Tidal, Pandora, TuneIn Radio, Shoutcast, among several others. Those are the ones I have used or currently use now.


You don't HAVE to put LMS on another computer. It will run on the same Pi, it may be a little slow on a Pi Zero but it'll run. Runs real nice on a Pi 3. So if this is going to be a stand alone LMS lets do this. If you intend to install LMS on another computer you can skip this. I have directions below for just adding a squeezelite player. To install LMS go to the nightly link above and right click on the ARM version and go to your terminal and type wget followed by the link (again using the latest version as of when I wrote this).



Now type (and make sure your file names are right, cut and paste with links is weird sometimes)



cd

mkdir lms

cd lms

wget http://downloads.slimdevices.com/nightly/7.9/sc/cf749e5/logitechmediaserver_7.9.0~1482423225_arm.deb

sudo dpkg -i logitechmediaserver_7.9.0~1482423225_arm.deb


The last command there will install LMS on directly on your Pi and it should start automatically. The way to access it is any browser on the same network with the IP address of your Pi plus :9000 (i.e. 192.168.1.2:9000) To find the address of your Pi type


ifconfig 


So then since you have a Raspberry Pi hooked to a TV delivering the awesome DAKboard why not put a streaming player on it and use the speakers? Granted my Vizio TV speakers sound pretty terrible however it is good enough for talk radio and I listen to a lot of talk radio. Also if you used a Raspberry Pi 3 with built in bluetooth you could conceivably hook to some bluetooth speakers for decent sound. Again, this is a kitchen rig. All I want is talk radio however it would only take swapping the Pi Zero with a Pi 3 (or Pi2 with a bluetooth dongle) to get more.


Adding squeezelite is remarkably simple. I do it like this. It needs some dependencies though to play common file formats.


sudo apt-get install libasound2-dev libflac-dev libmad0-dev libvorbis-dev libfaad-dev libmpg123-dev
liblircclient-dev libncurses5-dev


Then lets get and install squeezelite.


mkdir squeezelite
cd squeezelite 


Now go to this page to get the latest squeezelite. My tutorial will describe the current latest version. Simply change version number if it updates once this post gets dated a bit.


wget https://sourceforge.net/projects/lmsclients/files/squeezelite/linux/squeezelite-1.8.6-825-armv6hf.tar.gz
tar -xzf squeezelite-1.8.6-825-armv6hf.tar.gz sudo mv squeezelite /usr/bin/squeezelite


Okay squeezelite is now installed. Simple.


Now lets see our devices. I'm using the HDMI sound off the TV here. You could add a DAC if you wanted to.


squeezelite -l


There is quite a bit of output for a Pi Zero. The following kind of depends on what kind of Pi you have in the project. I am using a Pi zero which has really only one audio output. The HDMI. I could have chosen the one that says "sys default", the other "hw:" device works I know. Probably some others as well. If you are using a Pi 2 or Pi 3 you also have an onboard sound output which will be your sys default. To pipe sound out via your HDMI cable you pretty much have to use the one I have circled, or the plughw one below it two items. Yes you can use the sysdefault off the 1/8th inch output on the Pi but then you need another cable. Let's keep it simple, shall we?

I chose to use the one circled because it is the hardware (hw:) device for the HDMI. . Now here's what we do to set up the device and make it start at boot.




sudo nano /etc/systemd/system/squeezelite.service


It'll be empty. Paste this in (and note this is MY system), alter accordingly. After squeezelite -o add the player you selected. The -n parameter is the name of the player. Name it anything you want. The -s is the LMS server. If you leave this out entirely it will likely find it. If you want to put -s 127.0.0.1 that will work too. The -a 80:4 is something I used on another TV that sounded terrible and choppy until I added those parameters. To be honest I didn't remove it on this new TV and it works great. I'm leaving it in. You may not need it or you might need it. Because I have like 10 players in the house sometimes they conflict with each other. The -m setting is the MAC address of the player to keep them all straight. If this is your only player you won't even need to add the -m part.




[Unit]

Description=Squeezelite

After=network.target

[Service]

ExecStart=/usr/bin/squeezelite -o hw:CARD=ALSA,DEV=1 -n calendar -s 192.168.20.37 -a 80:4 -m 74:da:38:41:f8:9e

[Install]

WantedBy=multi-user.target


Hit CTL +x and then answer Y to save the file.


Now lets start it at boot


sudo systemctl enable squeezelite.service 



Now if everything went according to plan when you boot up and find your LogitechMediaServer (it is the IP address of the computer you put it on plus :9000) In my case my LMS lives on my Mac Mini of 192.168.20.37:9000


Just put that in a browser and look for your -n parameter (I named mine calendar). It should find it as a player.



You can see I circled the apps I enabled in my squeezebox.com


Tidal and Spotify you must have pay premium accounts to use. Ditto with Pandora. TuneIn and Shoutcast are free.


Now your DAKboard is a music player too!



Impress your friends. Attract women. Be the life of the party with your wall calendar and music streaming device.





JBL Flip 3 Bluetooth Speaker Review

How have I missed this? I'm almost embarassed. I'm usually all over technology, especially when it is audio related but I missed the boat on bluetooth speakers entirely. I'll list below why I "need" one but I really screwed the pooch, and here's why.......


Go into any big box electronics store and the only real thing in audio anymore is the Sonos devices. They are essentially computers, with apps, that stream to bluetooth speakers. And at a premium cost. LogitechMediaServer was supposed to catch on like this but they were a few years ahead of their time. This is one of my favorite devices and my daughter uses it still daily. The Logitech Squeezebox Radio.





Every kid now knows how to manipulate bluetooth because of designer headphones. Once LogitechMediaServer went belly up though they released their media server code as Open Source which has allowed that community to thrive. What I'm saying is Sonos costs money, LogitechMediaServer does not.


Now let's take that a step further. Darn near every app is free. iTunes, Spotify, Tidal, Pandora, TuneIn, iHeartRadio, etc.


YOU DON'T NEED A SONOS OR A LOGITECHMEDIASERVER. ALL YOU NEED IS A BLUETOOTH SPEAKER AND THEN YOU HAVE THE SAME THING!


Your phone, iPad, Android, or Computer is the server. Why do you need Sonos to play the Spotify app? You don't. What I'm really saying is a couple of GOOD bluetooth speakers are equivalent or better than a high dollar "system". God, I'm embarrassed I didn't notice that before.


That being said there are still some cool aspects to both platforms and I'm not about to abandon my LogitechMediaServer platform. It's not too late to save yourselves though. :)



I had a couple of minor annoyances that were solved with a bluetooth speaker. First was I am required to drive a government vehicle at work for trips up and down the East Coast which I take somewhat frequently. The Aux In on the radio has failed so no more smart phone streaming my favorite talk radio show from the TuneIn Radio app. Last couple times I just sat the phone on the dash and could barely hear it.


Second, I have a hot tub which I use quite a bit. Nothing better than coffee in a hot tub. To pass the time I put an iPad mini on a suction cup mount and can watch local TV through my Emby Server, or stream YouTube, or Sling, or Netflix or Hulu or whatever. Soon as I take the top off the tub and get all set up the heater and pump usually kick on making it very hard to hear.


So I've contemplated getting a bluetooth speaker for a while. There's only one problem. I'm an AUDIOPHILE, whatever that is, and the thought of a crappy, tinny sounding speaker is way beneath me. Then I started thinking, "this is for talk radio in the truck and action movies in the hot tub".


I never buy anything without reading a hundred reviews, reading the customer forums, and then re-reading all that stuff again. You'd be amazed what you learn about a product reading the customer forums. After the smoke cleared I opted for a JBL Flip 3. Everyone carries them, Target, WalMart, BestBuy as well.



I honestly wasn't expecting much in the way of sound despite all the reviews saying it was one of the better sounding speakers, supposedly sounding better than speakers in more expensive tiers. I did not open the manual initially and found it remarkably simple and intuitive to hook to a computer and use. And it sounds WAY better than I imagined that it possibly could. Impressive for something only slightly longer than my iPhone 6.


I knew I wanted to push this thing to the limit and go somewhere most bluetooth speaker users never go. I wanted to use my home music server to play all my locally stored music (about 6TB, yes 6TB) and stream from my LogitechMediaServer which has Spotify, Tidal, TuneIn Radio, and Shoutcast. I figured I would have to dedicate a Raspberry Pi computer or something to this task then when I read an obscure post on some forum somewhere about streaming LogitechMediaServer via Squeezelite (that is the name of the player used in LogitechMediaServer) to a bluetooth speaker.


The post suggested using an app called iPeng, which I already had, which allows you to control LogitechMediaServer from your phone or iPad. I had forgotten that iPeng creates a media player within the app so you can play music on your iPad or iPhone, which really isn't that useful in itself. But it is very useful if you have a BLUETOOTH SPEAKER!


So now I not only have a bluetooth speaker I HAVE AN EXTENSION OF MY HOME MEDIA SERVER. Here's another cool aspect to this. By connecting my iPad to my OpenVPN server I can access my home music library and for that matter my video media servers (Emby and Plex) and can play all my music at home or watch all my videos or Live TV from my home (and of course stream the audio to the JBL Flip 3). I can watch local news when I'm not at home. Anyway, whatever content is at home can be streamed to wherever I'm at. Think "Free Slingbox".


There are a million screens to iPeng but basically below you can see my apps. Spotify is a selection along the side there as well. Were I to click on "Artists" in the left hand pane it would list my 6TB of music in the middle. Awesome!



Lastly you can control it from a browser as well from your LogitchMediaServer IP address.



Now, what else is cool about this speaker and maybe even not so cool. Let's start with a "Not So Cool".


Like every device in the world now that is basically a computer it has embedded software called firmware. Mine was not up to date. There is only one way to update it and that is to download an app called JBL Connect. Also because you are transferring a file over bluetooth it takes 10 or 15 minutes. A lifetime these days. The program only prompts you about firmware if there is an update available. Other than that it doesn't do too much but does let you do some things that are cool.


The app appears under "iPhone Only" but installs and works fine on an iPad.



Click on where it says JBL Flip 3 and you can change the name of the device.



Lastly it shows you how to connect 2 JBL Bluetooth speakers together which is very, very cool.



Lastly, we'll talk about the sound again. Very, very good sound and tons of bass. So surprising for such a small device. For the price point I don't really think you can go wrong. There are much more expensive bluetooth speakers and I'm not sure the value is there unless you need a device you can drop in the pool and survive or something.


Only thing better than one JBL Flip 3 is two of them! One gotcha though not in the manual. You only connect one speaker via bluetooth to your computer, phone, or tablet. Then you push the Connect buttons on each one. Don't pair both speakers to your device then connect them. It'll cause one to choke for a short period of time and every time you change songs or volume it chokes again. Works perfect if you do it like I said above. Also the JBL Connect app recognizes them and allows you to set them in Party or Stereo mode. Stereo mode, duh.






And if you want to take it on the road with you check out this perfect case that I got from Amazon.




John's Grade: 4.8 of 5 stars. Minor reduction for firmware upgrade process and supposedly no "iPad Only" app.

Maytag Washer Repair LNC6764A71 Water Pump

Let me start out by saying if you are buying a new washer resist the urge to buy one that has a fancy LED display with push button controls and it connects to the internet to let you know when it is done. If that kind of washer (or dryer or refrigerator) breaks you are DOOMED to pay a repairman big bucks to fix it. Washers need to agitate and spin. The cheapest washer at Lowe's with the pull out and spin big giant knob is the best one to get. Not only is it inexpensive, it is cheap to repair and easy to fix. A motor drives a pump and the tub. All it is is a motor, a pump, a tub, and bearings. Any fool can fix even the most horrific failure.


Your washer does not need internet access. It just doesn't.


I have a LNC6764A71 washer that I bought in 2003. It was in storage for about 10 years so it is still basically brand new and too nice to replace just yet.



Yesterday as soon as the spin cycle kicked on the metal to metal noise was God awful. I shut it down and started an inspection right away. A quick Google reveals in a couple of links that it is most likely my water drain pump. Sure enough it was. I enjoy fixing my own stuff. No way I'm paying $200 for some guy to show up to fix a $350 washing machine.


Find your model number and then look it up on one of the parts sites. Take note of the Rev number as well.



Parts sites such as this for my model washing machine are abundant and you can order straight from them. Notice I have selected the Drain Pump for a Series 19 washer. That is the importance of the Rev number above.




However $80 for a new pump is crazy. I strongly recommend heading over to eBay and checking for the required part number (PS11741803). I found a third party pump for $24 and the original Whirlpool pump (Whirlpool actually made this Maytag washer) costs $55 or so. I went ahead and ordered the Whirlpool OEM original part.


Let's dig in: Step 1 unplug and pull the drain line out of the wall.



Now let's get 'er on her side. We want to remove the gray panel. 3 Screws. So we can see the offending pump.



Before we remove it go to the bottom of the machine and rotate the belt off the pulleys. The pump we are changing is in the upper left had corner of the picture below. See all the black stuff around the bearing? Bad.



Now let's remove the 3 screws and the rubber tubing line's by loosening the clamps with pliers. Squeeze and slide. The large one is the water pump inlet and the smaller one is the outlet that pumps water out. It's your drain line. The pump will be full of water. Plan accordingly for a quarter gallon of water or so to drain out.




Now the machine screws that hold the pump down.


That's it. Seriously. Remove and inspect. See the corrugated metal protruding? That is not supposed to be there. That is what is grinding on the bottom mounting plate causing all the noise.



And there is an obvious bearing failure. Look at all the black bearing dust. Diagnosis: EPIC FAIL



Got the replacement part.



The repair goes like this:


- Bolt new pump in with the three bolts you removed from the old one.




- Put the 2 rubber tubing lines for the pump inlet and outlet back on and ensure they are clamped securely




- Spin the belt back on the bottom



- Plug it in and stick the drain line in the wall.

- Wash some clothes with a smile knowing you saved a couple hundred dollars.







Raspberry Pi Audio - How to get started easily

RASPBERRY PI WITH HIFIBERRY DAC PLUS INSTALLED




One of the easiest Raspberry Pi projects to make is a home audio device. But even though it's one of the easiest it probably still seems prohibitive to the non-initiated. No more. I'm going to make it as easy as I possibly can. First of all you need to buy stuff. Here's a concise list with links. Bear in mind that you probably already have a cell phone charger with a micro USB port (minimum 1 amp output) and a micro SD card that is at least 8GB in size minimum so already you can save some bucks!


Parts Required

Cost

Raspberry Pi

$35.69

SD Card 16GB

$9.99

HiFiBerry DAC+ (Pro)

$22.90 to $44.90

Charger 2.5A

$9.99


I recommend the Hifiberry Digital to Analog Converter, DAC + Pro which is what is depicted above. Note that there are other DAC's for the Raspberry Pi but I like HiFiBerry because their support is excellent.

Not only that, they make it extremely easy to configure their hardware so you can kind of plug and play by using a program called HiFiBerry Installer. At the end of the day though all that does is make the hardware work. That leaves you, the newbie, to figure out how to install and configure some audio server software which means you need to have secure shell access and some command line experience. THAT is what we're trying to avoid here.


Let's talk just a bit more about the Hifiberry Installer. If you make your SD card using the Installer it puts a script file in the Operating system which auto-detects which Hifiberry device you have. In other words the downloadable image file below WILL WORK FOR ANY HIFIBERRY DEVICE. YOU DON'T NEED TO CONFIGURE OR CHANGE ANYTHING! Sweet!


So I'm going to provide you a downloadable image that has preconfigured the HiFiberry DAC, logitechmediaserver, and a player so that all you need to do is create an on-line account on mysqueezebox.com and then add some apps. Be forewarned that some apps will require pay service such as Spotify, Pandora, or Tidal. However most streaming radio apps are entirely free and you can plug a USB drive into your Raspberry Pi and play your locally stored music.


"The downloadable image file below WILL WORK FOR ANY HIFIBERRY DEVICE. YOU DON'T NEED TO CONFIGURE OR CHANGE ANYTHING!"


DOWNLOAD MY PRE-CONFIGURED IMAGE FROM HERE (approx 1 GB in size and will begin downloading as soon as you click on it).


Once downloaded then unzip the file which reveals a file named hifiberry_raspbian.img


Then by far the easiest thing to do is to download Etcher which will write your image file to your SD card. Etcher works on Linux, Mac, and Windows. Select the file, select the drive your SD card is, and push the button that says "Flash!". Easy.




Or if you want to do it the hard way on the command line the best most concise instructions for installing Raspbian from an image file are found on the Raspberry Pi website here.


My software image is based on Raspbian Jessie Lite dated Nov 2016 and has the following details:

- Hostname = hifiberrydac

- SSH access enabled

- User name (for SSH login) = pi

- Password = raspberry

- No wifi configured, must boot to ethernet first ( I don't know your wifi SSID and Password so it would do no good to set this up)

- Hifiberry Dac + enabled and should light up (green light on top) upon boot.

- Latest (as of 5 December 2016) Logitechmediaserver

- Squeezelite player installed and appears as "HiFiBerry" in Logitechmediaserver (once accounts are created and you are logged in).


All you need to do is find the IP address of your raspberry pi. One of the easiest ways is to use a free Network app called Fing. Here's what that will look like. Note the address of 192.168.1.105



Or you can boot the raspberry pi attached to keyboard, monitor and mouse and type ifconfig after logging in with the user name and password. It'll look like this: (Note that my address below is 192.168.1.105)



Also before we tackle this Logitechmediaserver thing lets do some Pi Maintenance now that we have the IP address.


Open a terminal in Mac or Linux and type


ssh 192.168.1.105 -l pi (Use your IP address here)


if it barks at you about ssh keys type this:


ssh-keygen -R 192.168.1.105


Then login again. This makes new login keys.




Now type


sudo raspi-config


Hit enter on "expand filesystem". This will fill up your SD card. My image was roughly 2.7 GB and you probably have a 16 GB card at least. This fills the card. Expand the filesystem then reboot and login again.



While you are in raspi-config...........PLEASE USE OPTION 2 and change your User Password. Please! Do that.


NOW.......you can start configuring your Logitechmediaserver!


Go to a browser and type:


http://192.168.1.105:9000



Then create the account and add apps. A non paying app to try is TuneIn Radio.




Here's an example of my apps. Note that you can make a FREE TuneIn Radio account. You'll have to do that too if you go that route.



Once you make your account be sure to go back in to your 192.168.1.105:9000 (make sure to use your IP address here) and log into your new mysqueezebox.com account.


Once you have this set up you are done. Plug your pi in somewhere, hook it to an amp or your stereo and go to the address of your logitechmediaserver in your browser and start streaming.


After you set up your mysqeezebox.com account and log in it should look like this (depending on what apps you selected) Note that my Squeezelite player "HiFiBerry" is selected in the upper right hand corner.



Now I'm playing music from FolkAlley.com. Highly recommended!




And that's it! Easiest Linux music server you'll ever configure. Feel free to leave me comments below.


Security Cameras

Decided to put a dedicated security camera up and put in the requisite homework. Rising to the top of most lists is the ReoLink RLC-410.




The prime reason I picked this camera is because it allows for local storage of your video files. Many cameras today which appear to be sleek and have tons of features usually have a pay service where your video files upload to. I find this to be somewhat objectionable. However at the cost of hosting your own files it requires tons of storage to run and record 24/7 and it can get a bit geeky. Fortunately, I'm a geek.


Another great aspect of this camera is that it is a Power Over Ethernet (PoE) device. That means all you need is a network cable and either a PoE switch (roughly $80) or a PoE injector (roughly $20). I opted to get a 4 port PoE switch so I can add some additional cameras later. Great thing about these switches is that if your device is not PoE you can still use the yellow ports as regular ethernet ports.



Chances are your porch doesn't have an ethernet connector out there so you'll have to get an ethernet cable out there somehow. In the case of my home it was pure hell. I had to walk the ceiling joists far enough back in my roof to where I could feed a 300' fish tape. Then I had to dis-join a piece of soffitt under my porch to attach the fish line to my CAT 5 ethernet cable.



Once I pulled it all the way through the attic I fed it down a wall in the garage where I wired it to a wall plate. And using my super geek skills and my Roland GX-24 vinyl cutter I made a yellow PoE label for the switch plate.



The Netgear PoE switch is mounted on the garage wall next to the ethernet wall plate. Don't mind the mess. All you need is the switch connected to internet and a cable going to your camera. I have a LOT of other things going on here.





After that I terminated a CAT 5 connector on the end of the cable and tested for network connectivity by using my laptop. Worked like a champ. So now I know that cable is ran and has connectivity.



Then it was just a matter of mounting the camera . I had to enlarge the hole quite a bit to stuff the connectors from the camera into the soffitt, then I just plugged it in and downloaded the Reolink app to my smartphone.




Here's the Mac version of the software.



Perfect. That's about all there is to it. I will say setting up the file recording location was somewhat troublesome. If I put it on my laptop then take my laptop to work..............No 24/7 video, only the motion alerts on the SD Card. So I opted to upload the files to my Mac Mini which stays at home all the time and is my music server. That worked perfectly. Then for some redundancy I installed an FTP server on my web and cloud server which has Ubuntu Linux Server installed on it. You could conceivably upload your files to any FTP server anywhere.


Reolink also has an NVR recorder which is basically a server for hooking all your cameras up to and storage for the video files. I'll look into that later when I get a couple more cameras up.


So here's a quick review with Pros and Cons..........


PROS


1. Inexpensive. Cheaper than most security cams.

2. Power over Ethernet.

3. App easily finds and configures camera.

4. Mac, Windows, iPhone and Android software.

5. 80 degree optical coverage. Huge.

6. Exceptional night vision performance.

7. LOCAL STORAGE OF VIDEO FILES.

8. No cables showing after installation, no power plug for the bad guy to remove.

9. Camera can record audio but you have to enable it and it's buried in the configuration.

10. Version I bought has a 16GB SD Card built in which holds motion alerts. More redundancy for recording.


CONS


1. Not much documentation. And the manual they give you is on a mini cd. Who has a laptop with a CD player that takes mini cd's these days?

2. Minimal directions for uploading to an FTP server. Not intuitive.

3. Software is a little clunky and non intuitive. For example I was getting a million motion alerts. Took me a while to find out you can block out zones in your optical coverage. Every car going by used to set off an alert and create a large file.

4. Didn't come with the latest firmware but it was easy to upgrade the firmware.


In my opinion the Pros outweigh the Cons by a LOT. For the price you cannot beat the RLC-410 and it contains features found in much more expensive cameras and the best reason is the fact you control the video files and don't have to pay $15 a month to essentially store and organize your video files.

Jivelite - The Squeezebox Touch Clone - PiCorePlayer

Once upon a time there was an awesome audio device called the Squeezebox Touch from Logitech.


The Touch was loved by audiophiles for its touch screen interface and great DAC. Paired with LogitechMediaServer which you can sync with other players giving you a whole house audio experience. That is one thing that many media player did not implement very well......the ability to sync perfect playback across multiple devices.





Anyway in a world where nobody cares about sound anymore and the main method of delivery for music is a telephone with a pair of designer headphones the Touch didn't stand much of a chance of being a commercial success.


The good news is that when Logitech ditched their device line of Squeezeboxes they made their media server Open Source and the community ran with it and made it a great little project for lots of platforms and especially for the Raspberry Pi. To make things even cooler a project called Jivelite sprung up which turns a Linux computer with a touch screen into a Squeezebox Touch. I made a couple of them and started my documentation process here. To date it has been my most "successful" web page and it was essentially installing Jivelite the "hard way".


But because it is Open Source now others have taken the project to the next level. One such implementation is PiCorePlayer. I've tried PiCorePlayer in the past and as a genuine Linux geek I always poo-poo'd it because it was too easy. However try installing Jivelite on a Raspberry Pi with one USB port sometime. I dare ya.


Anyway I was helping someone work through my Jivelite web page on their installation and the guy working through it pointed out some information that was no longer relevant as some repositories have been archived and some links moved which in turn caused him to seek some assistance. I found the newer repositories, fixed my web page and got a passing interest back in Jivelite again. In fact I had a Raspberry Pi 3 with a Raspberry Pi Official Touch Screen that wasn't doing anything so I thought I'd put Jivelite on it and make another audio player. (Yeah, like I need another audio player).


Here's a quick parts list for this project with links. The USB DAC is way optional and you probably have a micro SD card and phone charger laying around. Make sure it is at least 1 amp output. 2 is way better.


Parts

Cost

Raspberry Pi 3

$35.70

Touch Screen

$72.50

SD Card

$7.08

USB DAC (opt)

$59.00 *

Power Supply

$6.30





And then I remembered that PiCorePlayer had a Jivelite implementation and I decided to try it. First of all you download PiCorePlayer and burn it to an SD card. I do it like so on my Mac.


diskutil list


That then tells my inserted SD card in my Mac is /dev/disk2. This is where you had better be sure because the next command can destroy your hard drive. In fact the dd command is called Disk Destroyer. Got it? Good.

Then you tell the image file where to write to. It's a matter of if and of. And you need to make sure your file path is right. Mine lands in my Downloads folder.


sudo dd if=/Users/john/Downloads/piCorePlayer3.02.img of=/dev/rdisk2 bs=1m




Literally takes a minute or so to write to the disk. Then just drop it in your raspberry pi, make sure there is a touch screen attached, and boot. The screen then tells you what the IP address is. Take that IP address and type it in a browser (my examples here are post install, yours will look a bit different).




Now if you want Jivelite scroll to the very bottom of the page (not shown above) and click on the Advanced tab.




Now set up Squeezelite on the "Squeezelite Settings" tab on the top.



You can use "Default" settings but I plugged in a USB DAC so you can see I chose "front:CARD=DAC,DEV=0


That's the one for my DAC, your mileage may vary. It'll be listed if it is compatible.


Now go to the "LMS" tab at the top. More than likely when you try to enable it it will tell you there isn't enough space on the SD card and ask you if you want to resize the SD card. YES. Do it, reboot and then enable LogitechMediaServer by the oh so hard process of clicking the radio button.




Now go to the "Tweaks" tab on top and enable Jivelite by clicking the drop down for enable and click "Save". It auto downloads, reboots and BANG you have Jivelite installed and running.



Now after that reboot take your IP address you access PiCorePlayer with and add a colon 9000 to the end (i.e. 192.168.1.1:9000)


That is your LMS server which you need to log into and add your login credentials to any pay services you have like Spotify or Pandora or Tidal.




That's it! Easy money. You just made a Touch Screen Audio device that streams from LMS. PiCorePlayer DOES SO MUCH MORE. You can make it an AirPlay (shairport) server which means you can stream iTunes music to it, you can add a USB drive of locally stored music and play that, etc. PiCorePlayer is awesome. I only scratched the surface here.


Here's what it looks like when you are done.



How cool is that?



NAS Software ***BEST*** Of 2016

Now that I have built up 5 server devices and tried a bunch of NAS Operating Systems I'm prepared to make my call on which one is "BEST". First a rundown of the OS's I tested.



Each one has its merits however factoring in all my needs I'm prepared to call a particular OS ***BEST*** for my home server needs. It wasn't easy, and even though I'm calling one ***BEST*** I still plan on using some of the others. But if I only had the budget to build one dream server I think I'd have to install ........................


UBUNTU SERVER


It simply suits my needs the best. Let's briefly define my needs or my idea of a good server platform for home. I am NOT an enterprise user nor am I running a network for anyone other than family.


  • It needs to be a web server with the ability to run the latest Apache2, Nginx, and PHP and be able to keep them all up to date.
  • It needs to be a cloud server. I work primarily in the field. I need to reach back at some files sometimes, especially if I'm in the field with my iPad.
  • It needs to be a media server. TV, locally stored movies from ripped DVD's, and a LogitechMediaServer for music.
  • It needs to be accessed and controlled via a web browser.
  • It needs to have RAID storage.


My software lineup would be as follows:

  • SAMBA for simple file sharing. All the OS's listed above do this well.
  • Seafile for cloud storage


  • Webmin for server control via a web browser



  • Emby for a media server



  • Plex - Also for a media server. What Emby doesn't do, Plex does and vice versa.


  • LogitechMediaServer - I have 5 TB of music and constantly stream from Spotify and listen to Talk Radio from TuneIn Radio while cooking. I have to have a music media server. LMS is the best platform for me. Others have flash and pinash but I like LMS.



Without a doubt Linux is easily up to all those tasks. Now lets discuss the pros and cons of each OS and how I came to my conclusion.


FreeNAS - The gold standard of NAS Operating Systems. Designed for enterprise use. Probably the most highly recommended by power users and geeks worldwide. I am running FreeNAS on my super-server at home. Where I find it lacking is that while it has plugins for Emby and Plex they are problematic. I had to manually install Plex for DVR support for my HDHomerun device and installing it manually wasn't easy and I'm not sure what you do to upgrade it at this point. Emby's plugin kept crashing so I had to install it, turn it off and then load the latest PBI (whatever that is) and now it works fine. You cannot install Seafile at all on FreeNAS, or at least I can't.


NAS4Free - Not even going to discuss it. Tried it, didn't like it.


OpenMediaVault - Basically this is Debian Linux with its own web GUI control. It's very nice, very polished and it will do all the tasks I outlined above although some of it would have to occur outside of the OMV web GUI. For example I wanted to install LogitechMediaServer but I installed the beta version of OMV which doesn't yet support it, blah, blah, blah. So I just installed it like I would on a Linux computer and it works silently but not under control of the web GUI. Same with Seafile.


Rockstor - Seems to be in direct competition for FreeNAS for enterprise level NAS stuff. Really neat and really polished NAS however it is another one where you are seemingly tied to whatever is in the plug-ins directory which Rockstor calls Rock-On's, which I guess is cool.


Debian - I'm very familiar with Debian as I am a Raspberry Pi geek and the OS of choice with the Raspberry Pi is Raspbian which is Debian Jesse (previously Debian Wheezy). So for sheer usability for me it seems like a no brainer. But if you get the minimal install of Debian it uses the 3.16 version kernel (which is rock solid) but doesn't support one of my TV Tuners. But for only this item Debian would probably get the nod from me as ***BEST***. Actually there is one more thing. The minimal install of Debian adds a desktop environment and boots into it. I neither need that or want that. My server will be headless with no monitor keyboard or mouse. I don't need all that.


Ubuntu Server - No Desktop Environment installed during setup and does every single thing I listed above for my needs, web server, cloud server, mysql database......it can run all the media servers, and especially LogitechMediaServer. Ubuntu is tried and true, runs kernel 4.4 and has long term support (LTS) versions. I'm currently running 16.04 LTS. I'm good for several more years. They just came out with 16.10 but it is only supported for 9 months or so. It's for the bleeding edge guys. I want stability and security.

What you don't get with Ubuntu is those enterprise level file systems like ZFS. FreeNAS, and NAS4Free support ZFS which is the enterprise standard. Rockstor uses BTRFS file system which is gaining favor with the uber geeks as well. Ubuntu server nets you the good old ext4 file system (for now). I actually think there are implementation for ZFS for Linux but I'm not prepared to be a guinea pig with my data. I've been using Linux and EXT4 file system for many, many years and I can't recall having file system / file sharing issues EVER. No reason to stop now. I might change my mind about having an error correcting file system if I was an IT guy with multiple, multiple users all higher ranking than me and ugly angry all the time. But I'm the boss here.


The last point I want to drive home is that if you have FreeNAS, Rockstor, or OpenMediaVault you are kind of sort of tied to what plug-ins are available in their respective libraries. As stated above not all platforms have all the software solutions that I like. If you run a Linux server you can have whatever it is that you want. Seemingly no restrictions, just you don't get the Uber file system support.


Now here's something else to think about. Suppose my web server, music server, media server, and cloud server are all on one device and it dies..................Yikes. Here's how I deal with this. Super server which runs FreeNAS has Plex, Emby and Samba.


My OTHER server (which has considerably less CPU power) runs Ubuntu and runs my web server, Plex, Emby, Seafile, and Logitechmediaserver. I have some redundancy with my ripped content for TV and Movies and file serving. So basically I run two servers at home so if disaster hits I don't go down completely.


My pick again for best, most flexible home server.................


Ubuntu Server.

Over The Air Broadcast TV

Some time back I did the math and decided that full blown cable or satellite TV just wasn't worth it. High speed internet, Hulu, Netflix, and Sling are still way cheaper per year than cable TV. Also if there is that one or two shows that you can't live without in this day and age you can buy them on Amazon Prime or Apple TV and it is still cheaper than a year of cable TV.


Of course now that broadcast, over the air television is transmitted in digital you can improve your content simply by sticking an antenna up. I've run the gamut of indoor amplified antennas and suffice to say I'm in a poor region for broadcast TV. I can typically get 7 or so channels at my home, 6 of which are mostly worthless. So I opted to get a Mohu Sky 60 Antenna to stick in my attic.


Right away I got a slew of channels including the two major players I needed. Fox and CBS (FOOTBALL!)


Although they claim the Mohu Sky 60 is omni-directional it is very much a directional antenna. and unfortunately for me positioning it to get great reception on CBS screws up Fox. Still I'm convinced there is a magic location that will pull it all in with ease. I know it is there, because I've found it several times however when I mount the antenna the magic spot loses its magic. The Mohu Sky 60 also comes with a preamplifier WHICH IS WORTHLESS. The antenna performs better in every respect without it (in my application).


The neighborhood I live in forbids antennas outside but several people have them. I may just need to mount the Mohu outside. It's not very obtrusive looking and has a sleek, low profile appearance. If dozens of neighbors can have satellite dishes then I'm not seeing a problem here.


To make my over the air TV broadcasts more accessible I've also bought an HDHomerun Connect streaming device.


This device is basically a TV Tuner that connects to your home network via ethernet (I know what you are thinking, but you wouldn't want wireless for this application). Then using either the HDHomerun software or any number of Open Source programs or servers you can stream digital TV to all your devices. What does that mean in layman's terms? FOOTBALL IN BED!


I have an Ubuntu Home Server I built which uses a program called Emby. Emby is basically a media server however it detects the HDHomerun Connect and logging into Emby via web browser you can view all the different channels via web browser. Now you can google up a local TV guide and then stream the channel however if you want a continually updated guide within Emby you need to pony up a few bucks to a service called Schedules Direct. They give you a week free so you can decide if it worth it or not. It is to me, however like I said you can readily view your local TV stations and then just click the channel to view. It isn't even hard but it is one more step.


Maybe the best thing about this setup is that the HDHomerun Connect is basically a DVR. You can record, time shift, whatever. Like to watch Two Broke Girls? ( I don't, just an example). Tell Emby to record it and every time it comes on (it gets this info from the guide) it'll record and save it. That's worth the price of admission right there.


Here's what it looks like:




Pretty cool, huh?


Some observations:


  • Emby needs quite a bit of power to transcode and stream the video. I generally set my stream at 1080p and 4MBPS.
  • Chrome browser works BEST for some reason. Everything else is more prone to choking.
  • Great reception channels perform BRILLIANTLY.
  • Poor reception channels freeze.
  • Huge increase to my viewable content which is FREE (after you factor in the cost of antennas, HDHomerun device, guide subscription, network cables and about a thousand man hours of antenna positioning)
  • Emby doesn't work worth a hoot under my much more powerful server which runs FreeNAS. Works great under Ubuntu Linux.
  • Plex Media Server has a DVR Beta program which RECORDS only. While that is pretty cool you can't just stream the content and it requires a PLEX PASS subscription.
  • When Emby and your browser choke open your HDHomerun_config_GUI program and manually input your channel and click view. It opens VLC media player and this seems to work FLAWLESSLY. The downside is that you have to know the actual channel number and input it. In this instance CBS channel 9 is actually broadcast channel 10. Not at all confusing. Another channel of mine, 14 is actually broadcast channel 47. Intuitive!


Also the config program shows signal strength, signal quality, and symbol quality. This is a MUST for positioning your antenna. i took my laptop up in the attic and played with the antenna positioning until I got the best spread of channels. Getting CBS and Fox somewhat reliably cost me about 6 or 7 other channels. I think one was "The Pot Holder Channel", and another was "The Meerkat Evolution Channel". Not really a problem for me to not get these. That of course is an exaggeration.


In the end I was STILL having minor glitches and pixelating with CBS and Fox from Greenville NC. To solve the problem once and for all I discarded the crap amplifier with the Mohu Sky antenna and went to RadioShack and bought a 33 dB high gain signal amplifier.



Now lets look at what we have. I depicted broadcast channel 47 which is virtual channels 14.1 and 14.2 here locally (Fox). Look at the difference. From 58, 53, and 100 to 85, 73, and 100. Much improved. Also before Signal quality would fluctuate and drop into the red thereby losing Symbol Quality which equals pixels, drops, freezes. No More! Good stable signals throughout.



Here's my lineup. Not bad for this region.



I had pulled all my "telephone" CAT 5E wires in from outside the home in the cable box to inside the garage and connected them to a 6 port wall plate. On the other end of the wire everything was hooked to phone jacks. I replaced those with gigabit ethernet female connectors, thereby wiring the whole house with high speed ethernet.


Mounted a network switch on the wall next to it and my HDHomeRun Connect next to that. Then dropped an antenna cable down from the attic and then ran ethernet from the living room to the garage by drilling a small hole in the baseboards. I was going to put in wall plates but the wires running out to the garage would be much less conspicuous. Turned out to be a fairly elegant solution to getting gigabit ethernet into the home.



If nothing else it was a cool project that took some time, some effort, some server configuration and that folks is what John is all about. Wasting time. Anyway, now John can watch football.

Seafile - A Dropbox Replacement

One of the joys of having your own server is the ability to run your own Cloud Server. Everything exists in the mysterious Cloud however I can assure you the Cloud is quite landlocked somewhere in a little box plugged in the wall. In this case it is in your own home, or Hillary Clinton's bathroom closet. Gotta put it somewhere where you can like wipe it with a cloth from time to time.


Everybody seem to install OwnCloud and OwnCloud is pretty cool but I JUST DON'T LIKE IT. I've dabbled with it for years and it just does too much and it does all that not very securely, in my mind. Your mileage may vary. So I have to figure that in Linux there are all manner of Cloud Server platforms and a simple Google search confirmed I was right. These are but a few of the options out there.

  • OwnCloud
  • Seafile
  • Pydio
  • git-annex
  • BTSync


Always hovering on every list just about that you look at is one called Seafile that I decided to check out.

Seafile

Seafile installation is not for the faint of heart and does require SOME linux skills. They have a pretty good user manual which has bailed me out a few times but I find it to be a little disjointed. The information is all there, just sometimes not where you'd expect it to be. Here's what Seafile does for you though once you get it installed.

  • Cloud Server - Duh
  • Ability to sit "behind" Apache2 or Nginx web servers making it https accessible.
  • Desktop Client which stores files locally. You upload to the "Cloud" and it automagically updates your local storage.
  • Along those lines they are working on something called "Seafile Drive" which holds your files virtually on your desktop. What that means is you get the list and then download on demand. In this day and age of small devices and inexpensive laptops with small drives that's great to hear. However, in this day and age where there are still places with crappy cell phone service, data limits, dead spots, etc..........that may not always be the way to go. It is available now for Windows only with Mac and Linux clients promised in the near future.


Again installation is kind of weird, but easy. You download the program in a tar.gz format, unzip it and basically it is installed. However you then need to configure the Apache2 000-default.conf file or for Nginx browser create a seafile.conf file in the /etc/nginx/sites-available directory. And trust me when I say I'm oversimplifying here.


Then you have to configure a couple files in Seafile itself (ccnet.conf and seahub_settings.py) then manually start the program. Once you're good and sick of manually starting the program you can configure systemd to start it at boot.


Again ALL THIS STUFF IS IN THEIR USER MANUAL. Ultimately you just follow along and cut and paste. Installing their program is not so hard but I had a little trouble with my NAT firewall. Seafile running as http needs ports 8000 and 8082 open and running as https needs only port 443. When configured as http I had a problem where my ISP blocks http port 80 where every web server is installed by default. There are easy ways around that but I'm not going into it here. Suffice to say you can configure it in http or https either way. I went with https.


Okay so now I have it installed and configured and now pointing to my website. And I have installed the Desktop client for Mac Lets take a peek.


Hysterical guy that I am I customized their logo (also in the manual) and made mine say "Hagenserver" HA! Seafile has libraries where you upload your Cloud data. I named my library the Library of Johngress. Double HA! Any library you make can be password encrypted as well. So so far we have Seafile existing on an https web site, with a secure login and now we have a secure library. With the client software installed on Mac you add a folder called Seafile to your user directory and then can see it in the Finder window as in the red circle below. If I add a file here anywhere via the browser of just drop it in the finder window it syncs. If you have Seafile on another computer it will sync there too.




This is a true Dropbox replacement and behaves very similar to Dropbox on the Mac platform. BUT IT IS UNDER MY TOTAL CONTROL. I have no real idea what Dropbox is doing to my stuff. Maybe they sell it to Julian Assange, I don't know.


So anyway that is a very very brief review of Seafile. The salient points are here:

PROS

  1. The Community Edition is Open Source and FREE
  2. The Pro Version is FREE for up to 3 users. That is what I am running.
  3. Seafile works like Dropbox.
  4. Seafile is fast and syncing is quite fast
  5. Stable. Haven't had a hiccup yet.
  6. Configurable. Slap your logo on it, among other things.
  7. Easy to update via script
  8. Security. I'm no security pro but an endorsement from Kaspersky Lab on their page is good enough for me. I believe they are the gold standard in security and if they use it then its probably good enough for me.

CONS

  1. An unusual installation routine which won't start at boot (unless you manually create systemd processes or script files)
  2. Information scattered about the manual. For example if they covered a configuration point in the Community Edition and you were working with Pro the manual doesn't say "to do this or that" it just kind of assumes you know to do it because they mentioned it in the Community Edition part. Another thing I noticed was they say "Change the path of the logo file in seahub_settings.py........that line isn't in a default installation to begin with. They should say "Add the following line to seahub_settings.py........"
  3. Firewall documentation is accurate but sparse. In their defense there a million different firewall or router firewall implementations. Hey, if you're running a Cloud Server on a Server appliance you probably should know something about firewalls.


In conclusion. If you've ever wanted to run your own Cloud server similar to Dropbox AND enhance your mad Linux skills then Seafile is for you. For any limitation I may have mentioned, it is well worth the trouble and is very, very cool. Highly recommended.



Installing a New Hard Drive in Ubuntu Server for the Home Partition

I recently installed Ubuntu Server 16.04 on a home brew appliance with a 275 GB SSD hard drive. After it was all said and done I realized that wasn't a lot of room for file storage. So I picked up a 2TB drive and moved the servers /home partition to the new drive.

This blog quickly describes how to it in case I destroy my server and need to do it again someday. It's best if you can somehow format the drive for one partition to ext4 first. If not, well we'll cover that too. First of all physically install the device and boot and ssh into your UbuntuServer. Once in type:

sudo blkid


This will give you the UUID of your devices or at least give you their /dev name if it isn't formatted yet. I found out that my hard drives were as follows:

275 GB SSD = /dev/sda

New 2TB drive = /dev/sdb


Now lets make a partition and format:


sudo fdisk /dev/sdb (because that's the new drive, format the wrong one and bye-bye operating system).




Now type in the letter "n" (without the quote marks) and simply follow all the defaults. P for primary partition, 1 for first partition, accept the defaults for the first and last block then when you are done make sure and type "w" to write the changes. Now that you have a partition. let's format it.


sudo mkfs -t ext4 /dev/sdb1


Now after that completes do another blkid Copy the highlighted part after UUID between the quotation marks.





Make a copy of your fstab file that you are about to alter


sudo cp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)


Now do:


sudo nano /etc/fstab


Now add the following to the file


UUID=thatlongnumberyoucopiedbefore /media/home ext4 defaults 0 2


hit CTL + x then yes to save


Now make a directory to mount and then mount your filesystems


sudo mkdir /media/home


sudo mount -a


Now copy your current /home directory to the new drive



sudo rsync -aXS --exclude='/*/.gvfs' /home/. /media/home/.


Once it has copied go back to your fstab file and then remove the /media in front of /media/home


sudo nano /etc/fstab



UUID=thatlongnumberyoucopiedbefore /home ext4 defaults 0 2


Now remount


sudo mount -a


And Bob is yer Uncle. You did it. Your home partition is now on a much, much larger drive.









Ubuntu Server

After much internal strife and debate with myself I opted to install Ubuntu Server on my headless server made from spare parts. There are a couple reasons for this. In EMBY media server which I want to install there is an option for a TV Tuner. My Hauppage 995Q USB Tuner only works on Linux Kernel 4.1 or higher or with a patched kernel. Debian server is based on 3.16 and I didn't want to patch, nor upgrade the kernel. Ubuntu server runs 4.40. Were it not for this I would stick with the ease and stability of Debian. Also the Debian minimal network install adds a graphical interface. Yeah you can disable it and change the boot level.......but why? No good reason.


Get

Ubuntu 16.04.1 LTS (Xenial Xerus)

from here.


I went with the server version with no graphical interface. After determining that my USB installation stick was /dev/disk2 (don't foul this up) I issued the following command in mac to make the USB stick an Ubuntu installer then set the BIOS on the computer to boot from USB first.


sudo dd if=/Users/john/Downloads/ubuntu-16.04.1-server-amd64.iso of=/dev/rdisk2 bs=1m


While going through the install when it asks you what to items to install at a minimum select OPENSSH SERVER because without a graphical interface you have to be able to SSH into your box via your local network or you are tied for a while to a keyboard, monitor, and mouse until you can fix it.


I also chose DNS SERVER, SAMBA and LAMP SERVER. SAMBA is a file server and the LAMP SERVER is your web server and database (mysql). You may not think you need a database server but if you install a Cloud server, as I have below, it also uses mysql. Just install it.


Now once you ssh in for the first time (make sure and use YOUR IP ADDRESS and YOUR USER NAME)


ssh 192.168.1.1 -l john (make sure to use the user name you set up during the installer routine)

password: thepasswordyousetupduringinstall


Now make sure your installation is updated.


sudo apt-get update

sudo apt-get dist-upgrade


Once we're all upgraded lets get a static IP address so we aren't always looking for it. Open /etc/network/interfaces and make it look like the pic below. Make sure the last two octets that I have covered match your network (i.e. 192.168.1.1)


sudo nano /etc/network/interfaces




If you selected your LAMP Server you are already running a web server and you have just built a server! Hurray! You can test it by typing the IP address of your server into a browser. You should see the Apache2 test page if all went well.




Now if you want to be slick and have a graphical interface to control from a browser you'll want to install webmin. Follow the directions here. Basically the directions are this:


sudo nano /etc/apt/sources.list


Copy these lines in (then after editing hit CTL + X key and yes to save):


deb http://webmin.mirror.somersettechsolutions.co.uk/r... sarge contrib


Add the keys:


sudo apt-key add jcameron-key.asc


Install:


apt-get update

apt-get install webmin -y



When you log in webmin it will look like this (To log in type your server IP address into a browser bar with port 10000 i.e. 192.168.1.1:10000):






Now you don't have to be a command line hero. You can run almost every aspect of your server from this graphical interface.


SAMBA file sharing is easy. If you selected it then it is already installed. I just add my user from the command line.


sudo pdbedit -a john


Then type and repeat your password. Now go in webmin and set up a share. Yeah you can do it via command line and editing the smb.conf file but hey, we've got webmin, why not use it? I created a new directory in my home directory by typing:


mkdir ubuntuserver


Then went in webmin under Servers > Samba Servers and then created a new file share. Make sure the user and group is your login name. In my case both are "john". Also make sure to click the radio button to make the share writeable.


Scroll to the bottom of the page (not shown here) and click the restart samba button.




If you did it right you should see this:




Another cool aspect of having your own server is running a Cloud Server like Dropbox. Somewhere along the line you know someone is looking at your files to see if there is anything earth shattering there. Not so if you run your own Cloud Server. The defacto standard seems to be OwnCloud however it is not my defacto standard. I've never been a huge fan. There is too much going on in Owncloud. I found a Cloud Server that just serves files and has good security. Seafile. Seafile is a little geeky to install but I found the sea file manual which is great. Just go slow and follow the guide step by step and it works perfectly. The manual page is here. If you get it right this is what it looks like.



Now you're running your own Cloud server. How cool is that?


And while the server is just sitting there I downloaded and installed the latest Logitechmediaserver on to it so my clients can stream Spotify, Pandora, TuneIn, and Shoutcast. I can add locally stored music as well, I just haven't done it yet. I have an old TV I made into a Google calendar project for the kitchen and no reason for the TV speakers to go to waste. I use them to listen to Talk Radio while I'm cooking. My server might as well be a streaming music server too. Just one more cool capability this appliance has.



I'm really beginning to love the whole concept of this home server implementation. I should have done this years ago.

Parts! Parts! Too Many Parts!

Out of the current fiasco of building file servers I had one bad motherboard, however I wasn't sure at the time if it was the board or the CPU and because they were budget items I just bought new ones so I could complete the build in the interest of time. Turned out the mainboard was bad and I sent it back for an RMA and just received it back.


So now I have enough parts to build YET ANOTHER COMPUTER. I have no earthly idea what I'm going to do with this box but that's not going to stop the likes of me! The only thing I was lacking was a case. And since the motherboard I have can be powered from a 19v laptop brick and I have a big passive cooler that means this box can be silent. So I started looking for a box with some ventilation and came up with the Thermaltake Core V1. This case has almost as many holes in it as what is in my head or my wallet right now.




Here's the prospective build and bear in mind I already have most of this junk laying around. This is what it would entail if you bought into it cold. You could save some bucks by just putting in 8GB of RAM or getting a cheaper SSD or mechanical hard drive.




Parts

Links

Cost

Quantity

Motherboard

Asrock AM1H-ITX

$48.99

1

CPU

Athlon 5350

$42.99

1

Memory

Crucial DDR3 16GB

$63.99

1

Case

ThermalTake V1

$49.99

1

Hard Drive

SSD Crucial MX300

$72.99

1


Anyway for about $200 - $300 you can have a fairly impressive little rig. I wouldn't try to take it to a FRAG party or try for "Best In Show" at the gaming rig convention but for most folks this is still a lot of computer. Enough certainly to run a web or mail server. You could certainly build a file server as well but the ThermalTake Core V1 case isn't really suited well to that. Still you could cram two big hard drives in there and boot from a USB stick, so yeah, technically it could be a file server too.


After thinking about it a bit I think I'll make a web server out of it and maybe just run a tiny server off of it at home. My ISP forbids that but let old John clue you in on some stuff. What they don't know won't hurt them. Besides this server will have almost no traffic, and that's what they don't want. Is you using all their bandwidth without paying the business cost for it. I'll use my server to build and test web pages at home and then deploy them to my web host. Work out all the kinks first. While it's laying around it can be a LogitechMediaServer for streaming music as well, or some more network attached storage. Or I can hang my 3D Printer off of it. I'll find some other job for it to do to keep it practical as well.


I was partly inspired by this article in Linux Format Magazine.



So as in the article I'll use Debian Linux for this. That was the link to the small network image. No reason to install desktop software here. This computer will run without a monitor keyboard or mouse. I'll enable ssh and control it from my laptop. That's what real geeks do.


Now I need a domain name. You can get free domain names from a variety of places but they are always like johnlikesducksalot@ebola.com Not being sure exactly what the master plan is here I just ponied up the $10 from NameCheap.com for johnhagensieker.com Not very inventive, I know.


On Linux you will need a program called ddclient to make sure you can always find johnhagensieker.com on the internet even with your ISP changes your IP address.

Go to Advanced DNS under your NameCheap account for the website in question and scroll to the Dynamic DNS section and copy your password.



ddclient will have a ddclient.conf file that I won't go into much detail here with but you fill it in with directions from here:




Now your web host blocks you from running a server which really means they block port 80 on your IP address. So here's what you do. Change your default port from 80 to say.......2100 in /etc/apache2/ports.conf file depending on what version of apache web server you are using. Once you restart your web server to then get to your website you would need to type

johnhagensieker.com:2100

Nobody wants to do that, not even you so then you go back to Advanced DNS in NameCheap and set up a redirect. Anyone that types in johnhagensieker.com get invisibly sent to johnhagensieker.com:2100 Cool, huh? Make sure the Type is URL Redirect Record and it is set to "Masked" That way no one sees the actual port number.





The build went really well and the case has tons of room and the cabling from the case is exquisite. The motherboard mounts on top and the power supply mounts on the bottom. The problem with that is that this build doesn't need a power supply. The AM1H-ITX motherboard can be powered by a 19v laptop power brick. There's even a ton of room in here and I was able to add a passive cooler. The Alpine M1.




I had a couple minor problems that my 3D printer had to solve for me. I added a 2.5" SSD and as you can see in the picture above there are two vertical trays for 3.5" hard drives. So I printed up an adapter.




Then because there is no power supply there is a huge hole in the back of the case where the ATX power supply goes. So I went to Thingverse.com and found an ATX power supply cover which fit perfectly. The series of 3 photos below depicts.






So then it was just a matter of installing Debian and configuring the web server, Emby-Server, and Webmin, which is a web page based configuration utility. Very handy for controlling your server without a keyboard, mouse, or monitor. Headless. That's how geeks do it.






I have installed by haven't configured the Emby media server yet but I did configure my web server. Haven't put a site up yet but I did get the Apache2 test page which means it works!





I did it. A rock solid stable Linux server ready to deploy. Very low price, and only took a couple of hours to configure and that was me fooling around. Pick up a that copy of Linux Format and build one for yourself!





NAS Software

Now that I have a couple of home made file servers it's time to play around with some NAS software. While this is far from a comprehensive run down, just more like a quick assessment of the OS and the GUI that it operates on. The NAS programs are mostly designed to boot without a keyboard monitor or mouse and be managed from a web based browser window.


Also for the most part the free solutions are based on FreeBSD Unix or Linux which are two platforms I have played around with over the years. FreeBSD has a reputation for being rock solid stable and lightning fast. Linux of course is the backbone of many, many a server and while you may run Windows or Mac at home the internet is built and ran off of FreeBSD and Linux.


Following your selection of basic OS then your next basic consideration is what kind of file system do you want to operate? The FreeBSD solutions can use (and some Linux solutions too) the ZFS file system. ZFS file systems are used in enterprise level equipment due to their stability and error checking and self repair capability. Although very reliable, the caveat with this is it requires a little more knowledge to operate and maintain. Enterprise level protection requires an enterprise level technician. That being said anyone can do it and if you can build your own file server you probably have the skills to put in the time to read the documentation and learn the file systems and how to take care of them.


Another popular file system is BTRFS which has similar attributes. Yet another file system is the simple Linux ext4 file system which doesn't have all those fancy bells and whistles but has been around for years and is quite stable. If all you are doing is using your file server to back up your files maybe a simple Linux distribution with ext4 is just what the doctor ordered.


So now we've barely scratched the surface on OS's and file systems it's time to start looking at some of the various distributions out there. Rather than deploy them on the actual file server and muddle through them I like to take a quick look at them on a virtual machine. Generally I can get a good assessment of whether I like them or not in a matter of minutes and virtualization is the way to go. Also some of these offerings have Demo modes on their websites. You don't even need to install the OS on your own virtual machine, just play around with their demo mode to get a feel for the OS and see if it is something you feel comfortable with.


And like most things you need to have some basic idea of what your needs are. These are some of mine.


- Obviously the ability to serve files across the network

- The ability to run various media server services

- Stability and reliability

- Ease of operation


Okay. On to virtualization.....I use a program on my Mac called VirtualBox and while I won't get into the finer points of installation of each OS suffice to say about a million guides exist on the internet to install each one into a virtual environment. As you can see below I've installed OpenMediaVault, Rockstor, and NAS4Free.





Also in a real world environment I have installed FreeNAS and OpenMediaVault. There are quite a few other distributions but the 4 that I have listed here seem to rise to the top of most NAS software searches. Here's a super quick rundown of each.


FreeNAS - Most popular, most enterprise features. FreeBSD based. ZFS file system.



NAS4Free - A fork of FreeNAS, FreeBSD based. ZFS file system




Rockstor - CentOS based. BTRFS file system. REQUIRES PAYMENT FOR LATEST UPDATES (Boo)



OpenMediaVault - Debian Linux based. Ext4 file system support. Latest beta does not yet support AFP (Apple Time Machine) backups. Stable version does.





Now, how about my impressions.........?


Easiest to use - OpenMediaVault

Most powerful - FreeNAS

Slickest GUI interface - Rockstor

Best platform for add ons / plugins - OpenMediaVault (and FreeNAS)

Most reliable place to put your files - FreeNAS

Requires the most CPU and memory - FreeNAS

Works on older hardware best - OpenMediaVault

Worst user interface - NAS4Free

Costs money for latest subscription updates - Rockstor


My overall choice: FreeNAS for bleeding edge hardware, and OpenMediaVault for lower hardware requirements. I run both.


I like Rockstor and I like it a lot but the pay subscription thing to me is a deal breaker. That being said you DON'T have to pay it and you can still run Rockstor, you just won't get the latest updates. If I had a real enterprise solution reason to run Rockstor I'd pay the price. But I don't, I'm just a guy at home playing around with file and media servers.


I just couldn't get the hang of NAS4Free. I'm sure it's great but I wasn't comfortable under the hood. I found the GUI very confusing, especially trying to set up shares. Yes, I'm sure I could figure it out but I used it just long enough to realize I didn't like it and for running FreeBSD and ZFS file system.......well then I'll just run FreeNAS


OpenMediaVault was a breeze for me to set up and it is very intuitive but there is no easy way to save and restore your configuration. Also it isn't as friendly as far as running off an SSD or USB stick. It can be done but you need another plugin to reduce writes to the flash drive. No biggie but the documentation is slim on this one. I liked the feel of OpenMediaVault, adding plugins was a snap, and configuring things was easy. It has that familiar Debian Linux feel to it, even in their GUI representation. I'm at home here.

I was a little jealous that Rockstor seemed to have a Logitechmediaserver plugin enabled which is something I'm heavily invested in around my home. I have all manner of LMS and clients around the house for playing music. Then I remembered OpenMediaVault IS DEBIAN LINUX. Duh. Running these two commands in a shell fixed that real quick.


wget logitechmediaserver_7.9.0~1472937447_amd64.deb (the latest nightly as of this writing)

dpkg -i logitechmediaserver_7.9.0~1472937447_amd64.deb


And next thing you know I was staring at this........The login screen for LogitechMediaServer. I load some music up here on my file server and I can stream to anywhere.





FreeNAS is the king of all of them however the hardware requirements are more stringent. You need a decent CPU, you need ECC memory, you need to know how to manage a ZFS pool. The learning curve is steeper than OpenMediaVault but once you figure things out you realize you are running a real enterprise level file server and things just feel safer. Safe, stable, and secure is what all this is about anyway, right?

I think they all will work and each OS has a place for certain typed systems but if you barely can pronounce or spell the words "file server" I think OpenMediaServer is where you want to be.

The King Of All Home File Servers

Once I finally understood the ins and out of building an adequate home file and media server I figured I would step up my game and build a server which would last me several years.


Prior to your build you need to ask yourself exactly what your file server / media server goals are so you don't build too much. It's crazy to spend a ton of money and only store a few simple files on your server. A budget build may be more in order if that is that case. In this instance I'm going for broke. I want to run FreeNAS which needs lots of power, lots of memory especially if you intend to run media servers and jails. I will be running Plex Media Server here and probably OwnCloud server.



MOTHERBOARD


The backbone of any system is the motherboard and while there are brand new, very impressive motherboards out there you should consider some other factors besides speed. One is lower power draw (wattage), especially if your server is on 24/7. All factors considered I reached back to a very popular motherboard that made it's first appearance in 2013. 3 years is a long time in technology however this motherboard still has what it takes. An Intel Atom 2750 - 2.4Ghz EIGHT core chip that sips power and keeps your total cost of ownership down. Also there are a LOT of SATA connectors on this board.


The CPU is built in here and while the motherboard seems pricey try looking for a brand new top of the line mobo and the Intel server chips of today that you lust after. This is a fraction of that price.




MEMORY


16 GB of Kingston ECC DDR3 RAM here. I probably should put 32 GB of RAM in here but I'm going to try 16 first and see what happens. FreeNAS recommends 1 GB of RAM per TB of storage. Right now I'll be good. If you are going to use FreeNAS make sure and get ECC Ram. It costs a little more but provides much needed error checking.


HARD DRIVES


There really is no choice here. The best home server deserves the best, most dependable hard drives. These are arguably the Western Digital "Red" NAS drives. Also the largest expense in your system at $149 each. You can of course go smaller and go another brand to save a few dollars here if you want.





CASE AND POWER SUPPLY


While there are some great NAS cases out there arguably the most popular one is the DS380 from Silverstone. The cases take an SFX Form Factor Power supply and you'll want at least 450 watts for what I'm doing here. Less if you have fewer hard drives. More if you have every bay filled. I went with the "Bronze" Silverstone ST45SF 450 watt power supply.




The DS380 case is well designed with several huge fans and a removable, magnetic dust cover. That's pretty innovative if you ask me. There are 8 removable drive bays in this case.








This is a summary of the parts I ordered for my build. The board was a bit cheaper than in the link because I called the vendor and asked for a discount or coupon code and they gave me one. Here's to calling and checking on stuff! Also my power supply was $15 cheaper than the listed price below. I had a coupon code from NewEgg because something I ordered from them recently got lost. When I got on their chat to complain their agent cut me off cold. I emailed them and complained and they offered up a $15 off coupon. So my total cost was just a little bit less than listed below but every little bit helps. I forgot to add my boot drives to the fancy table. FreeNAS recommends using a flash USB drive as boot drive. I opted for the SanDisk Cruzer Fit 16GB. The OS needs about 8 GB and the Cruzer Fit is a very low profile drive which I like. No danger of a big drive sticking out and getting bent or snapped off.





Here's the build list sans the $6 USB drive.


Parts

Links

Cost (per unit)

Quantity (ea.)

Motherboard

Asrock C2750D4I

$350.72

1

Memory

Kingston DDR3 8GB

$46.49

2

Hard Drives

WD Red 4TB

$147.83

4

Case

Silverstone DS380

$149.99

1

Power Supply

Silverstone ST45SF

$74.99

1


Ok I've just completed the build.








Here's some rough impressions. The case is great! The fans are whisper quiet. Based on some reviews I read about the case I put the fan of the power supply pointing up to keep internal temps down.


One thing I don't like is that you can see in my last picture there are 2 USB 3.0 ports on the front but the C2750D4i has no corresponding USB connector on the motherboard so they can't be utilized. Seems a waste. In fact the whole motherboard only has 2 USB 2.0 connectors. If I run redundant USB flash drives for boot drives which I will that leaves no available USB slots. There is an open PCI-e connector though which you could add some USB ports to. I think I'll probably go that route.


Another thing I had some trouble with getting the system to boot from a brand new USB flash drive straight out of the plastic. I then put the flash drive in my mac and erased it, then put a FAT file system on it with Master Boot Record. Then after the next attempted install it worked perfectly. I used the San Disk Cruzer Fit 16 GB which is highly recommended on some of the better build blogs.


It's was a good fun build and it is performing as expected. As usual I won't just deploy all my files on here at once. I'll wait a week or so and make sure it remains stable and trouble free before I add my critical files to it. I did set up a Windows CIFS/SMB share (freenas) and an Apple AFP file system (Time Machine) and started my Time Machine backups. So far so good!







A Tale Of Two Servers

Well, I built my first file server which you can read about here. So in true Obsessive Compulsive fashion I decided to build another one. I waffled between building the baddest server in the land or an even more budget build than what I have now. I really wanted to build the best but I decided that this server was going to be a back up server for work. Nothing fancy. Just work files. So I opted for the budget build.


While I kind of built my last server around the needs of the FreeNAS Operating System. FreeNAS needs a little more CPU, a little more memory, a specific kind of memory, and it all generally costs a bit more. If you just want to serve up your work files you don't need nearly as much OOOMPPH or even in my case nearly as much hard drive space.


After much research I opted on building a system around OpenMediaVault. OMV benchmarks really well, doesn't have all the enterprise extras that FreeNAS does but I just don't need them. I decided finally one of the best budget build platforms to build off of is an Asrock AM1H-ITX.



This takes an inexpensive but very good quad core AMD chip. The chip I chose was the Athlon 5350, 2.05Ghz, Quad core chip.





Add 16GB of inexpensive DDR3 12800 RAM and a couple of hard drives and you have a server.


Even better you can save money on the build by buying a case with no power supply as the motherboard operates on 19VDC input power. That's basically an old laptop brick. Wow. That's a good savings if you decide to go that way. I went with a Will Jaya 2 bay case. Again you can get a case with no power supply. And I've limited my upgrade options here with just a 2 bay appliance but, hey, this is a budget build remember?


Total cost here is just under $400 and my actual cost was $340 because I already had some memory laying around. I went with 2 inexpensive 2TB disks. This may also have been a mistake however this is about budget and filling my need at work which is way less than 1TB in size. I'm building specifically to my needs. Your mileage may vary.


This rig probably won't run FreeNAS but it probably will run NAS4Free and again in my case it will run OpenMediaVault nicely.


Here's the build. The WillJaya case is just too small however it does fit but it does take some great care and wire management. It would be easy to jam the fans up. Also the stock fan on the CPU is too tall for installation in this case. I had to buy a low profile Gelid Solutions AM1 fan so it would all fit.





Also you need to make sure you add the clear plastic insulator on the back of the motherboard.





And finally here's what the whole thing looks like completed. Very attractive case. I still have the plastic film on it. I'll remove it when I get it to my office.




Total Crying Bill



PART

Nomenclature

COST

Motherboard

AsRock AM1H-ITX

$48.99

CPU

Athlon 5350

$42.99

Memory

8GB Patriot DDR3

$34.99 ea. (2)

Fan

Gelid Solutions Fan

$15.99

Hard Drives

Hitachi Refurbished 2TB

$49.99

Case

WillJaya 2 Bay NAS Case

$149.99



Finally here is the OpenMediaVault Interface. I have it configured as a 2TB mirror with two 2TB disks. Also using it for a Plex Media Server.








Network Attached Storage Project

I've always needed a network file server but now more than ever. But network file servers are expensive. So I decided to see if I could build one and save a few dollars.



Here's a list of materials


- Lenovo TS140 with 16GB of RAM (cost $342)

- Western Digital 4TB Red NAS Hard Drives (cost $147 ea.) (3 ea.)

- SATA cables (cost $3.61 ea.) (3 ea.)

- SSD Hard Drive 60GB Silicon Power (cost $29.99) optional, the OS can be installed on USB Thumb Drives

- SanDisk Cruzer Fit USB Drive (cost $14.49 for 2 ea.) Use 2 for a redundant Operating System. Using a USB drives saves room for one more hard drive for storage.

- FreeNAS (cost FREE)


Pros

- Inexpensive platform on which to build a home file server.

- Whisper quiet and attractive. Well constructed case.

- 5 SATA connectors

- Easy to assemble and upgrade

-Space for more RAM if needed


Cons

- Large tower, not suitable for sitting on entertainment center

- Only room for 4 to 5 hard drives

- SATA connectors are SATA III 3GB

- Motherboard did not come with latest firmware installed. Must make bootable USB DOS disk to upgrade firmware.

- Had to change boot order in BIOS after installation of OS to allow FreeNAS to boot. (This would probably happen on any new DIY install).

- Comes with a DVD drive. That could be on your PROS list, but not on mine. Unnecessary for what I'm doing. I unplugged mine and swiped the SATA connector.


There are multiple NAS Operating Systems out there but FreeNAS is probably the standard. Some other options include:



- NAS4Free

- OpenMediaVault

- Amahi

- Rockstor


There are certainly several more options however those are probably the more popular ones. Depending on your needs any of the above may work just fine. In my instance I am just installing this as a network attached file server. I have no desire to serve media files or run extra services such as P2P, Cloud, or other torrent services. Just files. So almost certainly every single OS listed above will suit my needs.


Many like the ZFS file support of FreeNAS and NAS4Free, others swear by the BTRFS file system in Rockstor, and yet others swear by the speed and stability of Debian Linux which OpenMediaVault is based on.


It was a breeze to set up FreeNAS and to begin providing much needed network file storage space.






Where have all the Protocols gone?

Technology both excites me and frustrates me. Computer technology has some amazing and helpful innovations that provide blazing speed but it seems like we've become a cut and paste or drag and drop society with standards and protocols designed for the dumbest of our users.


For instance I have 2GB of data I want to move over a wireless network. Drag and drop, right? Estimated time remaining 35 minutes. Oh you gotta be kidding me? Doing that is using something called the SMB protocol. Not the best choice.


Whatever happened to File Transfer Protocol (FTP)? How about SecureFTP? Secure File Copy Protocol (SCP)? You can move files with WebDAV as well.

I just SFTP'd the same 2GB of data in under 3 minutes wirelessly.


What in the hell has happened? We have the technology but it's deployed for the dumbest person in the room.


Why haven't the fastest standards been employed with ease of use?


By the way the tool i used for this is an old old old program (still maintained and updated) called CyberDuck.



FreeNAS

Time to build some Network attached storage. Yes there are a lot of ways to back up but mostly I've been hanging a USB hard drive off a router and using that is certainly better than nothing but what happens if the drive breaks. You buy a new hard drive and start all over again which takes time provided you still have the original stuff that you wanted to back up in the first place.


Having a mirrored NAS means if one drive fails the other drive is mirrored and you just swap in a new drive. It costs a bit more but the amount of storage increases a lot not to mention the speed and the integrity of the backups. Still a good idea to use a USB hard drive and carry it to work for an off site back up.


The best way to build a NAS is to take an old computer or in this case a new computer and install an OS called FreeNAS on it. FreeNAS is as the name implies. Free. Basically what you need is a server motherboard. A good Intel enterprise type CPU and a couple of hard drives (or more).


I opted for a Lenovo TS140 which is a case, motherboard, and CPU with 16 GB of memory. More than enough and not a bank breaker.



Next is a couple of Enterprise NAS hard drives. Don't buy the cheapest hard drive there is. You'll regret it. The darling of the FreeNAS community seems to be Western Digital "Red" Hard Drives. I picked up a couple 4TB ones that were WD refurbished (yeah, I know.....we'll see).


Now to install the OS you need another hard drive or to keep it simple and cheap you can boot and run FreeNAS from a USB stick that is 8GB or larger in size. In fact that seems to be how a lot of folks are doing it. And you can set up 2 USB sticks to mirror each other to keep it redundant should one fail.


I haven't yet started this project but it looks like a fun one.

Network Switches

It's a wifi world, it really is but I've just figured out that you really need to go back to basics and get a switch. Why? It's called the "Internet of Things" (IOT for short). It's where every thing has a wifi interface in it and it all lives on the same network. Remember a while back when there was a gigantic baby monitor hack? Imagine you buy an appliance and it has full access to the internet but the people who made it weren't really computer security experts and left some gaping holes in it. Once that device is hacked, depending on the Operating System or the Operating System kernel your whole network could be compromised.


So a decent managed network switch these days has the ability to do 801.1q which allows you to segregate your networks through something called a virtual Lan (VLAN). Below is a TP-Link SG1016DE_V2 switch I got for about $70

Lets say my router gives me a local address of 192.168.0.1 Everything I connect to that router (wifi or wired) pulls an address like 192.168.0.2 or .3 or .4 and so on and so forth. Now lets say you could assign different address ranges to different ports. Make another port 192.168.10.1 and hang another wifi router off that. Then you can make it so both networks cannot see each other but both can reach the internet. True segregation.


Here's how it is done with pfSense and your switch (using my TP-Link SG1016DE_V2 as an example).


First tag the ports. My firewall is plugged into port 2 (most will probably plug into port 1, port 2 is on top) so you tag port 2 and untag the ports you want on your VLAN. Under VLAN ID type 10 or 20 or whatever number you want to use. You have to make sure you keep your tagging consistent though. So if you look at the bottom of the pic below I have tagged port 2 for both VLAN 10 and 20 and untagged port 16 for VLAN 10 and ports 3, 4, and 15 for VLAN 20. (This just happens to be the way I plugged stuff in and works best for my wire management).


Then go to the PVID settings page. Set port 16 for VLAN 10 and ports 3, 4, and 15 for VLAN 20.


Then in pfSense make two new interfaces, VLAN 10 and 20 under Interfaces > Interface Assignments.




Then (I'm using VLAN 20 as an example) enable the interface and set the address for 192.168.20.1 20 for VLAN 20, 10 for VLAN 10



Finally set the DHCP server to give out DHCP addresses. The only configuration not depicted here is the gateway setting (192.168.20.1)




And that should about do it. Plug into port 16 and you'll pull an address from 192.168.10.x range. Plug into 3, 4, 15 and you'll pull from 192.168.20.x range.


Folks, the challenges with computer security are not just software. Sometimes improved security involves the physical connection to the device (along with segregation and firewalling).


I'm aware this is beyond the scope of most casual computer users abilities but hey.......I'm for sale.

What Is Computer Security and Where Is It?

I've been kind of harping on computer security based around that all important network connection to the internet but it is much more than that. Much like anything in life you need some kind of a map or plan before you can make informed decisions to protect what you feel is important. Much like you might take physical gold to a safe deposit box or buy a home safe, what is your plan for protecting your valuable zeros and ones?


Even though a firewall and a good router are tantamount to security let's assume the worst. What is the plan for protection?


I figure there are three types of information.

- Information which must absolutely be safeguarded at all times such as Social Security Numbers, bank account passwords, tax records, etc.

- Information which if lost would result in sadness, such as a loss of photographs or emails from loved ones.

- Information that just doesn't matter and can be retrieved from the internet again and again via download.


Here is one method of protecting the first category. An encrypted program which contains all important personal information and remains encrypted unless you are actively using it. Programs (for Mac) such as Splash ID Safe or 1Password. A similar method would be to have all such information on a spreadsheet or office document and encrypt the document or the folder in which it is stored (or both). Mac provides a free means in which to encrypt folders and drives or disk images. Third party solutions are available as well. One of my favorite old programs was called Hide Folders. If you can't see it you might not find it. Maybe not the best solution but as an extra measure of security it is okay. One thing is for sure though. Just storing your critical information on your hard drive is almost begging it to be compromised or stolen.

Regarding my second category of information multiple methods exist for protecting it not the least of which is ROUTINE SCHEDULED BACKUPS, and then to take the backups off site. Doesn't do you a bit of good to safeguard your information if the house burns down and the backup is in the house. And yes, oh yes, houses burn down sometimes. Also email encryption should be more common than it is. One such service available is called ProtonMail. Using the Cloud is also a great solution. iCloud on mac is great for backing up NON SENSITIVE data such as your vacation pictures........not so much your naked pictures.


Lastly do you really need to backup items such as downloaded installer of Adobe Acrobat? No. It's replaceable. Might be a pain but it is replaceable.


Bottom line here. You can run protection services all you want on your network like I do.


BUT YOU STILL NEED TO PROTECT THE DATA THAT MATTERS TO YOU!

Back it up. Encrypt it. Hide it if necessary. Information held on a removable drive not hooked up to the internet CANNOT BE STOLEN FROM AN INTERNET CONNECTION. You keep your birth certificate and the deed to your house in your fireproof box.......why not a thumb drive of sensitive ENCRYPTED data?


Comments

Home Network Progress

I've given great consideration to network security lately and have taken some measures to harden my network a bit. One glance at the news today and it is all about emails, hacking groups, and information being disclosed. Seems like that if you spark someone's interest they'll get at your private life by way of your computers or devices.


For years I just hooked my router to my cable modem without much of a thought to it. I generally ran routers with custom firmware such as DD-WRT or Tomato and always fancied myself one step ahead of the average user and I probably was. I just don't think fancy router firmwares are enough these days. Maybe I'm wrong and maybe I'm even dead wrong but I figured a firewall appliance was the place to start.


Make no mistake. You can make a firewall appliance for practically free. In fact you probably have an old computer in a box in the attic that would make an excellent firewall. Combine that with an OS called pfSense and that's all there is to it. Also it needs two Network Interface Cards (NIC) also known as ethernet ports. pfSense likes Intel NIC's best. One NIC is for WAN (internet) and the other NIC is for LAN (your inside network). The downside is the old computer is well, big, and makes a lot of noise with all the fans as well. And because this will likely be on 24/7 you have to factor in total cost to operate. It could be better to build a new appliance based on a fan-less ITX or mini ITX motherboard kit or even better to buy a prebuilt appliance like I did here. I know what you're thinking. That costs $300 and it sure does. But we're talking about the security of your files, and your bank account data, and everything that matters to you. What if somebody deleted 10 years worth of your photos? Wouldn't kill you but you can't get that back.


Again, you can build this firewall for nothing if you have an old computer laying around. Or you can go on eBay and find an old rack mount server for about $60, or a really good one for $100. Of you can connect a 5 year old router to the internet that hasn't been updated in, oh, say........never. Or lets say its a brand new router and you do update it, but get a load of this. This fine gentleman posts of known, brand new security exploits on routers. If you want a really good education go to his router security site here and take some time to educate yourself on router security. Your router manufacturer wants you to connect EASILY to the internet so you don't have to call their expensive tech support people so security is not the important thing. It has to work for the dumbest person that is going to buy and use it. That should make you feel good.


You don't have to be a computer genius to use pfSense but you do need to take some time to read some on line tutorials and copy from them. I suggest running pfSense for a week, getting the feel of it and then adding a threat detection package called Snort. Read online to learn how to configure it, and run it for a week or two. You'll have to learn how to weed out some false positives because you'll find that you're blocking things you don't want blocked. But that's better than being wide open.


Or you could pay someone to do this for you. I hear that guy who set up Hillary's server is looking for a job...........bad idea.


After a couple weeks of Snort then install something called pfBlockerNG which allows you to add lists of known spammers, bad guys, etc. Once again you'll have to dabble with it because you'll probably block things you don't want blocked. Now are you safe from the NSA or some super God hacker? Probably not, but not every super hacker is out there running around looking to break into everyone's computer. Those people work for Nation States and Law Enforcement or they make their living stealing on the internet. Your pictures of Niagra Falls are not what they are looking for. But there are thousands, check that, maybe hundreds of thousands of lesser skilled people running up and down IP ranges looking for a soft target. Hopefully if you aren't a soft target they'll move right past you to the person with the next IP address while they are doing their nmap sweeps.


So here's my setup. The white box is the cable modem. The black box on the left partially out of frame is the SG-2220 pfSense firewall appliance. That is connected to a TP-Link 16 port Easy Smart Switch which has ports 15 and 16 configured by me to provide Virtual LANS which are segregated from my network. Attached to the port on the right is another wifi router which can only connect to the internet. All my Internet of Things appliances are connected to that wifi network.



Those items are:

Nest Thermostat

Raspberry Pi Music servers

Chromecast

Apple TV

etc. etc. etc.


The blue router in the photo serves up my trusted network. It also has a firewall and the installed firmware is DD-WRT.


You get the idea. If I have a device that hooks to the internet and I have no control over it's configuration and I can't trust it then it goes on the guest network. Someone sees that device and if they exploit it, it ican't reach the trusted network. A "guest" network means internet access only. No access to other computers on the same or any other network.


So again I think the days of hooking a router up directly to your modem are rapidly coming to a close. Everyone has data they need to protect even if it is just your favorite selfies. Firewalls, baby.

Network Security

Take a look at your Shared area in File Manager on Mac or in your Network Neighborhood in Windows (shudder). How many devices are there? Take a look at my list here.


Several devices THAT CAN ALL SEE EACH OTHERS SHARES! Someone hacks one device they have access to whatever is shared on your network. In the new Internet of Things (IOT) it seems everything is being connected. Light bulbs, cameras, washers, dryers, refrigerators, push buttons to order new detergent, you name it the world is more connected than ever. What if someone hacked your Amazon Tide Button? Then they could potentially see the shared contents of your laptop. Ouch.


For example many of these devices in my list simply don't belong on the same network as my SSN, and credit card numbers, and my password database. In that list is a computer hooked to a 3D printer, a computer simply not doing anything right now other than being on, some music servers, and an experiment I have running.


The smart thing to do would be to segregate those devices from my main network using a guest network and then ensuring that network CANNOT reach the primary network.


Okay, you're careful. You never go to porn sites. Nobody goes to McDonalds and nobody shops in Walmart either. Your teenager only reads the bible online.


Segregate your network already. Just do it. There are a variety of ways to do it. You can set up a guest network in your router configuration firmware, or you can create 2 physical, separate networks and firewall them off as I have done. 192.168.20.1 is my critical network and 192.168.10.1 is my guest only network and the only thing it can do is reach the internet. It can't see the computers on the 192.168.20 network at all. Period. No way.

This is accomplished by creating something called a Virtual LAN, (VLAN) and it is easier than you might think.


The internet is a dangerous place and with the advent of the Internet of Things it is even more so that way. Imagine if someone hacked your light bulb, your baby monitor, or your washing machine and gained total access to your network. Still think a guest network is a bad idea?

Older Entries

11,747