Skip to content
/ bartender Public

The 24i bartender code repository, contains both control application and IOT server

Notifications You must be signed in to change notification settings

24i/bartender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 

Repository files navigation

24i Bartender

This repository contains code for the 24i bartender (both pi & application). The app folder contains the React Native frontend app and the pi folder contains all code handling the actual hardware control.

PI API

/pumps

GET

Retrieves a list of all pumps and drinks attached to it.

Response example

[
    {
        "id": 1,
        "drink": "vodka"
    },
    {
        "id": 2,
        "drink": "UNKNOWN"
    },
    {
        "id": 3,
        "drink": "UNKNOWN"
    },
    {
        "id": 4,
        "drink": "UNKNOWN"
    },
    {
        "id": 5,
        "drink": "UNKNOWN"
    },
    {
        "id": 6,
        "drink": "UNKNOWN"
    },
]

PUT

Allows to attach a drink to a pump.

Request body example

{
    "id": 2,
    "drink": "gin"
}

Response 400 error example

{
    "message": "This pump can not be set"
}

Response 200 example

{
    "message": "Pump updated"
}

/recipes

GET

Retrieves a list of recipes available on the server

Response 200 example

[
    {
        "id": 1,
        "name": "moscow mule"
    }
]

POST

Request body example

{
    "name": "gin tonic",
    "parts": [
        {
            "drink": "gin",
            "percentage": 50
        },
        {
            "drink": "tonic",
            "percentageg": 50
        }
    ]
}

Response 200 example

{
    "message": "Recipe created"
}

/pour

POST

Starts pouring a given drink

Request body example

{
    "amount": 330,
    "parts": [
        {
            "drink": "gin",
            "percentage": 50
        },
        {
            "drink": "tonic",
            "percentageg": 50
        }
    ]
}

Response 400 example

{
    "message": "Non compatible drink"
}

Response 200 example

{
    "message": "Drink pour started"
}

Raspberry PI pinout

Pump Pins

Pin Description
17 Pump 1
27 Pump 2
22 Pump 3
23 Pump 4
24 Pump 5
25 Pump 6

LED Pins

Pin Description
16 Red
20 Green
21 Blue

About

The 24i bartender code repository, contains both control application and IOT server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published