Closed stubkan closed 4 months ago
@daig0rian @vivier @taylorjdlee
Sorry to ping, but is this repo going to be unsupported and new devices are not going to be added? T02 is supposedly compatible since it has the same protocols as M02 - but no matter what I try, it does not work.
Hi @stubkan could you try to connect the printer using USB?
Hello @vivier, thanks for the reply. It turns up as "Jieli Technology device" when plugged in
lsusb
dmesg
tail of syslog
I do have the driver installed, and when I turn on my other older thermal printer (brother QL-700) it shows up in available printers to add immediately but the T02 doesnt show up, here a picture with both printers on ;
Some futher info, just in case.
CUPS driver is installed, I had difficulty getting pybluez due to distro issues but got it working in the end thanks to this guy https://stackoverflow.com/questions/75262991/i-found-the-way-to-install-pybluez-on-ubuntu-22-04
So, we spent a day to get the cups driver working with the T02 for bluetooth. The auto discovery with the cups ui did not work. We added it using the bdaddr with lpadmin.
Also the T02 did not show up as a printing device in dmesg, neither on a current ubuntu, nor arch, nor gentoo. We should document that the T02 apparently is not usable using usb. It only appears as a ttyACM0 device.
Also pybluez in current Ubuntu LTS is broken. And even with a patched version we only managed to get bad address
exceptions.
The manual rfcomm cli way however worked well.
So we changed the M02 driver python script to not use pybluez but insteas use a native bluetooth socket. This works nicely. We also needed to change the bottom line feed from 2 lines to 4 lines since it was too narrow.
We want to do a pull request. Not sure however how we should proceed.
I think in general since pybluez is deprecated and should be replaced.
Maybe the T02 should get its own backend?
@vivier any thoughts on the whole topic?
I have to correct my previous statement. The auto discovery works, now that I understood that cups reads some stdout print string from the bluetooth scan function to show the found printer. when we changed that to also take T02 as valid name into account, the auto discovery works as well.
@darkmattercoder
The installation method for pybluez had to be done differently for me, also on Ubuntu, however it SEEMS to be installed, although under a different name - are you saying this is broken and this is potentially a reason why I can't get the T02 to work on my end? I have installed python3-bluez instead of pybluez?
Hi, I've merged yesterday a pull request https://github.com/vivier/phomemo-tools/pull/20 from @klonfish that replace PyBluez by socket. Does it fix your problem? I don't have a lot of time to test and develop, but generally I try to merge the pull request I receive.
Yes, @klonfish and I did test that together, I will issue a follow up pull request which takes care of the name discovering during bt scanning in a couple of days.
Hi, I managed to get the T02 talking to Linux Mint by opening the .rpm and then just copying the filter and drv files into /usr/share/cups/..... and chowning them to root. I paired to the bluetooth printer and then added the printer as bluetooth://MACADDRESS (removing the colons in the address for some reason) ... That worked perfectly when added as a Phomemo M02.
I can print to the printer, BUT there's something odd about the way it scales images. If I make a label that's too large (e.g. A5). then although it's correctly scaled down and fits perfectly on the label, the printer spools a huuuuge long space before it prints. like, anywhere from 3 to 5 labels' worth of spooling, and then Zzzzt. a perfect print.
If I make a label that's too large, but it's a multiple of the dimensions that would fit, the driver scales it down so that it's smaller than the width. I tried making a label that's 50x150 - printed perfectly. I made a label that's 100x300, and it came out only 30mm wide on the 50mm paper. In the worst case, an image was square (about 400x400) and it just printed about 3 feet of blank and then stopped.
The obvious workaround is to scale everything to 50xheight at 203dpi and it seems to print perfectly. Would be good to find out why it does strange things if the source isn't exactly what the printer understands.
Did you notice the pr https://github.com/vivier/phomemo-tools/pull/21 ? We improved the driver significantly in there. The only issue that I still cannot fix is that if you print large amounts of data, the printer suddenly stops printing and feeds before the print is completed.
However the overall detection over bluetooth, and using in cups has been improved in the pr.
Please check the latest version in git repo.
I'm not a GitHub power user. I just converted to Linux as a desktop last year. I'm not up to compiling things from scratch, really, so if I need to clone the repo and build to get the update that may be beyond me. I'll check to see if the rpm linked from the main page (which doesn't mention the T02 yet) is updated and copy the files out again.
The driver works with some file wrangling, but would be great if there was an actual .deb release ready to be grabbed from GitHub and install, for noobs like me :)
I'm just happy it works! Awesome work reverse engineering the protocol!
Hello,
OS: CachyOS Linux x86_64 Kernel: Linux 6.6.35-1-cachyos-lts Using Plasma
Steps I've done:
I've also tested a simple icon to confirm it works.
Thanks so much.
Thank you @Buom01 for the information
I acquired a little T02, hoping to replace my large thermal printer with it. I assumed from this repo that I would be able to use it, however it appears this may not be the case.
I have Ubuntu 22.04, and have cups, pybluez already installed on my system, no problems. Made and installed the cups driver from this repo, then went and paired the T02 device in bluetooth settings. But when I get to the Printer window, there is no T02 to be seen. I confirm the Phomemo driver is installed, as I can add a CUPS-BRK driver using the Phomemo M02 template, and tried to print to the T02 using that, but every time I print, it says it printed successfully then nothing at all happens.
Either I set up something wrongly, or the T02 is not supported?
Confirmed I have the prequisites; cups is already the newest version (2.4.1op1-1ubuntu4.7). Requirement already satisfied: pybluez in /usr/lib/python3/dist-packages (0.23)
The T02 does not show up in the printer devices when I try to add it here, as per the instructions;
So I tried to manually add it anyway, by creating a generic CUPS-BRF driver for M02 and named it T02;
This is the added printer info from localhost:631 CUPS interface;
Here is my cups access log;
and the error log with debug turned on