- Simple user identification + drink identification with minimum input and feedback
- User input via touch and visual feedback plus optional audio feedback
- Locking / Unlocking a fridge
- Stage 1
- Ras-PI (Any generation)
- SD-Card (4GB+ is recommended)
- Charger + Cable
- Camera module
- 3 different colored LEDs (YELLOW, GREEN and RED)
- Hardware button
- Ras-PI (Any generation)
- Stage 2
- Touchscreen
- Stage 3
- Locking mechanism
- Solenoid
- "Key hole" (maybe)
- Case
- Locking mechanism
- raspistill - Take image (Installed by default)
- zbarimg - Scan barcode (Installable via sudo apt install zbar-tools)
- Install Raspbian Lite image via Raspbian Imager
- Create /boot/ssh to activate sshd (ssh server)
- login via
ssh pi@IP
- Run
sudo raspi-config
in ssh session and select the following
- Interface
- Enable camera
- Finish
sudo reboot
to make sureraspi-config
properly applied everything
The codebase allows switching into different operation modes via build-tags.
Those can be supplied by running the desired go command with the -tags
flag.
Possible values for tag are dummy
, test
.
The test
tag is required for unit tests, while the dummy
tag is required
for manual testing.
Examples:
go run . # run normally on a raspberry pi
go run -tags dummy .
go test -tags test ./...
Attemping to run the unit-tests on the raspberry pi would require user interaction and is currently not supported.
Running with dummy
enabled will ask for user input, whenever the program
would interact with any raspberry pi hardware, such as GPIO ports or a camera.
During input querying, the application can't be killed via Ctrl-C. Instead
Ctrl-D can be used. The SIGTERM and SIGINT signals will still be caught if
sent any other way, as these work via process and not the terminal input.
These values can also be set in VS Code, in order to let the go language server
know which tags to use. Simply edit the go.buildTags
value in
.vscode/settings.json
. These changes affect the compiler, the linter and
other go tools, even documentation popups.
- Initialize purchasing process (via button press for example)
- Parse Ident-Card to identify user
- Parse barcode of drink to know price
- Send both to MeMate in order to confirm the purchase
- Manually add
Ident-Card
code to userprofile in MeMate - Print
Ident-Card
barcode - Glue barcode onto
card
(cardboard)
- Save bardcode for each drink
- Save
Ident-Card
barcode for each user - Allow purchasing a drink via
Ident-Card
barcode and drink barcode - Optional
- Generate
Ident-Card
barcode image (could be external tool as well)
- Generate
The idea with this workflow is to have different signals in different stages and allow the user to have some failures inbetween. This makes sure that user doesn't have to rerun stage one when failing stage two. This concept does not yet take acconut for any failures during server communication.
- Wait for button press
- Wait 2s
- Set LED BLUE for "waiting for identification barcode" indication
- Wait 1.5s
- Take picture
- Set LED NONE
- Parse image for barcode
- If fail { if failcount == 10 { GO TO 1. } else { BLINK RED 500ms; GO TO 2. } }
- Set LED MAGENTA for "waiting for drink barcode" indication
- Wait 1.5s
- Take picture
- Set LED NONE
- Parse image for barcode
- If fail { if failcount == 10 { GO TO 1. } else { BLINK RED 500ms; GO TO 8. } }
- Set LED GREEN
- Wait 3s
- Set LED NONE
- GO TO 0.