improvements and QR cards

This commit is contained in:
tilman
2016-12-31 00:42:33 +01:00
parent 09b739621d
commit 5f837d478d
7 changed files with 261 additions and 7 deletions
+6 -6
View File
@@ -17,7 +17,7 @@ SOUND_PLAYBACK_ERROR = "/home/pi/piplayer2/sounds/error.mp3"
QR_SCANNER_TIMEOUT = 3
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s.%(msecs)d %(levelname)s - %(message)s')
logging.basicConfig(level=logging.INFO, format='%(asctime)s.%(msecs)d %(levelname)s - %(message)s')
logging.info('Initializing')
GPIO.setmode(GPIO.BCM)
@@ -101,7 +101,7 @@ try:
try:
qr_code = zbarcam.stdout.readline().rstrip()
qr_code = qr_code.decode("utf-8") # python3
logging.debug("QR Code: {}".format(qr_code))
logging.info("QR Code: {}".format(qr_code))
if (not qr_code.startswith("http://")):
# create full path
@@ -149,15 +149,15 @@ try:
subprocess.check_call(["mocp", "-p"])
except subprocess.CalledProcessError as e:
logging.debug("Error starting playback, mocp returned {}".format(e.returncode))
logging.debug(e.output)
logging.error("Error starting playback, mocp returned {}".format(e.returncode))
logging.error(e.output)
subprocess.call(["mocp", "-l", SOUND_PLAYBACK_ERROR])
except FileNotFoundError as e:
logging.debug("Could not open directory {}".format(directory))
logging.error("Could not open directory {}".format(directory))
subprocess.call(["mocp", "-l", SOUND_PLAYBACK_ERROR])
else:
logging.debug('Timeout on zbarcam')
logging.warning('Timeout on zbarcam')
subprocess.call(["mocp", "-l", SOUND_SCAN_FAIL])
zbarcam.terminate()
+13
View File
@@ -111,7 +111,20 @@ irsend LIST JBLIIIP ""
## Der Befehl muss 2x schnell hintereinander gesendet werden. Offensichtlich muss die Konfiguration noch verbessert werden.
irsend SEND_ONCE JBLIIIP KEY_MUTE
# autostart for piplayer with log output redirection
# (siehe http://raspberrypi.stackexchange.com/questions/8169/run-startup-application-as-a-specific-user)
sudo nano /etc/rc.local
# ...
# su pi -c 'python3 /home/pi/piplayer2/piplayer2.py >> /home/pi/piplayer2/piplayer2.log 2>&1 &'
# exit 0
sudo reboot
# check if running after restart
ps -ef | grep python
# Tests mit QR-Code-Karten
tail -f /home/pi/piplayer2/piplayer2.log
Binary file not shown.
+240
View File
@@ -0,0 +1,240 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="210mm"
height="297mm"
viewBox="0 0 744.09448819 1052.3622047"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="Schablone.svg">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.4"
inkscape:cx="481.30747"
inkscape:cy="607.54617"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1855"
inkscape:window-height="1056"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:window-maximized="1" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1">
<path
inkscape:connector-curvature="0"
id="path4140"
d="m 357.87402,340.15709 106.29921,0"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000012px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<circle
style="fill:none;fill-opacity:0.83265303;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path4144"
cx="357.87402"
cy="340.15747"
r="3.0433071" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 357.87441,340.15748 0,-124.01574"
id="path4146"
inkscape:connector-curvature="0" />
<circle
cy="320.2937"
cx="464.17322"
id="circle4157"
style="fill:#00ff00;fill-opacity:0.83265303;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
r="3.0433071" />
<circle
r="3.0433071"
cy="216.14174"
cx="357.87402"
id="circle4159"
style="fill:#00ff00;fill-opacity:0.83265303;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<circle
style="fill:#00ff00;fill-opacity:0.83265303;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="circle4161"
cx="251.5748"
cy="320.29327"
r="3.0433071" />
<circle
style="fill:none;fill-opacity:0.83265303;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="circle4165"
cx="357.87402"
cy="164.76378"
r="3.0433071" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000012px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 340.15748,164.76339 35.43307,0"
id="path4167"
inkscape:connector-curvature="0" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000012px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 251.5748,340.15709 106.29921,0"
id="path4171"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path4173"
d="m 251.5752,340.15748 0,-19.8642"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 464.17362,340.15748 0,-19.8642"
id="path4175"
inkscape:connector-curvature="0" />
<circle
style="fill:none;fill-opacity:0.83265303;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path4177"
cx="357.85098"
cy="339.90768"
r="175.14351" />
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="401.53564"
y="352.57904"
id="text4153"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4155"
x="401.53564"
y="352.57904"
style="font-size:12.5px">30</tspan></text>
<text
sodipodi:linespacing="125%"
id="text4157"
y="352.32651"
x="291.17648"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
style="font-size:12.5px"
y="352.32651"
x="291.17648"
id="tspan4159"
sodipodi:role="line">30</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="468.20572"
y="336.4166"
id="text4161"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4163"
x="468.20572"
y="336.4166"
style="font-size:12.5px">5,60612</tspan></text>
<text
sodipodi:linespacing="125%"
id="text4165"
y="283.88867"
x="362.89731"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
style="font-size:12.5px"
y="283.88867"
x="362.89731"
id="tspan4167"
sodipodi:role="line">35</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="419.97095"
y="267.22116"
id="text4169"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
x="419.97095"
y="267.22116"
style="font-size:12.5px;fill:#b3b3b3"
id="tspan4185">45</tspan></text>
<text
sodipodi:linespacing="125%"
id="text4173"
y="265.45337"
x="279.81226"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
style="font-size:12.5px;fill:#b3b3b3"
y="265.45337"
x="279.81226"
id="tspan4175"
sodipodi:role="line">45</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="346.73486"
y="191.96478"
id="text4177"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4179"
x="346.73486"
y="191.96478"
style="font-size:12.5px">14,5</tspan></text>
<text
sodipodi:linespacing="125%"
id="text4181"
y="194.99524"
x="473.25647"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
style="font-size:12.5px"
y="194.99524"
x="473.25647"
id="tspan4183"
sodipodi:role="line">Ø99</tspan></text>
<path
inkscape:connector-curvature="0"
id="path4191"
d="M 458.8618,312.678 364.91761,222.01681"
style="fill:#808080;fill-rule:evenodd;stroke:#b3b3b3;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
style="fill:#808080;fill-rule:evenodd;stroke:#b3b3b3;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 258.59905,312.93054 93.94419,-90.66119"
id="path4193"
inkscape:connector-curvature="0" />
<circle
r="3.0433071"
cy="340.15747"
cx="210.47244"
id="circle4163"
style="fill:#00ff00;fill-opacity:0.83265303;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<circle
style="fill:#00ff00;fill-opacity:0.83265303;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="circle4168"
cx="505.2756"
cy="340.15747"
r="3.0433071" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
View File
Binary file not shown.
Binary file not shown.
+2 -1
View File
@@ -28,5 +28,6 @@
- Buttons per Acryl-Transfer beschriften? ch.16.05.110-115.pdf
- Beim Zusammenbau Kamera vor dem Verkleben testen
## Sonstiges
- Backup SD Card