lucadentella / raspberry-dgc

Read and verify EU Digital Covid Certificates with Raspberry Pi and Pi Camera
49 stars 21 forks source link

Come posso far stampare con la stampante termica il risultato? #33

Closed AntonioMazzarella closed 2 years ago

AntonioMazzarella commented 2 years ago

Come posso far stampare con la stampante termica il risultato?

lucadentella commented 2 years ago

Ciao Antonio,

difficile rispondere... stai usando il client python? hai collegato la stampante termica (quale?) alla stessa scheda raspberry? In generale una volta che hai ottenuto l'esito dal validatorServer (usando un client di tua scelta), nel client stesso dovrai implementare il codice per stampare.

Puoi partire ad esempio da questo ottimo tutorial di Adafruit: https://learn.adafruit.com/pi-thermal-printer/pi-setup-part-3

ma ripeto, dipende molto dal tuo setup...

AntonioMazzarella commented 2 years ago

scusami luca ho un altro problema con l avvio del camera client Traceback (most recent call last): File "cameraClient.py", line 6, in <module> import cv2 File "/home/pi/.local/lib/python3.7/site-packages/cv2/__init__.py", line 5, in <module> from .cv2 import * ImportError: libcblas.so.3: cannot open shared object file: No such file or directory

AntonioMazzarella commented 2 years ago

RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd Traceback (most recent call last): File "cameraClient.py", line 6, in <module> import cv2 File "/home/pi/.local/lib/python3.7/site-packages/cv2/__init__.py", line 5, in <module> from .cv2 import * ImportError: numpy.core.multiarray failed to import

AntonioMazzarella commented 2 years ago

`pi@raspberrypi:~/raspberry-dgc/validatorServer $ node app.js /home/pi/raspberry-dgc/validatorServer/node_modules/cbor-web/dist/cbor.js:2 !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.cbor=t():e.cbor=t()}(this,(function(){return(()=>{var e={742:(e,t)=>{"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3(r+n)/4-n},t.toByteArray=function(e){var t,r,o=u(e),s=o[0],a=o[1],f=new i(function(e,t,r){return 3(t+r)/4-r}(0,s,a)),h=0,l=a>0?s-4:s;for(r=0;r<l;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],f[h++]=t>>16&255,f[h++]=t>>8&255,f[h++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,f[h++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,f[h++]=t>>8&255,f[h++]=255&t),f},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(f(e,a,a+s>u?u:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[

ReferenceError: TextDecoder is not defined at Object.202 (/home/pi/raspberry-dgc/validatorServer/node_modules/cbor-web/dist/cbor.js:2:59485) at r (/home/pi/raspberry-dgc/validatorServer/node_modules/cbor-web/dist/cbor.js:2:115570) at Object.873 (/home/pi/raspberry-dgc/validatorServer/node_modules/cbor-web/dist/cbor.js:2:56222) at r (/home/pi/raspberry-dgc/validatorServer/node_modules/cbor-web/dist/cbor.js:2:115570) at Object.20 (/home/pi/raspberry-dgc/validatorServer/node_modules/cbor-web/dist/cbor.js:2:27297) at r (/home/pi/raspberry-dgc/validatorServer/node_modules/cbor-web/dist/cbor.js:2:115570) at Object.141 (/home/pi/raspberry-dgc/validatorServer/node_modules/cbor-web/dist/cbor.js:2:26717) at r (/home/pi/raspberry-dgc/validatorServer/node_modules/cbor-web/dist/cbor.js:2:115570) at /home/pi/raspberry-dgc/validatorServer/node_modules/cbor-web/dist/cbor.js:2:116537 at /home/pi/raspberry-dgc/validatorServer/node_modules/cbor-web/dist/cbor.js:2:116545 pi@raspberrypi:~/raspberry-dgc/validatorServer $ `

lucadentella commented 2 years ago

Antonio mi sembra che manchino dei pacchetti... hai seguito le istruzioni? Per la parte node quando hai dato il comando npm install ti ha dato errori?

swap83 commented 2 years ago

`pi@raspberrypi:~/raspberry-dgc/validatorServer $ node app.js /home/pi/raspberry-dgc/validatorServer/node_modules/cbor-web/dist/cbor.js:2 !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.cbor=t():e.cbor=t()}(this,(function(){return(()=>{var e={742:(e,t)=>{"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3(r+n)/4-n},t.toByteArray=function(e){var t,r,o=u(e),s=o[0],a=o[1],f=new i(function(e,t,r){return 3(t+r)/4-r}(0,s,a)),h=0,l=a>0?s-4:s;for(r=0;r<l;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],f[h++]=t>>16&255,f[h++]=t>>8&255,f[h++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,f[h++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,f[h++]=t>>8&255,f[h++]=255&t),f},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(f(e,a,a+s>u?u:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[

ReferenceError: TextDecoder is not defined at Object.202 (/home/pi/raspberry-dgc/validatorServer/node_modules/cbor-web/dist/cbor.js:2:59485) at r (/home/pi/raspberry-dgc/validatorServer/node_modules/cbor-web/dist/cbor.js:2:115570) at Object.873 (/home/pi/raspberry-dgc/validatorServer/node_modules/cbor-web/dist/cbor.js:2:56222) at r (/home/pi/raspberry-dgc/validatorServer/node_modules/cbor-web/dist/cbor.js:2:115570) at Object.20 (/home/pi/raspberry-dgc/validatorServer/node_modules/cbor-web/dist/cbor.js:2:27297) at r (/home/pi/raspberry-dgc/validatorServer/node_modules/cbor-web/dist/cbor.js:2:115570) at Object.141 (/home/pi/raspberry-dgc/validatorServer/node_modules/cbor-web/dist/cbor.js:2:26717) at r (/home/pi/raspberry-dgc/validatorServer/node_modules/cbor-web/dist/cbor.js:2:115570) at /home/pi/raspberry-dgc/validatorServer/node_modules/cbor-web/dist/cbor.js:2:116537 at /home/pi/raspberry-dgc/validatorServer/node_modules/cbor-web/dist/cbor.js:2:116545 pi@raspberrypi:~/raspberry-dgc/validatorServer $ `

35 @AntonioMazzarella

Io ho risolto cosi, però sono su Ubuntu e non raspberry.