0

I am using an Adafruit Thermal Printer TTL, if not Tiny, then Mini. I have tried following this tutorial and other tutorials like this one. As for the first tutorial, I am not sure if I should still change the /boot/cmdline.txt

the tutorial says that I should change

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait

to

dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait

but my cmdline.txt is like this,

dwc_otg.lpm_enable=0 console=tty1 root=PARTUUID=9cd9d170-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles

should I still change it? I tried to follow the tutorial and changed it and came with this another problem, the tutorial says that I should change my etc/inittab file and remove the following lines

#2:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

but there is no etc/inittab file anymore. I tried looking for a solution for this but I haven't found one. So I looked for another tutorial that does not involve messing with cmdline or the inittab file and found this

I tried connecting using the USB Port and tried test printing

echo -e "This is a test.\\n\\n\\n" > /dev/ttyUSB0

but it says that ttyUSB0 does not exist

So I tried printing using TTL,

it still does not print at all.

stty -F /dev/serial0 19200
echo -e "This is a test.\\n\\n\\n" > /dev/serial0

It says that serial0 is not there so I changed it to ttyAMA0, but when I proceed with the echo, it doesn't print at all. I also tried changing the baudrate, still no luck. Please help me. I have tried looking for Thermal Printer setup with Raspbian Stretch or Rpi3 but haven't found any.

All Thermal Printing Tutorials are from years ago and I know something has changed with the steps but I don't know where.

2 Answers 2

0

I don't know whether the problem is from the ports; however, it seems like you are just trying the random ports like /dev/ttyUSB0, /dev/serial0, ttyAMA0. May I suggest checking the correct port by this;

ls /dev/tty*

Run this while it is not connected, then check it while it is connected. Find the new port name and try codes above with it.

1
  • when i try running ls /dev/tty* with and without the printer connected and all the port names are all still the same, nothing new added :(
    – eibersji
    Mar 11, 2018 at 5:46
0

I got it working, the problem was the power source haha. The power source that I am using is 5v 500mA, when I changed it to 5v 2A, it worked just fine with the TTL connection.

2
  • was that a 5v 2A for the PI itself? or for the printer? Jul 12, 2018 at 21:21
  • @markblue777 for the printer
    – eibersji
    Jul 25, 2018 at 10:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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