Posts

ESXi Upgrade on Home Server

My home computer setup was starting to show its age.  My previous setup was a pair of Core2Duo class systems each with 4GB of DDR2 RAM.  One functioned as a server running ESXi 5, and the other as a gaming rig with a pretty slick ATI Radeon 6850.  The gaming rig did just fine for most modern games with that video card, but the ESXi server was over-taxed when trying to run anything more than a couple small Linux VMs. I read about folks having success with "whitebox" ESXi servers at  thehomeserverblog.com , and figured I'd follow suit.  I purchased a Gigabyte 970A-UD3P motherboard, AMD FX8350 CPU, and 32 GB of Gskill DDR3 RAM from Newegg.  In retrospect I probably should have forked over the extra dough for the 990 chipset, but C'est la vie. I got everything hooked up and my VMs migrated over, when I noticed that my CPU and memory stats were nearly idle.  Even after installing a couple of Windows 2k8 R2 VMs that had struggled before.  I looked o...

Whereabouts Software, Part 4 - Arduino Code

The Arduino code is responsible for connecting to the Wifi network, getting the latest data from the server (with the help of the fetch_current.php script), and moving the servos to the correct location. Arduino sketch:   Whereabouts.ino Before you download and install the sketch to your Arduino, you will need to update some of the code for your specific environment: /* Network Information */ char ssid[] = "your_SSID"; // your network SSID (name) char pass[] = "your_WPA_pass"; // your network password // WiFi/Ethernet vars IPAddress server(10,10,10,10); This is all pretty self-explanatory. Add the Wifi SSID, WPA password, and server IP address to the sketch. // Servo control vars // The number of people (or hands) that I have on the clock #define NUM_PEOPLE 5 // Names of the people we track (must match what is returned from the server String peopleNames[NUM_PEOPLE] = {String("DAD"), String("MOM"), String("CHILD1"),...

Whereabouts Software, Part 3 - Fetch Current

The PHP script that is called by the Arduino looks into the database and grabs the most recent locations for each user.  It then returns the data in an XML output that the Arduino can parse. Here's the source code:   fetch_current.php You will need to update the following with your own server data: // Database connection information $db_hostname = "localhost"; $db_username = "db_username"; $db_password = "db_password"; $db_database = "whereabouts"; When executed with `php fetch_current.php` you should receive output similar to this: <?xml version="1.0" encoding="ISO-8859-1"?> <whereabouts> <DAD> home </DAD> <MOM> home </MOM> <CHILD1> home </CHILD1> <CHILD2> home </CHILD2> <CHILD3> home </CHILD3> </whereabouts> The clock will use the user names and locations to move the hands to the appropriate places.

Whereabouts Software, Part 2 - Fetch Locations

The server-side collection and processing is done with a PHP script on a LAMP (Linux, Apache, MySQL, PHP) server and is executed by cron.  I set mine to query the phone data every 15 minutes, and it didn't seem to kill my battery any more than normal.  Increase or decrease the timing as you see fit. The script is dependent on the work of Tyler Hall and his Sosumi PHP library to get the location data from the Find my iPhone service.  You will need to download the class from  his website. The script included below will query the phone data for users in the database whose 'location_source' is 'GPS'.  You will need to modify the following in the script to get the location grabbing code to work: // Enter your iCloud username and password $ssm = new Sosumi('your_apple_id', 'your_password'); // Database connection information $db_hostname = "your_database_host"; $db_username = "db_username"; $db_password = "db_password...

Whereabouts Software, Part 1 - MySQL DB

The Whereabouts code is comprised of three parts: the webserver code that fetches the data from the iPhones, the database that stores the information, and the Arduino that represents the server data in physical form in the clock. This post is on the MySQL database that hosts the location data.  I've attached a SQL file that can be loaded into an empty database.  Some tweaking will need to be done for your specific environment which I will detail below. whereabouts.sql The 'clock_location' table is a key/value pair table that represents the physical locations on the clock.  The names in the 'name' field are important and must match exactly (case-sensitive) the values that will be used in the Arduino code for clock locations.  The twelve locations provided are the ones I used but may be modified as needed. The history table is an empty table that will be populated each time the location fetching code is run.  This will be purged after 30 days by the same c...

Replaced Arduino Ethernet Shield with Wifi Shield

Image
We bought a new home a few months ago, and I'm finally getting around to some updates on the Whereabouts Clock.  I decided that hosting an 802.11b WEP secured Wifi network just to host the clock was a bit silly. Prior to the move, I was using the Arduino Ethernet Shield attached to a 3Com OfficeConnect WL-524 to bridge the clock data to my Wifi network.  The only way to connect it as a bridge was to use WEP security, which by all accounts is now completely insecure. I saw that Arduino now sells a shield with a built-in 802.11g that supports open, WEP, WPA networks.  I picked one up and after much frustration with upgrading the firmware on my Arduino (Uno rev. 1) and the shield itself, I finally got it online.  This reduces the number of components in the clock, and certainly the power consumption as well. I also redid my homebuilt servo shield because the Wifi shield required the use of one of the pins I had been using for the clock servos.  Here's the sch...

Clock finished!

Image
Today I took a day off of work and did some stuff around the house.  I've been nearing completion of the Whereabouts clock.  I finished the functional clock awhile back, but still had the waist and base of the grandfather clock to refinish.  Today I finally completed both and assembled the whole clock.  Here's a few pics of the waist being finished: Here's a few more of the final assembly: Now I'd like to focus a bit more on the UI of the data collection.  For me and my wife, it gets the GPS data from our phones to update the clock location, but for the kids their clock positions are typically wherever my wife is, or determined by a schedule.  I'd like to create a phone app to allow us to easily control who the kids are 'attached' to, or to update any scheduled clock positions.  The current method requires logging into the server and manually updating MySQL tables, and that's no fun.  Until next time!

Some old notes

I was browsing around some of my files on the clock and figured I'd post some of the notes I took on the drive components.  From my notes on 3/16/2011: Servos/motors: I thought about using stepper motors to drive the hands but gave up because the Arduino motor shield can only drive 3 steppers.  I need 5.  This is the model of sail winch servo I used:   GWS Sail Winch Servo S125-1T.  Most places have them for $20-30 each. After the fact, I think that steppers would be possible with the Arduino using some custom mux/demux circuits to select one of the multiple steppers to drive and an external driver board like this one:   http://www.sparkfun.com/products/10267 The mux/demux circuit could use this chip:   http://search.digikey.com/us/en/products/HEF4051BP,652/568-1689-5-ND/763293 Gears: I used these two types of gears:   A 1T 2-Y32048 from  https://sdp-si.com/index.asp drive gear on servo:  48 pitch, 96 teeth, 2"...

Clock Functional!

Image
I've been able to get lots done on the clock over the Thanksgiving weekend.  I haven't been able to work on it for a while.  I needed to make the hands for the clock and wrap it up to finish the top section with the actual functioning clock.  I drew out some hands in AutoCAD that I thought I could cut out by hand, but then I thought about having them laser cut and wanted something more intricate.  I had poked around a bit at having them cut, but couldn't get motivated to redesign the hands.  I opted to go back to my original plan and cut them out by hand.  With some sheet metal I had, an air nibbler, and a hand nibbler I set to work.  I managed to get them all cut out with only a handful of blisters and sore hands.  Here are some photos of the cutout hands: Hands cut out, but still with the paper templates attached. The templates have been removed and the hands cleaned up, ready for paint. With the hands cut out, I had to shorten e...

A non-clock post

Image
I figure I should post something non-clock related.  One of my other hobbies is collecting firearms and target shooting.  It's a hobby at this point as I'm not shooting competitively yet, but I have wanted to build a target rifle and/or hunting rifle for some time. I ran into a guy at my last range trip that was praising his Millett TRS scope .  I took a look at it and also liked it.  I also liked the price.  For $300 you get a 4-16x50mm scope with illuminated mil-dot reticle and other nice features.  I ordered one from Cheaper Than Dirt and it arrived very quickly.  I just ordered a mount for it from Wilson Combat.  I got the Accu-Riser scope mount for 30mm scopes. My plan is to see if this will fit on my current AR15 carbine, and if so I should be able to play with it for a while.  If it won't fit (it's a large scope) I plan to get a new 20" upper and be able to switch out the carbine or rifle uppers at will.  Right...