russg
Posts: 12
Joined: Tue Dec 30, 2014 10:55 am

Printing QR codes with Thermal Printer

Fri Jan 30, 2015 10:09 am

I'm wondering if any of you guys could help me?

I'm fairly new to Raspberry Pi's and Python, but I'm trying to get mine to print QR codes off from a thermal printer to eventually print off Bitcoin private and public keys.

Does anyone have any source code I could use to print QR codes and a bit of a layman's guide to getting it to print off. I've managed to get the printer to work, so I guess it's just adapting the code to print off what I want now?

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Printing QR codes with Thermal Printer

Fri Jan 30, 2015 2:34 pm

https://learn.adafruit.com/mini-thermal ... r/overview

sudo apt-get install qrencode imagemagick
qrencode -o qr.png -t png "Hello World"
will generate a PNG image that you can convert to BMP with ImageMagick
convert qr.png qr.bmp
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

russg
Posts: 12
Joined: Tue Dec 30, 2014 10:55 am

Re: Printing QR codes with Thermal Printer

Wed Feb 04, 2015 2:11 pm

Thanks, but I'm not wanting to just print a PNG image, I'm wanting to generate a QR code from a bitcoin public and private key.

I have been following this guys blog for instructions, but i'm stuck with this error message:

Traceback (most recent last):
File “printkeys.py”, line 62, in
Piper.genAndPrintKeys(rememberkeys, rememberKeys, numCopies, “”)
File “/home/pi/Piper/piper.py”, line 226, in genAndPrintKeys
btckeys.genKeys()
File “/home/pi/Piper/genkeys.py”, line 32, in genKeys
process = Popen([“./vanitygen”, “-q”, “-t”,”l”,”-s”, “/dev/random”,”-X”, addrVersion, addrPrefix ], stdout=PIPE)
File “/usr/lib/python2.7/subprocess.py”, line 679, in __init__
errread, errwrite)
File “/usr/lib/python2.7/subprocess.py”, line 1259, in _execute_child
raise child_exception
OSError: [Errno 13] Permission denied

Return to “Python”