Skip to content

Instantly share code, notes, and snippets.

View ahicham-xyz's full-sized avatar
🐢

Abdelilah ahicham-xyz

🐢
View GitHub Profile
@ahicham-xyz
ahicham-xyz / nespresso_expert_hack.md
Created September 16, 2023 12:58 — forked from farminf/nespresso_expert_hack.md
Hacking Nespresso Expert Machine to brew coffee using custom applications via bluetooth

Nespresso Expert machine Hack (Bluetooth)

Nespresso Expert machine has the Bluetooth ability which officially can be used only by Nespresso mobile app and it does not offer any API for 3rd party applications and services. Moreover, the Bluetooth services and characteristics are not documented and easy to use by the other Bluetooth libraries plus there is no documentation for the Bluetooth packets payload that need to be sent or received.

However, after searching a lot and sniffing the packets for a couple of days, I've been able to hack the machine and write the small nodejs application using noble and express to control and monitor the machine with Rest API exposed by express through Bluetooth connection. As I did this application for my ex-company and they are still using it for their demo I cannot share the code but I'm going to explain how it works.

_Thanks to this

@ahicham-xyz
ahicham-xyz / gist:e270dc79fed9304303199c872288a738
Last active September 3, 2023 20:14
A simple React Data Fetching hook from a project I did where data is fetched from the https://rawg.io/ REST API with React Query.
import { useInfiniteQuery } from "@tanstack/react-query";
import ms from "ms";
import APIClient, { FetchResponse } from "../services/api-client";
import useGameQueryStore from "../store";
import Game from "../entities/Game";
const apiClient = new APIClient<Game>("/games");
const useGames = () => {
const gameQuery = useGameQueryStore((s) => s.gameQuery);