I am trying to tackle building a smartphone garage door opener as shown in Makezine.com. I would like to control it using the Blynk app but cannot figure out how to make the code work. I have copied and pasted the code provided directly into the “particle builder” as shown in the article, but keep getting errors. I know not a thing about writing / reading code, but I do know after a day of pulling my hair out it is not as “easy” as the writeup claims! My opener works great using the “tinker” function from the photon so I know that part is correct. I can open and close the door using the D0 output pin to function the relay that signals the opener. Someone please point me in the right direction, write me a code that works, show me the error of my ways. I doubt I will dig any deeper into these IOT projects than this. I just want my garage door to open and close when i push the button on my smartphone…
Welcome to the community!
- don’t put Auth tokens on the wide open web. Not a great idea, unless you fancy people opening your garage from the other side of the planet. Just sayin’…
- It appears that you haven’t imported the blynk library. Click the libraries tab in the IDE and search for the blynk library. Select that, and then click “include in app”, select your app, and finally click “add to this app”. At this point, you’ll likely see the
$include "blynk/blynk.h"twice, of which you may remove one.
It’s mentioned in the article as well:
- On the left side of the Build system, click the icon that looks like a bookmark or chimney — it all just depends on your perspective. This loads the library browser that’s built into the Particle system.
- Scroll down to the Community Libraries section and input Blynk in the search field. Then click on the Blynk result.
- Tons of libraries will populate your browser, but don’t worry. Look for the Include in App button and click it. All this does is adds the #include “blynk/blynk.h” to your sketch.
Try compiling that and see if it works
Also, Don’t give up on the IoT world. Once you get going, you’ll never want to go back. It’s not too hard to learn, can be really fun, rewarding, and actually useful
Thank you Moors7! It is all working perfectly, and thanks for the advice about the Auth tokens. Token refreshed, code successfully compiled, flashed, and now running on the Blynk app. You are also correct about not ending here. next project will be adding door position sensors. Thanks again.
I am having the same problem with the code. I am new to this as well.
@esbam2, it would be good to explain what you mean by “same problem” along with what you’ve tried, the version of firmware, etc.