I was launching a new WordPress website at work that was developed by an outside agency. This site was using twitteroauth built into the theme to access the twitter API. Where I work all the web servers are behind a firewall with a strict whitelist for all incoming and outgoing connections besides the incoming HTTP and HTTPS requests. This makes it difficult to access the twitter API because it could be a different IP address every time. To solve this issues my work provides a proxy server to make requests out to. So my research began.
Unfortunately, the developers built the twitter api into their theme so I had to manually track down the API calls to modify them to use the WordPress configuration settings. In the twitteroauth.php file in the themes folder I was able to add three lines to the
curl_setopt parameters to function http (http://php.net/manual/en/function.curl-setopt.php):
In an old episode on Hak5, Wess Tobler (@Dankiswess) did segment on making a MAME bar top arcade cabinet. This segment inspired me to make my own MAME (Multiple Arcade Machine Emulator) arcade cabinet, so I began doing research on different MAME cabinet designs. Bartop Arcade had many different designs and templates for bar top arcades. Below is the design and template that I based my MAME cabinet off of.
Items need for the build phase:
1 – 4’x8’x5/8″ MDF sheet
Box of screws
LCD Monitor (I used a 19″ LCD that I had lying around)
A computer (I choose to use my existing Windows 7 tower)
Drill with a 1 1/2″ drill bit.
For the build phase I used the template that I found from Bartop Arcade and cut out each piece. I decided against having a slide out drawer, so I had to make some slight modifications. Below is a picture of the cabinet about 90% into the build phase.
After cutting and assembling the exterior of the cabinet, I had to wire all the buttons. Once that was done it was onto the software configuration.
A lot of research went into deciding exactly how the software side of this project would be configured. I was initially set on using MALA as my front-end, but then I found Hyperspin.
Not only was Hyperspin a superior looking front-end, it would allow me to run many different emulators including a NES and SNES emulator. Hyperspin does most of its configuration through GUIs and XML files. Below is a image of the cabinet 90% complete running PAC-MAN.
Hyperspin also allowed for configuring other applications to open from within it. I configured it to run Aussie Juke as one of the emulators. Also, after reading a comment by Moonlit on episode five of TheNewTech.tv, I decided to modify the registry entry for explorer.exe to boot to Hyperspin. HKEY_Current_User\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell
There are several things I have to do to complete this project. First, I need to finish the marquee. The marquee will end up being a cylon eye covered by a tinted plexiglass. Second, I need to mount the pc hardware inside the cabinet. I currently have it connected to PC tower.
On an episode of Hak5 they discussed setting up a garage door to be opened with a mobile device. Unfortunately, the audio was missing on the section where they discussed building/configuring the actual hardware to operate the garage door. This episode inspired me to start working on some home automation that could be accessed with any internet capable device without the need to install any software on the device. I wanted to be able to control several lights throughout my house and my garage.
I decided to use x10 to give me a starting point.
X10 is an international and open industry standard for communication among electronic devices used for home automation, also known as domotics. It primarily uses power line wiring for signaling and control, where the signals involve brief radio frequency bursts representing digital information. A wireless radio based protocol transport is also defined – wikipedia
Follow the wiring schematics below for wiring your Arduino to an RJ11 Jack.
Data Pin = Pin 8
Zero Crossing Pin = Pin 9
First, wire the 5v connection on the Arduino to the 10KΩ resistor. This will be wired to the data pin 8. Second wire data pin 8 to the black wire on the RJ 11 surface jack. Wire the green and red wires on the RJ11 surface jack together and wire them to the ground pin on the Arduino. Finally wire the data pin 9 to the yellow wire on the surface jack (sometimes you may have to swap the data pin and the zero crossing pin depending on if the RJ11 cord is a cross over or not)
Push the arduino/x10House.pde to the arduino. This code reads data in the form of ascii characters over the USB. It converts the characters into x10 byte codes that are used with the x10 Library. It then uses the x10 Library to push x10 commands out to the PSC04 moudle over RJ11.
Step 2: Configuring the Webserver
A webserver running PHP with an open USB port is required. I used a LAMP server running Ubuntu 11.04. Drop the contents of www from my github repository into your active web directory. Inside index.php you must set $serialPath to the path that your arduino is connected to. For example
$serialPath = “/dev/ttyUSB0″;
If your using Apache as your webserver you must allow Apache to write to that path name.
sudo chgrp www-data /dev/ttyUSB0
sudo chmod 775 /dev/ttyUSB0
The web application reads config files to display certain x10 actions. When viewing the web application you need to make sure userName set. For example:
This will then use john.xml as the config file. The config file determines what stuff you can control.