Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Hacking Bluetooth to brew coffee in GitHub actions (grack.com)
168 points by mmastrac on Dec 6, 2022 | hide | past | favorite | 35 comments
This is my adventure reverse engineering a De'Longhi coffeemaker's Bluetooth-Low-Energy-based protocol, writing a rust CLI for it, and hooking it up to GitHub actions to let us brew from either the browser or the GitHub app by filing issues (all the coffee are defined in issue templates).



Need a REST API to implement

    HTTP 418 I'm a teapot
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/418

Or maybe even the whole the Hyper Text Coffee Pot Control Protocol (HTCPCP)

https://en.m.wikipedia.org/wiki/Hyper_Text_Coffee_Pot_Contro...



I want to shout-out the btleplug library again.

I've tried to work with several different BTLE libraries in the past, and I've always had a ton of problems.

btleplug works flawlessly, has as good of an API as is possible given the intrinsic complexity, and is a pleasure to use.

Thank you btleplug team <3


I'm currently writing Rust for my bachelor thesis using bluez_async[1].

btleplug[2] is great, but at least on Linux I prefer using bluez_async directly, which btleplug is just an interface for there[3], to avoid one more layer of dependencies.

bluez_async is quite similar to btleplug, and, from my experience, if you know one you can use the other just fine.

[1]: https://docs.rs/bluez-async/0.6.0/bluez_async/index.html

[2]: https://docs.rs/btleplug/0.10.4/btleplug/index.html

[3]: https://github.com/deviceplug/btleplug/blob/d6d8ba5486eba5d7...


"btleplug is a pleasure to use". I see what you did there :)


I'm surprised the De'Longhi BLE protocol doesn't have _any_ replay attack protection. I get that making coffee isn't a safety-critical operation, but you could do some hilariously annoying denial-of-service on the communal coffee machines.


I didn't want to go too deeply into it, but the protocol definitely has a lot of issues.


Making good coffee needs to be done manually, you gotta put your soul into it. Where's soul in GitHub actions?


Just put it as an environment variable.


Look at all the failed runs, over and over, figuring out how to get it to work to that first green checkmark.


pass soul as an argument to brew(), and I hope no one mentions dependency injection


anima ex machina


I'd be wary of exposing a heating element to the internet

But I also love coffee so you should send this to James Hoffman and see if he'll do a video on it


Now you just need a 6DOF robot arm to ensure there's always a cup waiting. :)


and water refiller and cleaner for the used coffee


Well, you have to make sure there is coffee, water, cup and perhaps milk present. You have to clean it regularly. I don't think this is very useful in the end.

That said, it's super cool, I'm sure the author enjoyed this and I myself would definitely try to do it too, if I had a chance :D


And mostly, you have to put a mug under it. But now he doesn't rely on Delonghi supporting their app anymore


Interesting stuff! Now I just need to find your repo.

> the eye-watering price.

> $1,699.99 (Was $2,099.99, -19%)

F@&$ing hell


Perhaps it is coffee [1,2], not porn, that is the principle hidden driver behind digital progress.

[1] https://www.bbc.com/news/technology-20439301

[2] https://en.wikipedia.org/wiki/Hyper_Text_Coffee_Pot_Control_...


I'll tell you my theory: it is (or at least, was, for a long time) gaming. There are so many gamers, and they bought expensive hardware, and replaced it frequently. That made developing processors and video cards pretty lucrative. Hence GPU-based neural nets and Bitcoin miners.


Also the “hello world” of 3D modelling:

https://en.m.wikipedia.org/wiki/Utah_teapot

(Ok, technically that is a tea pot. but the two do share a common design an form factor).


Awesome! There is a whole world of Bluetooth devices waiting out there!

Some suffer from broken or outdated Android apps like my Eurochron A620 bluetooth thermometer - the only way to make it work on a modern Android version is to hack it like the OP did. (If only old apps would make their source code publicly available...)

So this article is very much appreciated.


Thank you very much, that was a good read. Not a long time ago i wanted to do something with ble and rust but it failed miserabily and barely found any documentation for ble on rust, some also said that "rust isn't bluetooth yet". Will definitely give it a try again after seeing that rust can do it.


Now to just add it to Home Assistant


OH, THIS IS THE SAME EXACT COFFEE MACHINE I OWN.

THANKS FOR THIS.

Now I just need to have a robot putting cups under the dispenser


If you’re the only one using it and you’ve got at least two cups, you could place an empty cup each time you remove a full cup.


Or a Goldberg-esque contraption for automating that part of the process


HEY, I want to automatize everything.


Sorry for the double comment at the top level, but were you able to experiment with different values for taste, coffee, milk? Or does each recipe require constant values?

It may already be in your write-up, but if it is I missed it, sorry.


I've managed to brew a few custom coffees, including a comically over-sized cappuccino when I forgot to specify milk (apparently not including the ingredient means... use a lot of it?).

The application specifically allows you to program defaults and save beverages, so this is fully supported once you have the recipes decoded.


> (apparently not including the ingredient means... use a lot of it?)

to be fair, 0 = unlimited isn't an unheard of setting

yeah, that sounds like fun stuff to explore - playing with different values. How granular is it?


It's wildly precise - the coffee appears to be measured in "impulses", where a single impulse is somewhere < 5mL (if I were to guess - between 1-2). 250 impulses is juuuust enough to fill my coffee mug, but I think it varies a bit between modes.

The milk is measured in 1/10s of a second of flow, most likely because the volume depends on the foam setting.

I haven't gone as far as pushing the machine out of bounds intentionally, or even sending a parameter that's considered invalid yet.


Intriguing work! I hadn’t realized they made grinder/brew combo machines…

Building a GUI or TUI would be a fun addition too!


They did! The action uses a CLI app they wrote.


Great read, lovely to see this type of hacking done. Thanks for sharing your excellent writeup!


[deleted]




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: