mirror of
https://github.com/puzzle/lightning-beer-tap.git
synced 2025-12-17 07:04:21 +01:00
Merge branch 'master' of ssh.gitlab.puzzle.ch:lightning/pos-websocket-bridge
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -3,6 +3,8 @@
|
||||
!gradle/wrapper/gradle-wrapper.jar
|
||||
nohup.out
|
||||
websocket-bridge-0.0.1-SNAPSHOT.jar
|
||||
.gradle
|
||||
*.bak
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
|
||||
59
README.md
59
README.md
@@ -1,18 +1,64 @@
|
||||
# WebSocket Bridge for our LND enabled Beer Tap
|
||||
# Lightning powered beer tap
|
||||
|
||||
This project consists of multiple parts. To make things easier the `application.sh` provides a frontend to control everything. The different parts of the project are documented below.
|
||||
|
||||
## Parts list
|
||||
|
||||
To build your own lightning powered beer tap you'll need the follwing parts. We got most of our parts from distibutors located in switzerland, but you can get them anywhere you want.
|
||||
|
||||
| **Partname** | **Partnumber** | **Price / CHF** | **Distributor** |
|
||||
| :------------------------------ | --------------:| ----------------: | :------------------------ |
|
||||
| Raspberry Pi 3 B+ | 10760 | 39 | pi-shop.ch |
|
||||
| 32GB MicroSD Card | 6613018 | 29.9 | digitec.ch |
|
||||
| Original Rpi 7" Touchscreen | 10266 | 79.9 | pi-shop.ch |
|
||||
| PiggiPi 7’’ Display Mount | 10399 | 48.9 | pi-shop.ch |
|
||||
| Raspberry Pi Relay Board | 10398 | 24.9 | pi-shop.ch |
|
||||
| 24V AC Source (24W/50Hz) | 169-84-752 | 22.7 | distrelec.ch |
|
||||
| Beer tap with solenoid valve | 08.00125 | 247.3 | schankanlagenhandel.eu |
|
||||
| Bent faucet for beer tap | 08.00128 | 22.51 | schankanlagenhandel.eu |
|
||||
|
||||
## Installation
|
||||
|
||||
This is straightforward. If you bought an empty micro-sd card, just download the latest [Raspbian image](https://www.raspberrypi.org/downloads/raspbian/).
|
||||
* Fire up `dd` to load the image to your card.
|
||||
* Use `sudo raspi-config` to extend your partitions, start openssh and enable the gpios.
|
||||
* Follow the guide on [how to secure you raspberry pi](https://www.raspberrypi.org/documentation/configuration/security.md)
|
||||
* Once you've deployed your ssh key and secured your acces, clone this repo.
|
||||
* Install the necessary software to your pi by executing the following commands:
|
||||
```bash
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y openjdk-8-jre openjdk-8-jdk unclutter vim
|
||||
```
|
||||
* Add your user to the group `gpio`
|
||||
* You're all set and ready to go
|
||||
|
||||
# Aplication.sh start script
|
||||
|
||||
This script is used to start, stop or rebuild the application. Simple as that.
|
||||
The websocket bridge will be automatically builded if you run `start` without a
|
||||
previous build.
|
||||
|
||||
```bash
|
||||
$ ./application.sh start # starts the dashboard and websocket bridge
|
||||
$ ./application.sh stop # stops everything
|
||||
$ ./application.sh build # rebuilds the java websocket bridge
|
||||
```
|
||||
|
||||
# WebSocket Bridge
|
||||
|
||||
## build application
|
||||
```
|
||||
```bash
|
||||
./gradlew build
|
||||
```
|
||||
|
||||
|
||||
## how to run
|
||||
|
||||
get the built application from ./build/libs
|
||||
|
||||
```
|
||||
```bash
|
||||
java -jar websocket-bridge-0.0.1-SNAPSHOT.jar --url=wss://ln-self-order-pos-dev.ose3.puzzle.ch/websocket/invoice?access_token= --topic=/topic/invoice --command=./dummy_command.sh
|
||||
```
|
||||
|
||||
Options:
|
||||
|
||||
* url: the websocket to connect to
|
||||
@@ -40,6 +86,7 @@ To execute this python module the user has to be part of the group `gpio`.
|
||||
|
||||
## how to run
|
||||
|
||||
```
|
||||
python beerme.py --product=[large,small] [--test, --memo="asdf"]
|
||||
```bash
|
||||
$ python gpio_handler.py --product=[large,small] [--test, --memo="asdf"]
|
||||
$ python gpio_handler.py --help
|
||||
```
|
||||
|
||||
84
application.sh
Executable file
84
application.sh
Executable file
@@ -0,0 +1,84 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Java call parameters
|
||||
WEBAPP="wss://ln-self-order-pos-dev.ose3.puzzle.ch/websocket/invoice?access_token="
|
||||
OPTS="-Xms128M -Xmx128M -jar"
|
||||
JARFILE="websocket-bridge-0.0.1-SNAPSHOT.jar"
|
||||
JARPATH="websocket_bridge/build/libs/"
|
||||
TOPIC="/topic/invoice"
|
||||
COMMAND="./gpio_handler/gpio_handler.py"
|
||||
|
||||
usage(){
|
||||
cat << EOF
|
||||
Usage: $0 [OPTIONS]
|
||||
|
||||
This script handles all interactions with the lightning powered beertap.
|
||||
|
||||
OPTIONS:
|
||||
start Initializes the device, starts the dashboard and web bridge
|
||||
stop Stops all services
|
||||
build Build or rebuild the java web bridge to the lightning node
|
||||
|
||||
EXAMPLES:
|
||||
application restart
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
# Start all services on the beer tap device
|
||||
app_start(){
|
||||
# Check if the websocket bridge has been built
|
||||
if [ ! -f $JARPATH$JARFILE ]; then
|
||||
app_build
|
||||
fi
|
||||
# Start up the dashboard
|
||||
source dashboard/dashboard.sh
|
||||
# Hide mouse when still
|
||||
#DISPLAY=:0 unclutter -idle 0.01 -root &
|
||||
# Start websocket bridge, fork to background and no output
|
||||
nohup java $OPTS $JARPATH$JARFILE --url=$WEBAPP --topic=$TOPIC --command=$COMMAND & >/dev/null 2>&1
|
||||
}
|
||||
|
||||
# Stop all services
|
||||
app_stop(){
|
||||
echo "Killing all services..."
|
||||
killall java
|
||||
killall chromium-browser
|
||||
killall unclutter
|
||||
}
|
||||
|
||||
# Build or rebuild the java lighning node web bridge
|
||||
app_build(){
|
||||
echo "Building the websocket bridge please wait"
|
||||
cd websocket_bridge && exec ./gradlew build >/dev/null 2>&1
|
||||
}
|
||||
|
||||
|
||||
# Argument parsing
|
||||
case $1 in
|
||||
start)
|
||||
app_start
|
||||
exit 0;
|
||||
;;
|
||||
|
||||
stop)
|
||||
app_stop
|
||||
exit 0;
|
||||
;;
|
||||
|
||||
build)
|
||||
app_build
|
||||
exit 0;
|
||||
;;
|
||||
|
||||
restart)
|
||||
app_stop
|
||||
app_start
|
||||
exit 0;
|
||||
;;
|
||||
|
||||
*)
|
||||
usage
|
||||
exit 0;
|
||||
;;
|
||||
esac
|
||||
@@ -1,11 +1,11 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding:utf-8 -*-
|
||||
|
||||
#######################
|
||||
###################
|
||||
# P26 ----> r_ch1 #
|
||||
# P20 ----> r_ch2 #
|
||||
# P21 ----> r_ch3 #
|
||||
#######################
|
||||
###################
|
||||
|
||||
import RPi.GPIO as GPIO
|
||||
import argparse
|
||||
281
schematic/Beertap-cache.lib
Normal file
281
schematic/Beertap-cache.lib
Normal file
@@ -0,0 +1,281 @@
|
||||
EESchema-LIBRARY Version 2.4
|
||||
#encoding utf-8
|
||||
#
|
||||
# Device:D
|
||||
#
|
||||
DEF Device:D D 0 40 N N 1 F N
|
||||
F0 "D" 0 100 50 H V C CNN
|
||||
F1 "Device:D" 0 -100 50 H V C CNN
|
||||
F2 "" 0 0 50 H I C CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
$FPLIST
|
||||
TO-???*
|
||||
*_Diode_*
|
||||
*SingleDiode*
|
||||
D_*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
P 2 0 1 8 -50 50 -50 -50 N
|
||||
P 2 0 1 0 50 0 -50 0 N
|
||||
P 4 0 1 8 50 50 50 -50 -50 0 50 50 N
|
||||
X K 1 -150 0 100 R 50 50 1 1 P
|
||||
X A 2 150 0 100 L 50 50 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# Device:Electromagnetic_Actor
|
||||
#
|
||||
DEF Device:Electromagnetic_Actor L 0 1 N N 1 F N
|
||||
F0 "L" 50 150 50 H V L CNN
|
||||
F1 "Device:Electromagnetic_Actor" 50 -50 50 H V L CNN
|
||||
F2 "" -25 100 50 V I C CNN
|
||||
F3 "" -25 100 50 V I C CNN
|
||||
$FPLIST
|
||||
Inductor_*
|
||||
L_*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -100 100 100 0 0 1 10 N
|
||||
P 2 0 1 10 -50 100 50 0 N
|
||||
X - 1 0 200 100 D 50 50 1 1 P
|
||||
X + 2 0 -100 100 U 50 50 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# Device:LED
|
||||
#
|
||||
DEF Device:LED D 0 40 N N 1 F N
|
||||
F0 "D" 0 100 50 H V C CNN
|
||||
F1 "Device:LED" 0 -100 50 H V C CNN
|
||||
F2 "" 0 0 50 H I C CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
$FPLIST
|
||||
LED*
|
||||
LED_SMD:*
|
||||
LED_THT:*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
P 2 0 1 8 -50 -50 -50 50 N
|
||||
P 2 0 1 0 -50 0 50 0 N
|
||||
P 4 0 1 8 50 -50 50 50 -50 0 50 -50 N
|
||||
P 5 0 1 0 -120 -30 -180 -90 -150 -90 -180 -90 -180 -60 N
|
||||
P 5 0 1 0 -70 -30 -130 -90 -100 -90 -130 -90 -130 -60 N
|
||||
X K 1 -150 0 100 R 50 50 1 1 P
|
||||
X A 2 150 0 100 L 50 50 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# Device:R
|
||||
#
|
||||
DEF Device:R R 0 0 N Y 1 F N
|
||||
F0 "R" 80 0 50 V V C CNN
|
||||
F1 "Device:R" 0 0 50 V V C CNN
|
||||
F2 "" -70 0 50 V I C CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
$FPLIST
|
||||
R_*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -40 -100 40 100 0 1 10 N
|
||||
X ~ 1 0 150 50 D 50 50 1 1 P
|
||||
X ~ 2 0 -150 50 U 50 50 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# Device:Transformer_1P_1S
|
||||
#
|
||||
DEF Device:Transformer_1P_1S T 0 40 Y N 1 F N
|
||||
F0 "T" 0 250 50 H V C CNN
|
||||
F1 "Device:Transformer_1P_1S" 0 -300 50 H V C CNN
|
||||
F2 "" 0 0 50 H I C CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
DRAW
|
||||
A -100 -150 50 899 1 0 1 0 N -100 -100 -50 -150
|
||||
A -100 -150 50 -1 -899 0 1 0 N -50 -150 -100 -199
|
||||
A -100 -50 50 899 1 0 1 0 N -100 0 -50 -50
|
||||
A -100 -50 50 -1 -899 0 1 0 N -50 -50 -100 -99
|
||||
A -100 50 50 899 1 0 1 0 N -100 100 -50 50
|
||||
A -100 50 50 -1 -899 0 1 0 N -50 50 -100 1
|
||||
A -100 150 50 899 1 0 1 0 N -100 200 -50 150
|
||||
A -100 150 50 -1 -899 0 1 0 N -50 150 -100 101
|
||||
A 100 -50 50 899 -1799 0 1 0 N 100 0 51 -50
|
||||
A 100 -50 50 1799 -899 0 1 0 N 51 -50 100 -99
|
||||
A 100 50 50 899 -1799 0 1 0 N 100 100 51 50
|
||||
A 100 50 50 1799 -899 0 1 0 N 51 50 100 1
|
||||
A 100 150 50 899 -1799 0 1 0 N 100 200 51 150
|
||||
A 100 150 50 1799 -899 0 1 0 N 51 150 100 101
|
||||
A 101 -150 50 910 -1799 0 1 0 N 101 -100 52 -150
|
||||
A 101 -150 50 -912 -1799 0 1 0 N 101 -199 52 -150
|
||||
P 2 0 1 0 -25 200 -25 -200 N
|
||||
P 2 0 1 0 25 -200 25 200 N
|
||||
X AA 1 -400 200 300 R 50 50 1 1 P
|
||||
X AB 2 -400 -200 300 R 50 50 1 1 P
|
||||
X SA 3 400 -200 300 L 50 50 1 1 P
|
||||
X SB 4 400 200 300 L 50 50 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# Isolator:SFH617A-1
|
||||
#
|
||||
DEF Isolator:SFH617A-1 U 0 40 Y Y 1 F N
|
||||
F0 "U" -200 200 50 H V L CNN
|
||||
F1 "Isolator:SFH617A-1" 0 200 50 H V L CNN
|
||||
F2 "Package_DIP:DIP-4_W7.62mm" -200 -200 50 H I L CIN
|
||||
F3 "" 0 0 50 H I L CNN
|
||||
ALIAS SFH617A-1 SFH617A-2 SFH617A-3 SFH617A-4 SFH617A-1X001 SFH617A-2X001 SFH617A-3X001 SFH617A-4X001
|
||||
$FPLIST
|
||||
DIP*W7.62mm*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -200 150 200 -150 0 1 10 f
|
||||
P 2 0 1 10 -125 -25 -75 -25 N
|
||||
P 2 0 1 0 100 25 175 100 N
|
||||
P 2 0 1 0 175 -100 100 -25 F
|
||||
P 2 0 1 0 175 -100 200 -100 N
|
||||
P 2 0 1 0 175 100 200 100 N
|
||||
P 3 0 1 0 -100 -25 -100 -100 -200 -100 N
|
||||
P 3 0 1 20 100 75 100 -75 100 -75 N
|
||||
P 4 0 1 0 -200 100 -100 100 -100 -50 -100 25 N
|
||||
P 4 0 1 10 -100 -25 -125 25 -75 25 -100 -25 N
|
||||
P 5 0 1 0 -20 -20 30 -20 15 -25 15 -15 30 -20 N
|
||||
P 5 0 1 0 -20 20 30 20 15 15 15 25 30 20 N
|
||||
P 5 0 1 0 120 -65 140 -45 160 -85 120 -65 120 -65 F
|
||||
X ~ 1 -300 100 100 R 50 50 1 1 P
|
||||
X ~ 2 -300 -100 100 R 50 50 1 1 P
|
||||
X ~ 3 300 -100 100 L 50 50 1 1 P
|
||||
X ~ 4 300 100 100 L 50 50 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# Relay:FINDER-40.51
|
||||
#
|
||||
DEF Relay:FINDER-40.51 K 0 40 Y Y 1 F N
|
||||
F0 "K" 450 150 50 H V L CNN
|
||||
F1 "Relay:FINDER-40.51" 450 50 50 H V L CNN
|
||||
F2 "Relay_THT:Relay_SPDT_Finder_40.51" 1140 -40 50 H I C CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
$FPLIST
|
||||
Relay*SPDT*Finder*40.51*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
S -400 200 400 -200 0 1 10 f
|
||||
S -325 75 -75 -75 0 1 10 N
|
||||
P 2 0 0 0 100 150 100 200 N
|
||||
P 2 0 0 0 300 150 300 200 N
|
||||
P 4 0 0 0 300 150 300 100 275 125 300 150 N
|
||||
P 2 0 1 10 -300 -75 -100 75 N
|
||||
P 2 0 1 0 -200 -200 -200 -75 N
|
||||
P 2 0 1 0 -200 200 -200 75 N
|
||||
P 2 0 1 10 -75 0 -50 0 N
|
||||
P 2 0 1 10 -25 0 0 0 N
|
||||
P 2 0 1 10 25 0 50 0 N
|
||||
P 2 0 1 10 25 0 50 0 N
|
||||
P 2 0 1 10 75 0 100 0 N
|
||||
P 2 0 1 10 125 0 150 0 N
|
||||
P 2 0 1 20 200 -100 125 150 N
|
||||
P 2 0 1 0 200 -100 200 -200 N
|
||||
P 3 0 1 0 100 100 125 125 100 150 F
|
||||
X ~ 11 200 -300 100 U 50 50 1 1 P
|
||||
X ~ 12 100 300 100 D 50 50 1 1 P
|
||||
X ~ 14 300 300 100 D 50 50 1 1 P
|
||||
X ~ A1 -200 300 100 D 50 50 1 1 P
|
||||
X ~ A2 -200 -300 100 U 50 50 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# Transistor_BJT:2N2219
|
||||
#
|
||||
DEF Transistor_BJT:2N2219 Q 0 0 Y N 1 F N
|
||||
F0 "Q" 200 75 50 H V L CNN
|
||||
F1 "Transistor_BJT:2N2219" 200 0 50 H V L CNN
|
||||
F2 "Package_TO_SOT_THT:TO-39-3" 200 -75 50 H I L CIN
|
||||
F3 "" 0 0 50 H I L CNN
|
||||
ALIAS BC140 BC141
|
||||
$FPLIST
|
||||
TO?39*
|
||||
$ENDFPLIST
|
||||
DRAW
|
||||
C 50 0 111 0 1 10 N
|
||||
P 2 0 1 0 25 25 100 100 N
|
||||
P 3 0 1 0 25 -25 100 -100 100 -100 N
|
||||
P 3 0 1 20 25 75 25 -75 25 -75 N
|
||||
P 5 0 1 0 50 -70 70 -50 90 -90 50 -70 50 -70 F
|
||||
X E 1 100 -200 100 U 50 50 1 1 P
|
||||
X B 2 -200 0 225 R 50 50 1 1 P
|
||||
X C 3 100 200 100 D 50 50 1 1 P
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# power:+3.3V
|
||||
#
|
||||
DEF power:+3.3V #PWR 0 0 Y Y 1 F P
|
||||
F0 "#PWR" 0 -150 50 H I C CNN
|
||||
F1 "power:+3.3V" 0 140 50 H V C CNN
|
||||
F2 "" 0 0 50 H I C CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
ALIAS +3.3V
|
||||
DRAW
|
||||
P 2 0 1 0 -30 50 0 100 N
|
||||
P 2 0 1 0 0 0 0 100 N
|
||||
P 2 0 1 0 0 100 30 50 N
|
||||
X +3V3 1 0 0 0 U 50 50 1 1 W N
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# power:+5V
|
||||
#
|
||||
DEF power:+5V #PWR 0 0 Y Y 1 F P
|
||||
F0 "#PWR" 0 -150 50 H I C CNN
|
||||
F1 "power:+5V" 0 140 50 H V C CNN
|
||||
F2 "" 0 0 50 H I C CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
DRAW
|
||||
P 2 0 1 0 -30 50 0 100 N
|
||||
P 2 0 1 0 0 0 0 100 N
|
||||
P 2 0 1 0 0 100 30 50 N
|
||||
X +5V 1 0 0 0 U 50 50 1 1 W N
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# power:GND
|
||||
#
|
||||
DEF power:GND #PWR 0 0 Y Y 1 F P
|
||||
F0 "#PWR" 0 -250 50 H I C CNN
|
||||
F1 "power:GND" 0 -150 50 H V C CNN
|
||||
F2 "" 0 0 50 H I C CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
DRAW
|
||||
P 6 0 1 0 0 0 0 -50 50 -50 0 -100 -50 -50 0 -50 N
|
||||
X GND 1 0 0 0 D 50 50 1 1 W N
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# power:LINE
|
||||
#
|
||||
DEF power:LINE #PWR 0 0 Y Y 1 F P
|
||||
F0 "#PWR" 0 -150 50 H I C CNN
|
||||
F1 "power:LINE" 0 150 50 H V C CNN
|
||||
F2 "" 0 0 50 H I C CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
DRAW
|
||||
C 0 75 25 0 1 0 N
|
||||
P 2 0 1 0 0 0 0 50 N
|
||||
X LINE 1 0 0 0 U 50 50 1 1 W N
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
# power:NEUT
|
||||
#
|
||||
DEF power:NEUT #PWR 0 0 Y Y 1 F P
|
||||
F0 "#PWR" 0 -150 50 H I C CNN
|
||||
F1 "power:NEUT" 0 150 50 H V C CNN
|
||||
F2 "" 0 0 50 H I C CNN
|
||||
F3 "" 0 0 50 H I C CNN
|
||||
DRAW
|
||||
C 0 75 25 0 1 0 N
|
||||
P 2 0 1 0 0 0 0 50 N
|
||||
X NEUT 1 0 0 0 U 50 50 1 1 W N
|
||||
ENDDRAW
|
||||
ENDDEF
|
||||
#
|
||||
#End Library
|
||||
1
schematic/Beertap.kicad_pcb
Normal file
1
schematic/Beertap.kicad_pcb
Normal file
@@ -0,0 +1 @@
|
||||
(kicad_pcb (version 4) (host kicad "dummy file") )
|
||||
43
schematic/Beertap.pro
Normal file
43
schematic/Beertap.pro
Normal file
@@ -0,0 +1,43 @@
|
||||
update=Do 11 Okt 2018 14:34:52 CEST
|
||||
version=1
|
||||
last_client=eeschema
|
||||
[general]
|
||||
version=1
|
||||
RootSch=
|
||||
BoardNm=
|
||||
[pcbnew]
|
||||
version=1
|
||||
LastNetListRead=
|
||||
UseCmpFile=1
|
||||
PadDrill=0.600000000000
|
||||
PadDrillOvalY=0.600000000000
|
||||
PadSizeH=1.500000000000
|
||||
PadSizeV=1.500000000000
|
||||
PcbTextSizeV=1.500000000000
|
||||
PcbTextSizeH=1.500000000000
|
||||
PcbTextThickness=0.300000000000
|
||||
ModuleTextSizeV=1.000000000000
|
||||
ModuleTextSizeH=1.000000000000
|
||||
ModuleTextSizeThickness=0.150000000000
|
||||
SolderMaskClearance=0.000000000000
|
||||
SolderMaskMinWidth=0.000000000000
|
||||
DrawSegmentWidth=0.200000000000
|
||||
BoardOutlineThickness=0.100000000000
|
||||
ModuleOutlineThickness=0.150000000000
|
||||
[cvpcb]
|
||||
version=1
|
||||
NetIExt=net
|
||||
[eeschema]
|
||||
version=1
|
||||
LibDir=
|
||||
[eeschema/libraries]
|
||||
[schematic_editor]
|
||||
version=1
|
||||
PageLayoutDescrFile=
|
||||
PlotDirectoryName=
|
||||
SubpartIdSeparator=0
|
||||
SubpartFirstId=65
|
||||
NetFmtName=
|
||||
SpiceAjustPassiveValues=0
|
||||
LabSize=50
|
||||
ERC_TestSimilarLabels=1
|
||||
274
schematic/Beertap.sch
Normal file
274
schematic/Beertap.sch
Normal file
@@ -0,0 +1,274 @@
|
||||
EESchema Schematic File Version 4
|
||||
LIBS:Beertap-cache
|
||||
EELAYER 26 0
|
||||
EELAYER END
|
||||
$Descr A4 11693 8268
|
||||
encoding utf-8
|
||||
Sheet 1 1
|
||||
Title "Lightning Beertap"
|
||||
Date "2018-10-11"
|
||||
Rev "v1.0"
|
||||
Comp "Puzzle ITC"
|
||||
Comment1 ""
|
||||
Comment2 ""
|
||||
Comment3 ""
|
||||
Comment4 ""
|
||||
$EndDescr
|
||||
$Comp
|
||||
L Relay:FINDER-40.51 K1
|
||||
U 1 1 5BBE20CA
|
||||
P 6600 3500
|
||||
F 0 "K1" V 6033 3500 50 0000 C CNN
|
||||
F 1 "Relais CH1" V 6124 3500 50 0000 C CNN
|
||||
F 2 "Relay_THT:Relay_SPDT_Finder_40.51" H 7740 3460 50 0001 C CNN
|
||||
F 3 "http://gfinder.findernet.com/assets/Series/353/S40EN.pdf" H 6600 3500 50 0001 C CNN
|
||||
1 6600 3500
|
||||
0 1 1 0
|
||||
$EndComp
|
||||
$Comp
|
||||
L Device:Electromagnetic_Actor L1
|
||||
U 1 1 5BBE25DE
|
||||
P 8150 4400
|
||||
F 0 "L1" H 8021 4404 50 0000 R CNN
|
||||
F 1 "Solenoid Valve" H 8021 4495 50 0000 R CNN
|
||||
F 2 "" V 8125 4500 50 0001 C CNN
|
||||
F 3 "~" V 8125 4500 50 0001 C CNN
|
||||
1 8150 4400
|
||||
1 0 0 1
|
||||
$EndComp
|
||||
$Comp
|
||||
L Device:Transformer_1P_1S T1
|
||||
U 1 1 5BBE36D7
|
||||
P 5150 5000
|
||||
F 0 "T1" H 5150 4575 50 0000 C CNN
|
||||
F 1 "24V AC Transformator" H 5150 4666 50 0000 C CNN
|
||||
F 2 "" H 5150 5000 50 0001 C CNN
|
||||
F 3 "~" H 5150 5000 50 0001 C CNN
|
||||
1 5150 5000
|
||||
1 0 0 -1
|
||||
$EndComp
|
||||
$Comp
|
||||
L power:NEUT #PWR?
|
||||
U 1 1 5BBE3E9A
|
||||
P 4300 4600
|
||||
F 0 "#PWR?" H 4300 4450 50 0001 C CNN
|
||||
F 1 "NEUT" H 4317 4773 50 0000 C CNN
|
||||
F 2 "" H 4300 4600 50 0001 C CNN
|
||||
F 3 "" H 4300 4600 50 0001 C CNN
|
||||
1 4300 4600
|
||||
1 0 0 -1
|
||||
$EndComp
|
||||
$Comp
|
||||
L power:LINE #PWR?
|
||||
U 1 1 5BBE3E53
|
||||
P 4100 4600
|
||||
F 0 "#PWR?" H 4100 4450 50 0001 C CNN
|
||||
F 1 "LINE" H 4117 4773 50 0000 C CNN
|
||||
F 2 "" H 4100 4600 50 0001 C CNN
|
||||
F 3 "" H 4100 4600 50 0001 C CNN
|
||||
1 4100 4600
|
||||
1 0 0 -1
|
||||
$EndComp
|
||||
$Comp
|
||||
L Isolator:SFH617A-1 U1
|
||||
U 1 1 5BBE4FE3
|
||||
P 4750 3400
|
||||
F 0 "U1" H 4750 3725 50 0000 C CNN
|
||||
F 1 "Optocoupler" H 4750 3634 50 0000 C CNN
|
||||
F 2 "Package_DIP:DIP-4_W7.62mm" H 4550 3200 50 0001 L CIN
|
||||
F 3 "http://www.vishay.com/docs/83740/sfh617a.pdf" H 4750 3400 50 0001 L CNN
|
||||
1 4750 3400
|
||||
1 0 0 -1
|
||||
$EndComp
|
||||
$Comp
|
||||
L Device:R R1
|
||||
U 1 1 5BBE52D2
|
||||
P 4200 3150
|
||||
F 0 "R1" V 3993 3150 50 0000 C CNN
|
||||
F 1 "1k" V 4084 3150 50 0000 C CNN
|
||||
F 2 "" V 4130 3150 50 0001 C CNN
|
||||
F 3 "~" H 4200 3150 50 0001 C CNN
|
||||
1 4200 3150
|
||||
0 1 1 0
|
||||
$EndComp
|
||||
$Comp
|
||||
L Device:R R2
|
||||
U 1 1 5BBE5347
|
||||
P 3850 3400
|
||||
F 0 "R2" H 3780 3354 50 0000 R CNN
|
||||
F 1 "10k" H 3780 3445 50 0000 R CNN
|
||||
F 2 "" V 3780 3400 50 0001 C CNN
|
||||
F 3 "~" H 3850 3400 50 0001 C CNN
|
||||
1 3850 3400
|
||||
-1 0 0 1
|
||||
$EndComp
|
||||
$Comp
|
||||
L power:+3.3V #PWR?
|
||||
U 1 1 5BBE5426
|
||||
P 3850 2950
|
||||
F 0 "#PWR?" H 3850 2800 50 0001 C CNN
|
||||
F 1 "+3.3V" H 3865 3123 50 0000 C CNN
|
||||
F 2 "" H 3850 2950 50 0001 C CNN
|
||||
F 3 "" H 3850 2950 50 0001 C CNN
|
||||
1 3850 2950
|
||||
1 0 0 -1
|
||||
$EndComp
|
||||
$Comp
|
||||
L Device:LED D1
|
||||
U 1 1 5BBE5499
|
||||
P 4200 3650
|
||||
F 0 "D1" H 4191 3866 50 0000 C CNN
|
||||
F 1 "LED" H 4191 3775 50 0000 C CNN
|
||||
F 2 "" H 4200 3650 50 0001 C CNN
|
||||
F 3 "~" H 4200 3650 50 0001 C CNN
|
||||
1 4200 3650
|
||||
1 0 0 -1
|
||||
$EndComp
|
||||
$Comp
|
||||
L power:+5V #PWR?
|
||||
U 1 1 5BBE5A6B
|
||||
P 5050 2900
|
||||
F 0 "#PWR?" H 5050 2750 50 0001 C CNN
|
||||
F 1 "+5V" H 5065 3073 50 0000 C CNN
|
||||
F 2 "" H 5050 2900 50 0001 C CNN
|
||||
F 3 "" H 5050 2900 50 0001 C CNN
|
||||
1 5050 2900
|
||||
1 0 0 -1
|
||||
$EndComp
|
||||
$Comp
|
||||
L Transistor_BJT:2N2219 Q1
|
||||
U 1 1 5BBE5C23
|
||||
P 5750 3500
|
||||
F 0 "Q1" H 5941 3546 50 0000 L CNN
|
||||
F 1 "BJT" H 5941 3455 50 0000 L CNN
|
||||
F 2 "Package_TO_SOT_THT:TO-39-3" H 5950 3425 50 0001 L CIN
|
||||
F 3 "http://www.onsemi.com/pub_link/Collateral/2N2219-D.PDF" H 5750 3500 50 0001 L CNN
|
||||
1 5750 3500
|
||||
1 0 0 -1
|
||||
$EndComp
|
||||
$Comp
|
||||
L power:GND #PWR?
|
||||
U 1 1 5BBE5D12
|
||||
P 5850 3950
|
||||
F 0 "#PWR?" H 5850 3700 50 0001 C CNN
|
||||
F 1 "GND" H 5855 3777 50 0000 C CNN
|
||||
F 2 "" H 5850 3950 50 0001 C CNN
|
||||
F 3 "" H 5850 3950 50 0001 C CNN
|
||||
1 5850 3950
|
||||
1 0 0 -1
|
||||
$EndComp
|
||||
Wire Wire Line
|
||||
3850 2950 3850 3150
|
||||
Wire Wire Line
|
||||
4050 3150 3850 3150
|
||||
Connection ~ 3850 3150
|
||||
Wire Wire Line
|
||||
3850 3150 3850 3250
|
||||
Wire Wire Line
|
||||
4350 3150 4450 3150
|
||||
Wire Wire Line
|
||||
4450 3150 4450 3300
|
||||
Wire Wire Line
|
||||
4450 3500 4450 3650
|
||||
Wire Wire Line
|
||||
4450 3650 4350 3650
|
||||
Wire Wire Line
|
||||
4050 3650 3850 3650
|
||||
Wire Wire Line
|
||||
3850 3650 3850 3550
|
||||
Wire Wire Line
|
||||
5050 3300 5050 2900
|
||||
$Comp
|
||||
L Device:D D2
|
||||
U 1 1 5BBE778F
|
||||
P 6600 2750
|
||||
F 0 "D2" H 6600 2966 50 0000 C CNN
|
||||
F 1 "1N4148" H 6600 2875 50 0000 C CNN
|
||||
F 2 "" H 6600 2750 50 0001 C CNN
|
||||
F 3 "~" H 6600 2750 50 0001 C CNN
|
||||
1 6600 2750
|
||||
-1 0 0 -1
|
||||
$EndComp
|
||||
$Comp
|
||||
L Device:R R3
|
||||
U 1 1 5BBE8637
|
||||
P 5300 3500
|
||||
F 0 "R3" V 5093 3500 50 0000 C CNN
|
||||
F 1 "R" V 5184 3500 50 0000 C CNN
|
||||
F 2 "" V 5230 3500 50 0001 C CNN
|
||||
F 3 "~" H 5300 3500 50 0001 C CNN
|
||||
1 5300 3500
|
||||
0 1 1 0
|
||||
$EndComp
|
||||
Wire Wire Line
|
||||
5050 3500 5150 3500
|
||||
Wire Wire Line
|
||||
5450 3500 5550 3500
|
||||
$Comp
|
||||
L power:+5V #PWR?
|
||||
U 1 1 5BBE9B4B
|
||||
P 6900 2650
|
||||
F 0 "#PWR?" H 6900 2500 50 0001 C CNN
|
||||
F 1 "+5V" H 6915 2823 50 0000 C CNN
|
||||
F 2 "" H 6900 2650 50 0001 C CNN
|
||||
F 3 "" H 6900 2650 50 0001 C CNN
|
||||
1 6900 2650
|
||||
1 0 0 -1
|
||||
$EndComp
|
||||
Wire Wire Line
|
||||
5850 3700 5850 3950
|
||||
Wire Wire Line
|
||||
6300 3300 6250 3300
|
||||
Wire Wire Line
|
||||
6900 2650 6900 2750
|
||||
Wire Wire Line
|
||||
6750 2750 6900 2750
|
||||
Connection ~ 6900 2750
|
||||
Wire Wire Line
|
||||
6900 2750 6900 3300
|
||||
Wire Wire Line
|
||||
6450 2750 6250 2750
|
||||
Wire Wire Line
|
||||
6250 2750 6250 3300
|
||||
Connection ~ 6250 3300
|
||||
Wire Wire Line
|
||||
6250 3300 5850 3300
|
||||
Text GLabel 3450 3650 0 50 Input ~ 0
|
||||
P26
|
||||
Wire Wire Line
|
||||
3450 3650 3850 3650
|
||||
Connection ~ 3850 3650
|
||||
Text Notes 5400 4650 2 50 ~ 0
|
||||
230V / 50Hz
|
||||
Text Notes 4900 2250 0 50 ~ 0
|
||||
Relay board
|
||||
Wire Wire Line
|
||||
4300 4600 4300 4800
|
||||
Wire Wire Line
|
||||
4300 4800 4750 4800
|
||||
Wire Wire Line
|
||||
4100 4600 4100 5200
|
||||
Wire Wire Line
|
||||
4100 5200 4750 5200
|
||||
Wire Notes Line
|
||||
3150 2350 3150 4200
|
||||
Wire Notes Line
|
||||
3150 4200 7050 4200
|
||||
Wire Notes Line
|
||||
7050 4200 7050 2350
|
||||
Wire Notes Line
|
||||
7050 2350 3150 2350
|
||||
Wire Wire Line
|
||||
5550 4800 6300 4800
|
||||
Wire Wire Line
|
||||
8150 4600 8150 5200
|
||||
Wire Wire Line
|
||||
5550 5200 8150 5200
|
||||
Wire Wire Line
|
||||
6300 3700 6300 4800
|
||||
Wire Wire Line
|
||||
6900 3800 8150 3800
|
||||
Wire Wire Line
|
||||
8150 3800 8150 4300
|
||||
NoConn ~ 6900 3600
|
||||
$EndSCHEMATC
|
||||
BIN
schematic/output.pdf
Normal file
BIN
schematic/output.pdf
Normal file
Binary file not shown.
@@ -1,19 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Java call parameters
|
||||
WEBAPP="wss://ln-self-order-pos-dev.ose3.puzzle.ch/websocket/invoice?access_token="
|
||||
OPTS="-Xms128M -Xmx128M -jar"
|
||||
JARFILE="websocket-bridge-0.0.1-SNAPSHOT.jar"
|
||||
JARPATH="websocket_bridge/build/libs/"
|
||||
TOPIC="/topic/invoice"
|
||||
COMMAND="./gpio_handler/beerme.py"
|
||||
|
||||
# Enable dashboard
|
||||
source dashboard/dashboard.sh
|
||||
|
||||
# Hide mouse
|
||||
DISPLAY=:0 unclutter -idle 0.01 -root &
|
||||
|
||||
# Enable websocket bridge
|
||||
nohup java $OPTS $JARPATH$JARFILE --url=$WEBAPP --topic=$TOPIC --command=$COMMAND &
|
||||
|
||||
@@ -57,10 +57,14 @@ public class MyStompSessionHandler extends StompSessionHandlerAdapter {
|
||||
}
|
||||
|
||||
private void executeCommand(InvoiceDTO invoice) throws IOException, InterruptedException {
|
||||
logger.info("Command : " + command);
|
||||
|
||||
String memoArg = "--memo=\"" + invoice.getMemo() + "\"";
|
||||
String productsArg = "--products=" + invoice.getOrderedProducts();
|
||||
|
||||
logger.info("Command: " + command + ", Args: " + memoArg + ", " + productsArg);
|
||||
|
||||
ProcessBuilder pb = new ProcessBuilder(command, "--memo=\"" + invoice.getMemo() + "\"",
|
||||
"--products=" + invoice.getOrderedProducts());
|
||||
ProcessBuilder pb = new ProcessBuilder(command, memoArg, productsArg);
|
||||
|
||||
Map<String, String> env = pb.environment();
|
||||
env.put("PUZZLE_POS", "beerPos");
|
||||
pb.directory(new File("./"));
|
||||
|
||||
@@ -95,7 +95,7 @@ public class WebsocketBridge implements Runnable, DisposableBean {
|
||||
session.get().isConnected();
|
||||
connected = true;
|
||||
}catch(HttpServerErrorException | ExecutionException e) {
|
||||
logger.info("Connection Error", e);
|
||||
logger.error("Connection Error", e);
|
||||
// do try again
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user