Vera UI7 on Android….wtf!?

Are you a Vera user? If so, you’ll probably have heard complaint after complaint about Vera UI7 and how many users are not planning on upgrading despite it being released over a year ago. If you’re not a Vera user… stick around anyway!

A quick little background note, I have installed and configured a couple of Vera’s through work for clients who wanted to do alarm integration with it, so I have used both Vera UI5 and Vera UI7, but I’m not going to compare the two (not today anyway). Being a self proclaimed Android developer, I wanted to concentrate on what I see as wrong in specifically the app (though most of my suggestions probably apply to the web interface, and the Apple app as well). continue reading

Rooting Galaxy Note 3 (and Other Galaxy Devices)

After upgrading my Galaxy Note 3 to Lollipop, I ended up losing my root access. That just won’t do, so it’s time to cover rooting the Galaxy Note 3!

What Is Rooting?

Root itself is a user account within Linux that has elevated permissions. It’s similar to an Administrator account when working with Windows. A root account has permissions to read/write/execute any file on the Linux/Android platform and is often required to run any sort of custom rom on the device. The process of gaining access to this account is called “Rooting” continue reading

HTTP GET Parameters with Arduino

For a while now Kevin B has been working on writing a library for communication using the NRF24l01 radio with the Arduino’s. The idea is to use them for home automation purposes. But of course that’s only one piece of the puzzle… what good is home automation unless it’s also internet ready?

I took it upon myself to start looking into that portion, since it’s right up my alley (between server-side scripting such as PHP along with a database such as MySQL, and the API needing to working with Android of course).

Kevin’s thought was to use RS-232 between the Arduino and a Raspberry Pi or Seagate Dockstar. At first it seemed like a great idea until I started reading up on different methods to make this work.

Using Python + PHP

This seems to be the most popular recommendation, but I’ve never touched Python before. The idea was to have Python and LAMP running on a Raspberry Pi while connected to RS-232 and send/receive commands that way. Seemed simple enough, but boy was I wrong. Python boasts being extremely easy to learn for people new to programming, but after seeing a handful of examples, I didn’t even want to touch it. Maybe it’s from years of Java and over a decade of PHP, but my brain just didn’t want to even look at Python never mind understand it. NEXT!

PHP with Serial Library

My next thought was that there must be a library to do RS-232 communication through PHP alone. There were a few limitations that bothered me though. First, PHP is a server-side scripting language. It’s not really meant to run in loops forever waiting for serial data to be received in the same way an Arduino runs in a loop forever. Most web servers (such as Apache) come default with a 30 second max execution time, so if your script runs for more than 30 seconds the server will just terminate it anyway. There is also the issue that the Arduino resets every time you open a serial connection with it, which means even if you don’t loop the PHP script and just call it when needed, the serial data will be reset as soon as the script runs… not good. Kevin pointed out that this is due to DTR signal on RS-232 pulling the reset pin to ground, which isn’t an issue if using a Pro Mini without DTR connected, but in my case I had planned to use one of my Arduino Duemilanove boards as the base station (USB is built on board, so “it is what it is”).

Too Many Layers

Lastly since RS-232 doesn’t do any form of acknowledgements it means there would have to be another software layer in between to control and confirm data. At this point just to get the Arduino to talk to a web server, there was waaay too many points of failure for me:

The Simple Solution

Then it hit me… the route I should have been going all along. An ethernet shield. This will take care of nearly all the problems. The Arduino can act as a web server, and with a bit of programming we can have it serving data or receiving and processing data. Using HTTP response headers, we already have a form of acknowledgements built-in. And lastly, later down the road I could actually remove the Pi from the picture completely if I wanted and instead use my VPS located off site, or even control multiple houses from a single server without the need of separate Pis everywhere or being limited by the processing power of the Pi.

So I plugged my Ethernet shield into my Arduino, along with a battery source for power (my USB ports weren’t giving enough current to keep it powered on by itself), and off to the races I went.

HTTP GET Parameters with Arduino

While not secure by any means, HTTP GET provides an easy solution. The idea is simple. Commands can be sent from the Pi by a GET parameter in the URL to the Arduino, the Arduino can then parse this data and do whatever needs to be done and then output the result (eg. Success or Fail). The Pi can wait for the output/result, and then process whatever it needs to do (eg. informing the user of the result).

First we need to set up the network information for the shield. The Ethernet library does support DHCP, but its easier to use a static IP for testing.

// Setup the static network info for you arduino
byte ip[] = { 192, 168, 1, 177 };   // IP Address
byte subnet[] = { 255, 255, 255, 0 }; // Subnet Mask
byte gateway[] = { 192, 168, 1, 1 }; // Gateway
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; // MAC Address

Next we setup the ethernet server on port 80 (default HTTP port) as well as a string to store the GET parameter in.

EthernetServer server = EthernetServer(80); // Port 80
String HTTPget = "";

The setup() function is pretty straight forward. Remember we can’t use pins 10 through 13 for any thing else as they are used for Ethernet. Unfortunately the NRF also needs some of those pins though, so I will have to look into using a SoftSPI library or figuring out how to use the SS pin (slave select) down the road.

void setup() { // pin 10, 11, 12 and 13 are used by the ethernet shield Ethernet.begin(mac, ip, gateway, subnet); // setup ethernet with params from above server.begin(); } continue reading

Bias Lighting On A Budget

Over the weekend I decided to pull out some of my cheap strip LEDs and put them to good use with a little bias lighting!

What is bias lighting?

Don’t feel bad, up until a few days ago I hadn’t heard of it either! Bias lighting is the effect that can be achieved by placing a light source behind your television. Surprisingly, this has been around for a very long time but is only now becoming more main stream with things like the Phillips Ambilight+Hue system, as well as more and more manufactures placing some form of lighting directly in the rear casing of TVs. But there’s no need to buy a $2000 TV just for some lights (average price of an Ambilight TV at time of writing). continue reading

Setting up Raspbian on a Raspberry Pi

A while back I made a trade with a co-worker for an old netbook in exchange for a Raspberry Pi Model B+.  In case you haven’t heard of the Raspberry Pi (…what rock have you been hiding under!?!), its a small credit-card sized computer, originally designed as a low cost  and low power solution for schools to teach kids more about programming in languages such as Python. But because of its small platform and low cost, it quickly became very popular in the hacker community as well. My Raspberry Pi has just been sitting on the shelf for a little while now, I figured it was time to blow off the dust and power it up. continue reading

Bypass Installer Lockout on PC5010 (DSC)

I have a co-worker that picked up an old DSC PC5010 alarm panel (for free, you can’t go wrong right…) and since I had fun writing about the Honeywell Lynx Touch Backdoor, I figured I’d give this a go and see what happens. The problem… the panel had installer lockout enabled.

You can tell when a panel has installer lockout enabled because you will hear a distinct 8-10 clicks from a relay when the panel is initially powered up (see video directly below). When the panel is locked out like that it blocks the ability to default the panel back to factory (even by hard wire reset), so unless you have the installer code, you’re SOL… continue reading

Installing Android Studio

In one of my older posts, Getting started with the Android SDK, I made a mention of Android Studio and how it would be replacing the Eclipse ADT plugin. Well sometime since then, it looks like the switchover has indeed happened and its time for me to ditch Eclipse take a leap into Android Studio.

Downloading Android Studio

Now that there is only one option to choose from, Google has streamlined the download process significantly since my last post.

Simply head over to the Android Developer page, and click Download Android Studio. Do your usual reading of the license agreement (you all do that, right?), accept, and you should be downloading all 800MB of Android Studio goodness! continue reading

Temperature Sensing with DHT11 on Arduino

Ahhh temperature sensing, something so simple yet can be integrated into so many different projects. How about a temperature controlled RGB LED? Or perhaps an Arduino controlled thermostat? Heck, even a full blown weather station! Your imagination is the limit.

There are a few different choices when it comes to temperature sensing such as a completely water proof analog temperature probe to digital sensors. I will be focusing on the DHT11 which is a very affordable (~$1) digital temperature and humidity sensor. Its good for sensing 20% to 80% humidity within 5% accuracy, and 0c to 50c within 2% accuracy, which is more than enough for any indoor projects. If you want something a little more capable and accurate, the DHT22 is another option for digital sensors.

The DHT11 has 4 pins in total as seen above (with 0.1″ spacing – perfect for breadboards). VCC, a Data pin, and Ground. Pin 3 is not used.

Wiring it up is fairly straight forward. Start by connecting VCC on the DHT11 to VCC on your Arduino, and Ground to GND. Next connect the DHT11 data pin to pin 10 on the Arduino. Lastly, we need a 10k (Brown Black Orange) resistor in parallel to the DHT11 connected between the VCC and Data pins. This is our pull up resistor.

Now its just a matter of uploading our sketch and checking the output in the serial monitor

//First we need to include the DHT Library #include "DHT.h" //Next we define which pin the DHT11 is connected to, in this case its 10 #define sensor 10 //We also need to define the type of sensor were using, which is the DHT11. //Other options are DHT21, and DHT22 if you are using those sensors #define sensorType DHT11 //Initialize the DHT sensor using the above variables DHT dht(sensor, sensorType); void setup() { //Start our serial port and dht sensor Serial.begin(9600); dht.begin(); } void loop() { //Read the temperature sensor, in celcius int curTemp = dht.readTemperature(); //Read the humidity, in percentage int curHumidity = dht.readHumidity(); //Output the information to our serial monitor Serial.print("Temp: "); Serial.print(curTemp); Serial.print("°C / Humidity: "); Serial.print(curHumidity); Serial.print("%"); Serial.println(); //Wait for a few moments as the sensor can only update so quickly delay(3000); } continue reading

Build your own Arduino starter kit

I have a friend that keeps asking me about micro controllers and costs associated with getting started. He has no prior programming experience, and doesn’t own a soldering iron. By the sounds of it, he’s a little on the fence (rightfully so) and isn’t sure whether he should try it or not. Totally understandable when starting with something new. So I figured hey, lets break it all down and see just what it would take to build your own Arduino starter kit!

Before I get into the actual costs I just want to point out that while previous programming experience is handy when it comes to Arduino, its not at all necessary! The Arduino community is literally huge (250k+ members worldwide, 2 million posts) which means finding a sketch and wiring examples that do exactly what you want it to do (at least when you are first getting started) is going to be very easy. My recommendation when starting out is to concentrate on small projects with the thousands of ready made examples (blinking, fading, controlling, etc.). This will allow you to familiarize yourself with the platform (uploading, debugging, etc.). Once you have a solid base is when the real fun begins and you can let your imagination run wild! continue reading