Back from Holiday!

I’m back from holiday and have updated the gate opener code.  I’ve changed my github username so the code is now at   There is a few changes:-

  • Added an iOS client.  This is pretty basic (no design) but has a button to open and a geo-fenced area to allow the opening to happen automatically as you get near to the gate.  In the setup you can add the shared secret for the Arduino and set the centre of the geo fence.  The fence is set to 8 meters at the moment but I’ll look to add a slider to widen this in the future (a non round geofence would also be cool).
  • Fixed up the Arduino code.   On review of the Arduino code today there was a lot of issues.  These included invalid checking, not reading the post parameters correctly and few other issues.   I’ve fixed these up now however the code needs tidying up.  The code was originally based on the example web server for the Arduino Ethernet shield which I think has caused some issues, if I have some time I’m going to re-write from scratch…..

I’ll post the hardware pictures in a future post.



Gate Opener

I’ve posted a new project to github (   The aim of this project is to make my driveway gate open as I drive up to it.   It works by using geo fencing on my phone to detect that I am close to my house and then send a message to an Arduino with ethernet shield to open the gate.   The opening it self is done with a spare gate remote that has had the switch replaced with a MOSFET.   This project is still in progress.

The key thing about this project was to make sure that only some one with a correct code can open the gate.   To do this there is a few steps:-

  1. Both the Arduino and the phone have a shared secret key
  2. The phone requests a token from the Arduino
  3. The token is appended with the command (‘open’ string) and an HMAC digest is created with the token
  4. The digest is sent as a POST parameter to the Arduino
  5. The Arduino re-creates the digest and verifies the received digest matches
  6. The gate is open (sends a 500ms pulse to the MOSFET gate to open the switch).

The above scheme should prevent any replay attacks as all of the requests are unencrypted (there is no SSL for Arduino).    There is also a test Python bottle server and test bash scripts to test both sides of the communications (in the webapp folder).

There has been a few issues with the MOSFET circuit which I will fix in the next few days and post!