How we hacked our coffeemaker using a Particle Photon and Meteor to show a live coffeecounter

We’ve had a live updating coffee counter on our About page since we launched our site in 2012. It started as a bit of client-side Javascript until I rewrote it at some point to calculate the figure on the server and then update it over a publication, but it was secretly never the actual number of cups of coffee we were drinking, since we hadn’t actually hooked up the coffeemaker. So we went and did that:

https://q42.com/blog/post/138082491543/hacking-the-coffee-machine

Read the post for all of the hardware hacking details, but here’s the specific paragraph where it crossed over into Meteor territory:

The photon firmware calls Spark.Publish which is set up by a JSON file to generate a preset HTTP call from the Particle cloud to our own IOT API. The JSON file couples an event name to a specific call to make—including REST method, HTTP headers, variables in URL or body, etc.

Our API server is a simple Meteor app that exposes a REST endpoint to dump events to, which get stored in a meteor collection. Then the website (and any other client for that matter) simply opens a DDP connection to the Meteor app and gets live updates. Doesn’t scale, certainly not to the extent we’ve achieved for our Q42 customer IoT infrastructures, but it’s elegant and maintainable through its extreme simplicity.

Has anyone else been messing around with hardware and Meteor hacks like this?

5 Likes

How does it scale :wink:

2 Likes

It doesn’t!

tl;dr? :wink: