Controlling a garage door remote

Yes, exactly. Choosing not to use the cloud meant that I had to implement my own AES based secure communication channel. This was actually quite convenient, b/c Spark Core firmware already includes TropicSSL library, which had everything I needed. The biggest challenge was actually generation of enough entropy to create good random numbers, but I think that is solved now.

The reason for not using the cloud was two-fold. First, this was an educational project, which I wanted to use to increase my understanding of cryptography and authentication algorithms.

Second, I am concerned about man-in-the-middle type replay attacks, and I am still not clear if Spark's implementation of OAuth2 properly implements token expiration after every request. I am not saying that it doesn't, and section 4.1.2 of OAuth2 RFC does say that if an authorization code is used more than once, the authorization server MUST deny the request, but I could not easily find the code that does this when I looked here: GitHub - particle-iot/spark-server: UNMAINTAINED - An API compatible open source server for interacting with devices speaking the spark-protocol

Perhaps someone who knows these details can provide a clarification?

I also felt that architecturally speaking, it is simpler not to use the cloud in a situation where I can easily distribute a shared key and communicate directly. And since I implemented my secure channel as a modular library, it is now trivial to use it in any other project that wants p2p communication like this - just include the library, implement a MessageConsumer, implement a CommunicationChannel and you are good to go.

3 Likes

Iā€™ve been working on a garage door monitor based upon the code posted a while ago by @austinpe. I added the ability to email a warning after either door is open for 20 minutes. Unfortunately, my time has been spent trying to incorporate email code posted by @BDub, but it isnā€™t reliable enough to use in real life, so I will start from scratch and switch over to using Pushingbox or Atomiot to get email alerts. Has anyone else done a garage project that does alerts?

vace117, awesome, thanks for the detailed explanation!
Gustavo.

And hereā€™s the full Instructable, as promised:

1 Like

Alright so finally got around to taking some pictures and cleaning the code up, now this was my first Arduino project and is yet to be ported to Spark

Now most peoples code simply blindly opens or closes the door, or fails to know the actual state of the doorā€¦ My code uses two reed switches to determine if the door is open or closed, as well as confirming if the door reaches its destination state (eg. door does not close correctly due to something blocking its path)

As I am in a rental house (unable to make changes), and the operator is quite old (unable to find the connections in the box) I have opted to open the remote and hook into the button

As this is designed for an Arduino Uno, it uses a serial command to operate, so DOOR OPEN will open the door is the door is not currently open, and DOOR CLOSE for the obvious, DOOR STATUS is used to change the status of the door.

Once I get my Spark Core I will port the code and design a web interface for it

Fritz Diagram and Photos - https://www.dropbox.com/sh/67xzdvevv4q5av1/AAAWVbuvDMsKM0EiSII_nrTHa?dl=0
Code - https://github.com/semaja2/Arduino-Roller

vace117,
it was great to read your project, you made everything super-clear

+1 for providing me with the links to abra electronics with local prices! :wink:

semaja2,

thanks for the pics.
great idea on using the same half of the reed switch for sensing the open/close position!
Iā€™m going to use it in my garage :wink:

@gusgonnet I would also suggest not making the same mistake I didā€¦ I put the reed sensors on before the magnetā€¦ had to reposition them after installing them :frowning: that being said the magnet on mine is also held in place by some plastic from a milk container :stuck_out_tongue: this allows it to bend and push closer to the reed switch as my roller door rails have a lip that makes it hard to get the magnet close

Would love to see more of what people have done, seems like everyone wants to do this project

thanks for the tip on placing the reed magnet.
For the plastic placer, I am still more inclined to use a coffee container :wink: hehehe

just in case it helps someone, I got around to document my garage remote:

Missing master_key.h file

I am trying to compile the GarageOpenerSpark-master code on OSX and the compiler is complaining that it canā€™t find master_key.h. Which library is this included from?

Thanks<