Friday, December 27, 2013

Viewing Amazon Historical Prices inside Amazon

I spent part of the day working on a Chrome/Firefox plugin that lets you view Amazon Prices over time. I use camelcamelcamel.com's historical data, and put it inside next to the "Add to Cart" button to warn myself before purchasing. Now you can make sure that you're not buying a product on a very bad day!

Here's what it looks like above the "Add to Cart" button:


After clicking on the small snapshot, it reloads a larger historical chart and places it above the product's Title/Name:


If you click on the larger image, it will take you to camelcamelcamel.com and you can setup trigger prices to have them email you if the price drops low enough. I have done this with several products, and it worked out nicely.

In order to install the plugin follow the steps below for Chrome or Firefox browsers.
Note: This is only for Chrome or Firefox

Steps for Chrome Browser:

  1. Install my extension located here: Amazon Historical Price Extension

Steps for Firefox Browser:

  1. Install the Greasemonkey plugin (a prerequisite). Go to https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/, and then click "Add to Firefox". Greasemonkey allows user scripts, like mine, to be installed
  2. You will probably be prompted to restart firefox, do it.
  3. Click on this AmazonHistoricalPrice Addon Link, and it will get installed to your firefox Greasemonkey scripts.
  4. You are done.

Friday, December 20, 2013

Home Security IP Camera in the Cloud

My wife considers me to be paranoid, but I am just realistic. I like to have a little more situational awareness than the average person. For instance, when someone rings on the doorbell, I'd rather look at my phone or computer to see who is there than get up and find out I'm face-to-face with a salesperson. I'd also like to be able to check from work whether a package has arrived at my doorstep, or call my neighbor when I realize my garage door is open when I left on vacation. All of these are easily handled by putting in a wireless IP camera or two. A little more effort, and I can record motion and upload it to the cloud for free as well!



Original Efforts - CCTV and pin spy cameras

Originally I bought one of those CCTV Camera sets, but I didn't like the idea of having wires running around my house to a central DVR.
I thought about getting one of those tiny Spy cameras and putting it in my door's peephole, and then transmitting that to a little TV receiver. That idea added up to a little over $100 and a non-digital signal.

Enter: PTZ (Pan Tilt Zoom) WiFi Webcams

There are a lot of really cheap WiFi webcams out there that have Pan and Tilt capabilities. That means you can control them and have them point around. The cheap ones don't have any zoom capabilities, and if they advertise it then it's a "digital zoom" which is fake and not really zooming. But I'm fine not having zoom. As of this writing I see some under $50. I've bought four, and they're all pretty similar. So similar, in fact, that although the web software for them looks a little different, it seems like the firmware for the cameras are the same. I'll give an example later on. My first WiFi camera was the popular Foscam model pictured on the right. I also bought the EasyN and Wansview cameras displayed.
I use one for my front porch, one inside my garage, one in the baby's room, and one in the front room. Now I can easily see if there's a package sitting on my porch, if I left my garage open, if the baby has climbed out of the crib, and what the kids are getting into while I'm watching a movie with the wife. I measured the power usage of the cameras if they were left on all the time, and it came to about $3-4 a year. Not bad!

Camera Settings Setup

Here's how I setup the camera settings within my network. I'll do a follow on post to describe how to get access to the cameras from the outside. I have a bunch of screenshots of the steps I took, but I will try to narrate a little.
Camera Software for Initial Setup
The cameras come with simple software used for setting it up. Most have you connect the camera to your network with a cable. We are going to do most of the setup on the web interface, so for now let's modify the camera to work on our network (most networks can have the above settings). In particular, I changed the HTTP Port from some other number to 80 so that it would be an easier address to type in the browser. Once these settings are updated to the camera, we can access the camera's web interface and we don't need the software anymore.

Access the Web interface
Type the IP address that was setup above into your browser (192.168.1.126 in our example). It asks for a username/password. The camera should have instructions on what the initial username and password is (you will want to change these later)

Different Webpages for Different Browsers
I have found that for all of the cameras, the ActiveX Mode had the nicest interface, BUT all of these cameras are from China, and I would be worried about installing the required plugins to get the ActiveX Mode running. So instead, use the Firefox/Google Browser signin method even if you use Internet Explorer.

Some of the Settings Available

Alias is used to identify the camera when multiple are on network, but I usually use my phone's app which does not see these Alias names

Enable IP from DHCP
We had earlier set our IP address to 192.168.1.126, but that address might be conflicting with others on the network. So instead of telling it exactly what address to use, we will let our home network pick an address automatically using DHCP. This means the address will not always be the same

Add your wireless settings so that you don't need the cable plugged in anymore.

Camera Boot Options
If there is a setting to "Enable preset" or to "Start running to the specified preset" these would be good to enable. If you ever lose power (or need to power-cycle the camera), when the camera turns on it will startup and look around and then go to a centered position. If the above setting is enabled, you can choose a position for it to point at after the initial boot sequence.

IF YOU DON'T HAVE A PRESET BUTTON, don't fret! There's a really good chance it still exists but isn't accessible through the web interface. As I mentioned above, the firmware for these cameras are very similar. I found out for one of my cameras that did not have the setting that I could send the same command to it that I sent to the Foscam. The way commands are sent is by URLs. Look at the example below that the Foscam (and 3 other camera brands) all use for sending the command to enable the preset:

Note that you need to change the user=admin and pwd=mypassword to your appropriate settings.

When this is done, we are now ready to unplug from router and connect wirelessly. If it does not connect after a while (it can take a minute or two to boot up) you will have to use the software again to easily find your IP Camera.
Resolution and FPS
There are some settings that are instance-based settings. For instance, if you change the Max FPS, any other browser connected to the camera will not be affected. On the other hand, if you change the Resolution from 640*480 to 320*240, any other browser (including the software that is backing up movement to the cloud) will downgrade to the smaller 320*240 image. I highly recommend Putting and LEAVING the setting at 640*480.

EasyN's interface has some arrows to click in order to Pan/Tilt camera

Setting Presets
The web interface will have some way to set preset locations. Use the controls to get the camera to point in a direction you want, and set that to preset 1. Use preset 1 for your default location as this is usually the preset that is loaded when the camera boots up. Then setup some others that might be useful. I once setup about 10, but then I only used about 2-3 of them.

Using Presets
After you have setup the presets, you can "Goto" or "Call" (or some other term used in web interface) one of the presets to have the camera quickly move between preset locations.

Flip Horizontally/Vertically Buttons
The cameras will have a Flip Vertically / Flip Horizontally button that will help out if your camera is being mounted upside down. My camera outside is hanging upside down under the rafters. The Garage one, on the other hand, is just sitting on a shelf and so does not need either of these settings.

Another setting is the On/Off Light button. This turns on the Infrared lights or turns them off. I don't think I have seen an "Automatically turn them on when they are needed" feature, so you must choose one or the other. I just leave them on all the time, I feel it doesn't hurt having them on in the daytime, and they are a necessity at night. The only time I would say not to is if you are using the camera behind a window. In this case, the Infrared lights glare off the window and make it impossible to see during the night. In that case you should rely on a porch light.

Hope this helps someone. Other things I'd like to talk about sometime is how I use ISpyConnect to monitor the cameras and automatically record on motion, how I automatically have recorded video uploaded to web using Dropbox (or any other cloud service), and how to get access to your camera from outside your house.

Monday, January 14, 2013

Biking Accessories I Like

I currently commute to work by bike most days. It's nice because I'm only a few miles from work and most days of the year it is not raining. My bike duals as a Mountain Bike (it's a Fuel EX) and as a hybrid road bike when I switch out the mountain tires for slicks.

One life-saver that I have is my Rechargeable Air Horn. It's great. The week after I got it mounted, I was able to scare-to-a-stop an old man trying turn and drive through me to a parking lot! I also use it when people drive in the bike lane. The front view you can see that I ran out of space to put the refillable air resevoir (conveniently filled by a bike pump). So it is mounted on my front fender.

The 1200 Lumen light was a great Christmas present from my buddy (an inexpensive $40-50). They're WAY cheap too! These lights are 1200 Lumens, come with a lithium battery, bike mount, and helmet mount. The light that I got has 3 light settings (High, Low, Seizure Mode). It works great, except the seizure (flashing) mode will probably not be something you want to use. I can honestly imagine car accidents because of it. Another similar-priced 1200 Lumen light model has 5 modes. Its flashing might be more reasonable. Regardless, my 3-mode light works great with High and Low settings.

I like having this light mounted to my bike. My friend has 2 and has one of them on his helmet. Whichever one is mounted to the bike, you should get the horizontal light diffuser. It's ~$5, and turns a spot light into a horizontally diffused light. Then you can use your helmet light for a long-distance spot light.
I have another light that I like to use, a Cygolite Expilion 250. It is also a Lithium Ion light. It is rated for 250 Lumens and works great for a point-light. Unfortunately I think it's gotten expensive since I bought it. It is very bright though and conveniently charges by USB. I usually bring my helmet into work with me, so if my light is low, I can charge it.









On my road helmet my other great safety device is my rear-view mirror. It comes in 2 versions, to either attach to your helmet or your eye glasses. I have bought both versions (compact version is for attaching to your glasses). I don't wear glasses enough to use the compact, so now I just use the "original" version. Both work great. They are just out of regular view so that they don't obscure your vision. But they keep your situational awareness up much higher. Even though I have the mirror, I still recommend double-checking over your shoulder before turning into the traffic lane next to you.

Another essential that I think is needed is a Shoe and gloves dryer. I spent over $50 buying shoes for my bike, and I don't want to buy them every year due to molding and smelling and such. You have to be careful when you buy these. You want the ones that have BOTH Heat AND Air. My buddy bought two. The first one just blew regular air around in your shoes. The second was a "silent" dryer, and did not blow any air, it just heated up the air in the shoes. Mine does both, and is much quicker at drying because of this. I don't care about it being silent...it's in the garage.





I have some cheap ear behind-the-ear muffs that I like to wear, even when the weather is up in the 90s (I'm only going a few miles). When I ride my bike to work with my buddy, the wind across my ears is pretty noisy and so I can't ear my friend's conversation or the car behind me. When I put on these muffs, though, the wind noise is almost completely gone. They're great and were a few dollars in Korea.






Finally, I have a toilet-bowl cleaner and tooth-brush for cleaning my bike off of mud. I also have some reflective pant leg bands. The leg bands are to keep my pants from getting caught up in the chain...and being reflective is a plus. They were ~$5 at a local bike shop.

Wednesday, January 2, 2013

Arduino-controlled Stair Lighting

My most recent project involves: $20 of LEDs a $3 ATMEGA328 chip 3 $2.50 TLC5940 PWM controllers a $5 buck converter 2x10 boards and a bunch of wires. Here's how it looks so far: