Reverse-engineering Nespresso Prodigios ble interface and creating flask api on Raspberry pi 4 (4gb).
Contributions are very welcome.
Running the solution:
- Build docker image
- Kill bluez on host machine:
sudo killall -9 bluetoothd
(see source 5) - Run docker container:
docker run --rm --net=host --privileged -it myimage:mytag
The api currently support /status
(current status of nespresso machine e.g. "OK", "Brewing..." or "Slider error") and /brew/<string:brew_type>
for brewing coffee.
- Add support for remaining machine alarms and status codes.
- Cleanup and commenting of code :)
- Use Class to handle machine state instead of dict.
- Performing a reverse enigneering on a similar nespresso machine: https://gist.github.com/farminf/94f681eaca2760212f457ac59da99f23
- Apples packetLogger tool for sniffing auth token from ble traffic: https://www.bluetooth.com/blog/a-new-way-to-debug-iosbluetooth-applications/
- A Python module which allows communication with Bluetooth Low Energy devices: http://ianharvey.github.io/bluepy-doc/index.html
- Project structure and code is heavly based on this EQ3 Bluetooth smart thermostats cli using bluepy: https://github.com/rytilahti/python-eq3bt
- Running bluez and exposing hci to Docker container: https://stackoverflow.com/questions/28868393/accessing-bluetooth-dongle-from-inside-docker
- Using ble on ubuntu (raspberry pi): https://raspberrypi.stackexchange.com/questions/114586/rpi-4b-bluetooth-unavailable-on-ubuntu-20-04