Pi 3 with mini thermal printer printing weird characters
Posted: Wed Mar 23, 2016 1:08 am
I need to set up a receipt printer to work with a raspberry pi for a project I'm working on yet I've run into an issue. I'm using a raspberry pi 3 B and an adafruit mini thermal printer (https://www.adafruit.com/products/597).
I connected the ground and the TX of the printer to the pi 3, found some code already written to print to the printer (https://github.com/luopio/py-thermal-printer) and have been playing around with it.
However, randomly I'll get a string of characters which I simply didn't print. Sometimes it'll just add them on to the beginning, sometimes it'll replace the actual characters with them. But the thing is I can run the same file 10 times doing nothing except running it again and I'll get different outputs being printed.
For example I'll run the printer.py which is supposed to print "Test line looping" 5 or 6 times (http://i.imgur.com/AREBd7b.jpg) and I'll get this printed out: http://i.imgur.com/AWDnjP6.jpg
Each time I run it it should just print "test line looping" once. And most times it does, but every so often it'll just spazz out and I have no idea why. I don't use python much so I'm not sure if it's something wrong in the code, but I'm a little worried that it's actually something buggy in my hardware. Any ideas?
I connected the ground and the TX of the printer to the pi 3, found some code already written to print to the printer (https://github.com/luopio/py-thermal-printer) and have been playing around with it.
However, randomly I'll get a string of characters which I simply didn't print. Sometimes it'll just add them on to the beginning, sometimes it'll replace the actual characters with them. But the thing is I can run the same file 10 times doing nothing except running it again and I'll get different outputs being printed.
For example I'll run the printer.py which is supposed to print "Test line looping" 5 or 6 times (http://i.imgur.com/AREBd7b.jpg) and I'll get this printed out: http://i.imgur.com/AWDnjP6.jpg
Each time I run it it should just print "test line looping" once. And most times it does, but every so often it'll just spazz out and I have no idea why. I don't use python much so I'm not sure if it's something wrong in the code, but I'm a little worried that it's actually something buggy in my hardware. Any ideas?