6 ms·
Show HN: Hacking Bluetooth to brew coffee in GitHub actions
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).
- deleted 4y ago[deleted]
- jonas-w 4y agoThank 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.
- a_t48 4y agoNow you just need a 6DOF robot arm to ensure there's always a cup waiting. :)
- napolux 4y agoand water refiller and cleaner for the used coffee
- jacob019 4y agoNeed a REST API to implement HTTP 418 I'm a teapot https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/418 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_Control_Protocol https://en.m.wikipedia.org/wiki/Hyper_Text_Coffee_Pot_Contro...
- lakomen 4y agoyou beat me to it, https://go.dev/src/net/http/status.go https://go.dev/src/net/http/status.go
- flaviut 4y agoI 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
- dbrgn 4y ago"btleplug is a pleasure to use". I see what you did there :)
- witcher01 4y agoI'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 https://docs.rs/bluez-async/0.6.0/bluez_async/index.html [2]: https://docs.rs/btleplug/0.10.4/btleplug/index.html https://docs.rs/btleplug/0.10.4/btleplug/index.html [3]: https://github.com/deviceplug/btleplug/blob/d6d8ba5486eba5d78e5f5df6ddd632036b14f4de/Cargo.toml#L41 https://github.com/deviceplug/btleplug/blob/d6d8ba5486eba5d7...
- poidos 4y agoGreat read, lovely to see this type of hacking done. Thanks for sharing your excellent writeup!
- duped 4y agoI'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
- jawmes8 4y agoIntriguing work! I hadn’t realized they made grinder/brew combo machines… Building a GUI or TUI would be a fun addition too!
- GOATS- 4y agoThey did! The action uses a CLI app they wrote.
- gnull 4y agoMaking good coffee needs to be done manually, you gotta put your soul into it. Where's soul in GitHub actions?
- lysecret 4y agoJust put it as an environment variable.
- rkachowski 4y agoanima ex machina
- turtleyacht 4y agoLook at all the failed runs, over and over, figuring out how to get it to work to that first green checkmark.
- JTbane 4y agopass soul as an argument to brew(), and I hope no one mentions dependency injection
- muhehe 4y agoWell, 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
- epse 4y agoAnd mostly, you have to put a mug under it. But now he doesn't rely on Delonghi supporting their app anymore
- hackcasual 4y agoNow to just add it to Home Assistant
- napolux 4y agoOH, 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
- frippertronics 4y agoI'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.
- mmastrac 4y agoI didn't want to go too deeply into it, but the protocol definitely has a lot of issues.
- nonrandomstring 4y agoPerhaps it is coffee [1,2], not porn, that is the principle hidden driver behind digital progress. [1] https://www.bbc.com/news/technology-20439301 https://www.bbc.com/news/technology-20439301 [2] https://en.wikipedia.org/wiki/Hyper_Text_Coffee_Pot_Control_Protocol https://en.wikipedia.org/wiki/Hyper_Text_Coffee_Pot_Control_...
- hnlmorg 4y agoAlso the “hello world” of 3D modelling: https://en.m.wikipedia.org/wiki/Utah_teapot 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).
- tgv 4y agoI'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.
- borbulon 4y agoInteresting stuff! Now I just need to find your repo. > the eye-watering price. > $1,699.99 (Was $2,099.99, -19%) F@&$ing hell
- borbulon 4y agoSorry 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.
- mmastrac 4y agoI'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.
- borbulon 4y ago> (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?
- mmastrac 4y agoIt'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.
- 752963e64 4y ago
- jstrebel 4y agoAwesome! 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.