← Back to overview

📖 Cocktail machine: manual

This manual explains how to get the cocktail machine running, set it up, use it and maintain it.

Contents:
1. Initial commissioning 2. The interface 3. Setup 4. Creating drinks 5. Dispensing a drink 6. Wi-Fi & standalone 7. Tablet kiosk 8. Safety & emergency stop 9. Hardware / pins 10. Troubleshooting

1. Initial commissioning

You need Rust with the ESP toolchain (espup install), plus espflash and ldproxy.

  1. Copy the template .cargo/config.toml.example to .cargo/config.toml and enter WIFI_SSID and WIFI_PASS there.
  2. Run cargo run --release in the project folder. The firmware is then transferred to the ESP32 via USB.
  3. In your browser, open http://cockimate/ or the IP address shown in the serial monitor.
The machine only works with 2.4 GHz Wi-Fi, not with 5 GHz-only networks. If it cannot find a router, it opens its own Wi-Fi network “Cockimate” (see section 6).

2. The interface

Guests see only the drink selection, plus the status, the cog ⚙️, the homing symbol 🏠 and the emergency stop.

Tap the cog ⚙️ and enter the password (default 1234). This reveals the German-labelled tabs Getränke, Einrichtung, Manuell and Skripte. The lock 🔒 locks the menu again.

The password is set in src/servo-control-migrated.html (SETUP_PASSWORD). It keeps guests from changing settings but is not real access protection.

3. Setup

In the Einrichtung (setup) tab, you teach the machine its positions once:

  1. Homing: Press “🏠 X referenzieren” and “🏠 Z referenzieren” (home X, home Z). The axes then move to their zero point.
  2. Teaching the slots: Use the jog panel to move the carriage under slot 1 and press “📍 X übernehmen” (apply X). Repeat this for all 6 slots and choose mechanism or pump for each, labelled Mechanismus or Pumpe. For a pump, the Z position has to be taught as well.
  3. Z release height: Raise Z until the mechanism triggers reliably, then apply the height.
  4. Dispensing position: If you like, teach a separate dispensing position. Otherwise every drink ends at the zero point.
  5. Times & dosing: Set the hold time, pause, return stroke and pump run time per portion.
  6. At the very bottom, press “Einstellungen speichern” (save settings).
Each stroke dispenses about 20 ml of liquid. Measure this on your machine and adjust “ms pro Portion” (ms per portion) for pumps.

4. Creating drinks

Under Einrichtung → Getränke verwalten (setup → manage drinks) press “➕ Neues Getränk anlegen” (create new drink). Choose a name, icon and recipe (“slot × portions”), tap “✔ Getränk übernehmen” (apply drink) and then “Getränkeliste speichern” (save drink list).

The supplied sample drinks can be edited or deleted.

5. Dispensing a drink

In the Getränke (drinks) tab, tap a tile and confirm. As soon as “Fertig! 🥂” (done) appears, you can take the glass.

Homing from the main screen: If “Referenzfahrt nötig, hier tippen” (homing required, tap here) appears, tap it. The machine moves Z clear first, then X. This also works without a password.

6. Wi-Fi & standalone

Router mode (default): The machine uses the Wi-Fi set in .cargo/config.toml.

Standalone mode: Under Einrichtung → Netzwerk (setup → network) switch the mode and press “Speichern & neu starten” (save & restart). Then connect to the Wi-Fi network “Cockimate” (password cocktail123) and open http://192.168.71.1/.

If Android reports “no internet”, confirm “keep connection”.

7. Tablet kiosk

Set up a kiosk browser app on an Android tablet, for example “Fully Kiosk Browser”. Enter the machine's address as the start page and switch on full screen and “keep screen awake”.

8. Safety & emergency stop

The red NOT-AUS (emergency stop, also via ESC) stops the motors and the pump immediately and discards pending commands. Then press “Fortsetzen” (continue) in the Manuell tab and home the machine again.

Important: The software emergency stop is no substitute for a hardware emergency stop that cuts the motor supply. If people can reach moving parts, a real emergency stop button in the power supply line is strongly recommended. Operation at the user's own risk.

Further protection comes from software end stops, speed limits, aborting a failed homing run, debounced limit switches and limited queues.

9. Hardware / pins

AxisFunctionGPIO
XStep / Dir / Enable / limit switch32 / 33 / 14 / 21
ZStep / Dir / Enable / limit switch25 / 26 / 27 / 22
-Pump relay (HIGH = on)19

The pins are defined in src/main.rs (section “HARDWARE-SETUP”), travel and limits in src/config.rs. If an axis moves the wrong way, flip X_DIR_INVERTED or Z_DIR_INVERTED in src/config.rs accordingly.

10. Troubleshooting

The machine does not show up on the Wi-Fi network.

Check the SSID and password in .cargo/config.toml and make sure the network uses 2.4 GHz. The IP address is shown in the serial monitor. If all else fails, connect to the “Cockimate” Wi-Fi network.

A drink does not start (“Slot X nicht eingelernt”: slot X not taught).

Open Einrichtung, teach the missing position or Z height and save.

The pump does not run.

Check that the slot is set to “Pumpe” (pump), that the relay is connected to GPIO 19 and that “ms pro Portion” has a sensible value.

Positions are wrong after switching on.

Run a homing cycle. The taught slots stay saved.