thomaslee.dk
Inqueue client prototype
30/04/2016 | admin
Inqueue client prototype

IMG_0160IMG_0161IMG_0164IMG_0168IMG_0167_small

The client runs raspbian os on a Raspberry pi B with a wifi dongle. The browser does a clear cache refresh every 15 minutes otherwise refreshes every 90 seconds with a json update call. The check in/out button is controlling a json update while the refresh does a clean no cache refresh. The red button located on the side reboots the computer in case anything goes wrong.

In the current time of writing the little computers has run 24/7 for almost two years and have served more than 10.000 users in 3 different queues. The only thing that wears out are the monitors because of the backlighting being always on. The raspbian monitor power off only shuts of the lcd and not the back light which in the end burns it out. That been said I’ve only had to change one.

Next step is to get the latest Raspberry pi 3 which includes builtin WIFI and then do a 3D printed custom inQueue case.

The client runs the following overall script listening for event:

#!/usr/bin/python

import RPi.GPIO as GPIO
import time
import sys

GPIO.setmode(GPIO.BCM)

GPIO.setup(23, GPIO.IN)
GPIO.setup(24, GPIO.IN)
GPIO.setup(25, GPIO.IN)

def checkin_checkout(channel):

print "Submitting"
subprocess.call("/home/user/queue/submit.sh")
time.sleep(0.5)

def reboot(channel):

print "Rebooting"
GPIO.cleanup()
subprocess.call("/home/user/queue/reboot.sh")
GPIO.cleanup()
time.sleep(0.5)
sys.exit()

def refresh(channel):

print "Refreshing"
subprocess.call("/home/user/queue/refresh.sh")
time.sleep(0.5)

GPIO.add_event_detect(25, GPIO.FALLING, callback=checkin_checkout, bouncetime=10000)
GPIO.add_event_detect(23, GPIO.FALLING, callback=reboot, bouncetime=10000)
GPIO.add_event_detect(24, GPIO.FALLING, callback=refresh, bouncetime=10000)


while True:
time.sleep(5)

GPIO.cleanup()
sys.exit()

Comments are closed