My own TV Station (part 1)

I have always loved all the aspects of TV. When I was younger, I had bought some antennas and placed them in my parents attic to pick up all the Over the Air channels that I could. I remember spending countless nights surfing all the RF channels trying to see what I could pick up when there was a DX type event. I think the furthest away I got was a few hundred miles on a DX skip and picking up channels from Canada, which was pretty cool. Now days it is so much harder as if you don’t have a good signal you have nothing. I much prefer the analog days of scanning for TV stations as even if there were snow you could usually make out the station ID’s.

Fast forward a few decades and I still have the interest in TV/Video. I love making videos and editing them, I also still try to set up an antenna every once and a while to see what I can pick up over the air. But unfortunately where I live the only thing I can usually get is the local PBS station. (I do get some brief signals on others, but not enough for the tuner to lock in on what it actually is.) So with my hobby of doing TV I was surprised to find the SatLink ST-7000 on Amazon. Previously I had talked about the VeCOAX Minimod 2 HD RF modulator. I still use it for my security cameras, but this SatLink intrigued me as it was almost half the price of the VeCOAX one. So I picked it up.

To my surprise, it works very well, I almost want to say better than the VeCOAX Minimod 2. I didn’t have any of the issues with 1080p on the SatLink and it works on nearly all the TV’s in my house. (The one issue I do have is on my Samsung 4K tv, the audio cuts out for like half a second every minute or so. This is super odd and caused me to set there changing configs on it for over an hour one night, when it was just that TV, and all the other TVs in the house it works fine on. Even ones that are older than the Samsung 4K. So I am going to assume it is a firmware issue with the TV, but they haven’t release an update for it in years… Yeah tech waste.)

So how does this make my own TV station? I am sure if you are reading this, you have probably seen other people on YouTube talking about making their own TV station in the house with a Raspberry Pi and an analog modulator. I too started with this, but was not satisfied with the picture quality on the HDTV’s. (Yes I understand it is analog, but now finding the SatLink, I wanted to kick it up a notch.)

To start with I hooked a Raspberry Pi 4b up to the SatLink and set the resolution on the graphical display to be the 1080p and verified that all the TV’s (sans Samsung 4k) it worked on. This was great. Then I started playing a video with VLC full screen, this too work, after I got the audio set to go out the HDMI output. So now I have a basic “TV Station” where I can play a file and have it be on channel 9.1 on all TV’s in the house. But this was not good enough.

What is going to follow is a series of more posts on the scripts and other items I am working on to make it an actual TV station for the house. Scheduling of playing TV Shows and Movies, as well as bumper plates between the shows to show what is coming up and a log of what was shown and when.

With thousands of hours of TV Shows and Movies that I have bought over the years, I could technically cancel my cable TV and have enough to watch for a few years. But what this TV Station does is bring back the “old days” where you watch what was on TV even if you only got one station. It just so happens that this station is mine and it only shows what I want it to show.

Raspberry Pi’ing

Recently I decided I needed a better way to monitor the temperature and humidity in various parts of my house. The main reason was the thermostat for the house is located in a hallway that is more closed in than anything. So while the thermostat may show that it is 75 degrees in the house the rest of the house my only have been 70 degrees or less. After the winter we have had, I also needed a good way to monitor the humidity in the house. The only was I was able to do it was with a little Oregon Scientific thermometer I bought at Target. But the problem with this was it was only for one room, didn’t seem to be very accurate and I had no way of logging the values over a time period.

In comes the Raspberry Pi, along with a DHT22 temperature/humidity sensor and Splunk, I can now monitor, record and graph in realtime the temp and relative humidity in various parts of the house (and the outside).

What I got was this:

  1. 3 x Raspberry Pi 2 Canakits from Amazon.com
  2. 5 x DHT22 Digital Sensors from Amazon.com
  3. 1 x DHT11 Digital Sensor from Amazon.com

Now the DHT11, was what I purchased in the first round along with just one of the Raspberry Pi’s. It is not as sensitive as the DHT22’s, but since it was just for the original test it was ok for what I needed. The second round I bought the other two Raspberry Pi’s and the 5 DHT22 sensors.

What I intend to do is use some of the pre-existing CAT5 runs through the house to wire the DHT22’s in to and then have the other end of the CAT5 runs connect in to a Raspberry Pi in the Garage. This way I can do multiple sensors on one device versus having a device in every room.

 

Some of the benefits of getting the Raspberry Pi Canakits I got are:

  1. A clear case is included with the correct cut outs for the raspberry pi.
  2. A USB wifi dongle is included, and the drivers are pre-loaded in the OS.
  3. It comes with a pre-loaded 8GB microSD card.
  4. It comes with a miniature breadboard with a 40 pin cable and breakout board that plugs perfectly in to the breadboard.
  5. Comes with various resistors and led’s and pushbuttons.
  6. Has a HDMI cable included, which made it easy to hook in to my monitor
  7. Various jumper cables for the breadboard

 

Overall, I would say that the total time to get a base monitor up and running is a few minutes. But this is based of me already having Splunk, the network, dhcp, dns, etc already set up. So I am going to detail the basic steps I used to get it up and running:

  1. Unbox the raspberry pi, place the heatsinks on the two “large” chips on the top side, and then place it in the clear case.
  2. Hook up the HDMI, keyboard, mouse, and WIFI dongle.
  3. Insert to the microSD card
  4. Hook up the USB power cable and watch it boot NOOBS.
  5. Once it is booted, select the Raspbian to install. This probably takes the longest of all the steps to do, as it is expanding the operating system on to the microSD card.
  6. Once this is done, it will reboot and bring up a text based config. I set the hostname, enable ssh, set the timezone and finally set the locale.
  7. At the login prompt, you can log in with the userid pi and the password of raspberry.
  8. Next to set up the network, if you are using the ethernet, then it should already have an IP address if you have DHCP running on your network. If you are using the WiFi dongle, then edit the /etc/wpa_supplicant/wpa_supplicant.conf �file as root and put the following in it:
     network={
    ssid="YOURWIRELESSSSID"
    psk="YOURWIRELESSPASS"
    }

    Where YOURWIRELESSSSID is the SSID of the AP you want to connect to and the PSK value is the password for that SSID/AP. (If you are doing MAC�filtering, you can get the MAC address by running ifconfig -a as root and look at the wlan0.

  9. Once you save the file in the item above, issue the following commands:
    wpa_action wlan0 stop
    ifup wlan0
    ifconfig -a
    
  10. By now if everything is working correctly you should have a IP address and network connectivity. You can use wpa_cli status to verify the network connectivity.
  11. Now that the network is up and running I needed to download some software:
    sudo su -
    apt-get update
    apt-get upgrade
    apt-get install python-dev
    git clone git://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code.git
    wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.42.tar.gz
    
  12. Now that we have the software downloaded it is time to do some little compiling:
    tar -zxvf bcm2835-1.42.tar.gz
    cd bcm2835-1.42
    ./configure
    make
    make install
    

    That should install the driver for the bcm2835 chip.

  13. Next we need to do the python code setup:
    cd Adafruit-Raspberry-Pi-Python-Code
    cd Adafruit_DHT_Driver_Python
    python ./setup.py install
    
  14. At this point the code should be done. You can now power down (shutdown -h now) the Raspberry Pi and hook in the DHT22 sensors. (Make sure to disconnect the power before connecting the 40 pin cable.
  15. The way I hooked the sensor in for testing was to connect the 40 pin cable to the Raspberry Pi and the other in to the breakout board which was attached to the mini breadboard. Once that was done I hooked a jumper from 3.3 V to the first pin on the DHT22. Then placed a 10K resistor between another 3.3V connection and the second pin. In addition a jumper was ran from GPIO4 to the second pin of the DHT22. The third pin is left unconnected and the forth pin is connected to Ground. I will post a picture later.
  16. Once everything is connected, power the Pi back up and log in and switch to the root account.
  17. Next to see if everything is working change in to the Adafruit-Raspberry-Pi-Python-Code/Adafruit_DHT_Driver_Python directory.
  18. Then run python ./Adafruit_DHT.py 22 4. The 22 is the type of the sensor, so if you are using a DHT11 use 11, if a DHT22 use the 22. The number 4 is the GPIO port that the sensors data pin is connected to. Once you run it you should see something like this:
    root@rpi2:~/Adafruit-Raspberry-Pi-Python-Code/Adafruit_DHT_Driver_Python# python ./Adafruit_DHT.py 22 4
    using pin #4
    Temp = 20.2999992371 *C, Hum = 40.4000015259 %
    
  19. In the above, we can see that the Temp is 20.29C and the Humidity is 40.40%. If you want the Temp outputted as Fahrenheit, like I did, make a copy of the Adafruit_DHT.py file (for a backup) and then add a new line at line 37 with the following:
    tf = (( t * 9 ) / 5.0 ) +32;
    

    Then on line 39, you will want to change the *C to *F, and then in the format(t,h) you will want to change the t to a tf, so the line would look like this now:

    print("Temp = {0} *F, Hum = {1} %".format(tf,h))
    
  20. Now if you re-run, it will look like this:
    root@rpi2:~/Adafruit-Raspberry-Pi-Python-Code/Adafruit_DHT_Driver_Python# python Adafruit_DHT-f.py 22 4
    using pin #4
    Temp = 68.1800006866 *F, Hum = 40.0 %
    
  21. Now that we have the data being output in the format we like, the only thing left was to log it. What I did was create a shell script that is run by cron every minute (* * * * *) and it outputs the values to a log file called /var/log/temp+humid.log. This log file is then pulled in by Splunk for graphing and other fun stuff that will be another post.
  22. The script I wrote looks like this:
    #!/bin/bash
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    export PATH
    RESULTS="`python /root/TempLogger/Adafruit_DHT-f.py 22 4 | grep Temp `"
    TEMP="`echo ${RESULTS} | awk '{print $3}'`"
    HUMID="`echo ${RESULTS} | awk '{print $7}'`"
    DATE="`date \"+%Y-%m-%d %H:%M:%S\"`"
    echo "${DATE} ROOM=FamilyRoom TEMP=${TEMP} RH=${HUMID}" >> /var/log/temp+humid.log
    
  23. The output that gets logged looks like this:
    2015-03-17 21:44:02 ROOM=FamilyRoom TEMP=68.1800006866 RH=39.7000007629
    

 

Some times, and I haven’t figured out why yet, it will log null values for the TEMP and RH. I need to add some more checking in to the script to make it more robust, but for now it is working.

In the next post I will cover what I do with the data in Splunk, and how I get the outside temps from the local airport and add them to Splunk as well.

Home repairs, third edition

As a continuation to my other home repairs (part 1, part 2) this summer was no different. This year it was 2 major projects, the first was to repair the chimney, and the second was a new roof. First some pics of the chimney:

The finish of the chimney is a parge look for now. I will probably paint it some time later. The chimney cap was a poured concrete one as the original had completely deteriorated.

 

Next up is the roof, as you can see in the picture above, or not, there are black streaks going through it. So before it got bad, I replaced with with 30 year dimensional shingles..

 

 

All told it was around another $10,000 in repairs. Totaling over $30,000 in the last 3 years.

Major home repairs part duex…

So as a continuation of last years home repairs I did a couple more major repairs in 2011. This year was some doors and a new deck. I started with the doors in August, replacing the front door and basement door. The front door was leaking heat/cold so bad that it was time to be replaced with a more energy efficient one.

 

Old door removed, getting ready to seal the footer before putting the new door in .

 

New door and storm door installed

After the front door was installed, the basement door was next. It also leaked water, air and was not energy efficient.

Basement door, seen it's better days.

The jam of the old door.

What was left of the old door jam. nice water damage..

New door and storm door. Rot free jam as well.

 

 

After the doors were replaced, I noticed a dramatic difference in the house. The front door no longer was extremely hot or cold on the inside, which is awesome.  The next big project was to replace the deck that I removed last year around this time.

laying the decking boards.

 

stair stringers built.

 

Deck boards laid and railings up

 

Finished Deck, stairs and landings

finished deck

finished stairs and landings

 

The bonus project that was done was replacing the basement window with a new energy efficient one.

 

All told with the above work and fixing a water leak that was in the wall going to my kitchen sink, it was another $11,000 in home repairs this year.  Next year I hope to replace the patio door, fix the chimney and possibly get a concrete driveway done..

$11,500+ in home repairs

This year has been a busy and expensive year. Started off in February with some “snow” in the attic. I decided to add some more insulation to the attic to help out with the heating and cooling:

Attic before work

Attic after installation of R-30 Insulation

Showing depth of new insulation

Next up was the finishing of the second bedroom. Not going to show those pics here..

Then in June my clothes washer decided to go on the fritz, so I had to replace it. This is when the rest of the money started going fast. In the beginning of July we had some really bad rain storms. I came home one night to find water in the garage around the walls. Nothing I hadn’t seen before, but it had been almost 6 years since I had seen it. What I found next was not what I had expected. I walked in to my finished family room and noticed that the carpet was wet. It seems that there was so much rain that it had come in to the garage and in to the family room through the basement wall. The carpet was completely soaked. Here is a pic of the carpet wet. The dark blue area is just part of what was soaked, that is where the carpet had started showing the water because the pad was completely soaked there.:

Family room carpet soaked with water

For reference this is what the carpet looked like before:

Carpet before water

Here is what I found when I started ripping up the carpet:

soaked carpet pad

soaked carpet pad and carpet

What the rain did to the drive way that I had recoated with 24 tons of gravel 7 months earlier:

rain ditch in driveway

So in order to fix the “water” problem, I had Bakers Waterproofing from Pennsylvania come and install a water guard system in my basement. In the simplest terms it is a gutter that is placed under the concrete floor that allows the water to go in to a sump pump to be pumped out of the house. They warranty it for the life of the house as long as I live here, or for 25 years to the next person that owns it.

Before they came, I encased the area they were to work in in plastic. The family room looked like one of Dexter’s kill rooms:

before the demo in the family room, looks like dexters kill room

Here are the pics of some of the demolishing of the basement to install it:

part of the garage floor tore up

tools of the first day of demo

mid-demo

trench dug in the garage

sump pump set

underneath stairs going in to family room

trench in family room

water guard with sump pump

water guard placed

starting to pour new concrete

new concrete poured in garage

concrete poured with de-humidifier access port

After the concrete has dried the family room looked like this:

family room before new carpet

So now that the basement had been fixed, something else had to happen. And true to Murphy, my air conditioner died the week that Bakers was here to do the basement work. So I had to have Air Service come out to replace my central air conditioning system.

During AC Install with rain

So what better way to finish out the summer of money spending then getting ready to replace the deck that was getting too old. Here is a before pic of the deck when I bought the house:

deck in 2003

As you can see it has a little bit of a bow in the middle of it. Fast forward 7 years and this is what it looks like:

deck in 2010

deck in 2010 #2

This pic really shows the bow, (3 inches). Needless to say who ever built the deck had absolutely no clue how to build a deck or to properly support or anchor it. Picture of the deck with it over half way torn down. Thanks to my Bosch Drill and Saw:

deck mid-demo

What made me mad (but sort of glad for the demo part) was that they had only “sunk” the support posts about 3 to 4 inches in the “concrete” footer. The footer was only about 5 inches thick and no where near code.:

end of deck post

One of the posts had a nice amount of termites in it:

deck post eaten by termites

And a final picture with the deck down. I left the ledger boards for now:

deck gone

One thing I forgot to mention, and you can see in this pic, is I had new seamless gutters installed. During the winter storms we had, part of the gutter near the back bed room got bent so far that the water would run off the roof and hit the back side of the gutter and bounce back against the house.

And the final thing that I have done this year is to get new carpet put in the family room so that I can try and get it back in to order before the holiday season:

another before pic of family room

carpet pulled up, getting ready to remove the pad

pad pulled up

new pad installed

stretching new carpet

after carpet done

after carpet done 2 (before furniture)

after carpet done (where water was)

after carpet done (family room entry way)

So what will 2011 bring? Hopefully I will get the deck replaced early in the year so I can enjoy it and some grilling during the summer. I also need to repaint the walls in the family room. ( Was wanting to do it before the carpet got installed, but they came to install it earlier than they had thought they would since it was special order carpet. ) I also hope to refinish the master bedroom in 2011 as well.