Điểm:1

How to print with a serial port printer?

lá cờ th

I am completely clueless when it comes to printers, ports and things like that so I am just reading and trying to get a printer to work without getting a college degree haha...

Basically, I have a ORIENT BTP-2002NP (seems to be the same printer as SNBC BTP-2002NP) printer - it's a small thermal printer which I want to use to print basic stuff using PHP.

My main problem is - it's not a printer like usual printers, and I'm not that experienced with Ubuntu either - it does not get automatically detected, I can't just click "print" for it to work.

The device uses RS-232 cable, and I have it connected to USB through an adapter.

First I tried adding the printer - it was not detected. Then I tried adding it using CUPS - but ORIENT is not on the list of printers, and I don't have and wasn't able to find a PPD file. I was also unable to find any drivers for Ubuntu for this printer.

Then, my another idea was that I need to send information to print on the right tty which I think are ports?

I was able to find, that indeed the device gets connected and it ends up being ttyUSB0, and in lsusb it's displayed as Bus 001 Device 006: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port. According to some things I've found, I tried to cat and echo to that, to no avail. I did sudo su and tried cat /dev/ttyUSB0 as well as cat -v < /dev/ttyUSB0, and then in another terminal also did sudo su and tried different combinations of echo -e 'something' > /dev/ttyUSB0 - my echos "worked" with no errors or return message, but contrary to what guides and articles I found were saying, nothing showed up in the terminal with cat running.

At this point I'm kind of lost - I don't really grasp the concept of everything that's going on, and it seems like it's not something that I would be able to even really learn and understand in days or even weeks.

All I'm trying to do is print text from PHP to a thermal printer, but it's killing me... any form of help is really appreciated, I don't even know where to look for information at this point...

Đăng câu trả lời

Hầu hết mọi người không hiểu rằng việc đặt nhiều câu hỏi sẽ mở ra cơ hội học hỏi và cải thiện mối quan hệ giữa các cá nhân. Ví dụ, trong các nghiên cứu của Alison, mặc dù mọi người có thể nhớ chính xác có bao nhiêu câu hỏi đã được đặt ra trong các cuộc trò chuyện của họ, nhưng họ không trực giác nhận ra mối liên hệ giữa câu hỏi và sự yêu thích. Qua bốn nghiên cứu, trong đó những người tham gia tự tham gia vào các cuộc trò chuyện hoặc đọc bản ghi lại các cuộc trò chuyện của người khác, mọi người có xu hướng không nhận ra rằng việc đặt câu hỏi sẽ ảnh hưởng—hoặc đã ảnh hưởng—mức độ thân thiện giữa những người đối thoại.