Fix startupscript

This commit is contained in:
Aaron Schmocker
2018-10-09 20:40:25 +02:00
parent 0cc542f50e
commit 2726d1d563
3 changed files with 15 additions and 8 deletions

1
.gitignore vendored
View File

@@ -2,6 +2,7 @@
/websocket_bridge/build/
!gradle/wrapper/gradle-wrapper.jar
nohup.out
websocket-bridge-0.0.1-SNAPSHOT.jar
### STS ###
.apt_generated

View File

@@ -35,9 +35,9 @@ def cli_args_parser():
parser.add_argument(
'-p',
'--product',
'--products',
action='store',
dest='product',
dest='products',
help="Product description, beer size [small, large]"
)
@@ -108,6 +108,8 @@ if __name__ == "__main__":
# parse arguments
args = cli_args_parser()
print(args.products)
# Setup all gpio pins
__setup_GPIO()
@@ -115,10 +117,10 @@ if __name__ == "__main__":
if args.test:
print("Test mode enabled")
gpio_test()
elif args.product == "large":
elif args.products == "LARGE_BEER":
print("Choice: Large beer")
draw_beer(t_large_beer)
elif args.product == "small":
elif args.products == "SMALL_BEER":
print("Choice: Small beer")
draw_beer(t_small_beer)
else:

View File

@@ -3,14 +3,18 @@
# Java call parameters
WEBAPP="wss://ln-self-order-pos-dev.ose3.puzzle.ch/websocket/invoice?access_token="
OPTS="-Xms128M -Xmx128M -jar"
JARPATH="websocket_bridge/build/libs/"
JARFILE="websocket-bridge-0.0.1-SNAPSHOT.jar"
JARPATH="websocket_bridge/build/libs/"
TOPIC="/topic/invoice"
COMMAND="./beerme.py"
COMMAND="./gpio_handler/beerme.py"
# Enable dashboard
source dashboard/dashboard.sh
# Enable websocket bridge
java $OPTS $JARPATH$JARFILE --url=$WEBAPP --topic=$TOPIC --command=$COMMAND
if [ ! -f $JARFILE ]; then
cp "$JARPATH$JARFILE" .
fi
# Enable websocket bridge
nohup java $OPTS $JARFILE --url=$WEBAPP --topic=$TOPIC --command=$COMMAND &