Donut Guard is on duty!

I brought a donut to work for a snack. But I was worried about… DONUT THIEVES!

So I did something about it using a Particle Core with a PIR.

The Core detects motion, and sends events up to the Cloud.

On my laptop, I have a nodejs app that subscribes to those events. And when motion is detected, it shouts a warning to the would-be thief!

1 Like

Well done and made me laugh.
Are there any good Nodejs tutorials out there for subscribing and all that? Assuming someone has NO nodejs or js experience for that matter? I am pretty good at hacking other people’s stuff together but haven’t seen anything that was approachable.

1 Like

When I get time, I’ll write something up. I can tell you that the main stumbling block I hit was that while most of the sparkjs library uses promises, the device.subscribe() and spark.getEventStream() methods do not – they expect a function parameter. I spent hours wondering why my code was throwing exceptions saying undefined is not a function.

Very nice!