1

I'm using a Raspberry Pi B+ to connect to the Adafruit Mini Thermal Receipt Printer using a slightly modified version of their provided python library.

I've been able to connect to the printer and print a few things successfully with code such as:

p = Adafruit_Thermal('/dev/serial0', 19200, timeout=3)
p.print("Hello World!")

That works perfectly.

Hello World!

However, it appears that I also am getting other data over /dev/serial0.

Whenever I start up the script that runs my code, the printer feeds for several seconds, even without any code being run. And occasionally, when things are happening on the pi itself, the printer will print out some relevant data. For example, as I was shutting the pi down, the thermal printer printed out:

[20717.652110] reboot: Power down

I assume this is likely something to do with something else communicating with /dev/serial0, however I'm not sure how to find out what it is and stop it. I'm brand new to the world of pi, and most of this hardware stuff as well, so I'm kind of scratching my head at how to stop this unwanted information being printed. I'm considering sticking a transistor in and hooking it up to another GPIO pin, so it only prints when I want it to, but I'd definitely prefer an actual solution over a band-aid.

Does anyone know what might be causing this, or if not, how I could find the source of the interference?

1

If you are using Raspbian run sudo raspi-config and disable kernel messages being sent to the serial link and disable log-in via the serial link.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.