phomemo thermal printing: url fixed
This commit is contained in:
parent
540a9703b2
commit
1b519e9dbf
|
@ -16,11 +16,11 @@ The problem is twofold:
|
|||
1. vivier's scripts use Python's deprecated Pybluez, that has been forked a couple of times, but ultimately, doesn't work on macOS (at least not on my M1 with Ventura 13.2). Mac's Bluetooth drivers, [CoreBluetooth](https://developer.apple.com/documentation/corebluetooth?language=objc), aren't properly supported. Great.
|
||||
2. The part where the script is connected to a virtual printer driver doesn't work on macOS. Granted, Ventura also runs a CUPS service; but its file/driver locations are different, as is its structure. Great.
|
||||
|
||||
The first problem was fixed by turning to Go and utilizing [TinyGo's Bluetooth modules](https://pkg.go.dev/tinygo.org/x/bluetooth#section-readme) that sit on top of CoreBluetooth[^corebl] and is also compatible with Linux, Windows, and bare metal microcontrollers. I had no idea how Bluetooth---or printer drivers---works, and I still barely do, but "it just works". `adapter.Scan()` found our Phomemo M02, connecting to the MAC works, discovering services works (there's only one), and finding characteristics works (`0000ff01-x` for reading results, `0000ff02-x` for writing, and `0000ff03-x` for... no idea!).
|
||||
The first problem was fixed by turning to Go and utilizing [TinyGo's Bluetooth modules](https://pkg.go.dev/tinygo.org/x/bluetooth#section-readme) that sit on top of CoreBluetooth[^corebl] and is also compatible with Linux, Windows, and bare metal microcontrollers. I had no idea how Bluetooth---or a printer driver---works, and I still barely do, but "it just works". `adapter.Scan()` found our Phomemo M02, connecting to the MAC works, discovering services works (there's only one), and finding characteristics works (`0000ff01-x` for reading results, `0000ff02-x` for writing, and `0000ff03-x` for... no idea!).
|
||||
|
||||
[^corebl]: I later learned that, in Python, through PyObjC, you can also call CoreBluetooth directly. I would probably have preferred to keep everything in Python.
|
||||
|
||||
The source code is available at my Git repository called [phomemo-printer](https://git.brainbaking.com/wgroeneveld). It's very hacky and works for our specific situation but could do with a week of fine-tuning---which I don't have. For the second problem, I've had to cut many corners. For instance; I wanted my wife to be able to use it as a "printer" to select in a generic print dialog instead of running a CLI script. The options were:
|
||||
The source code is available at my Git repository called [phomemo-printer](https://git.brainbaking.com/wgroeneveld/phomemo-printer). It's very hacky and works for our specific situation but could do with a week of fine-tuning---which I don't have. For the second problem, I've had to cut many corners. For instance; I wanted my wife to be able to use it as a "printer" to select in a generic print dialog instead of running a CLI script. The options were:
|
||||
|
||||
- Try to get it to integrate with Mac's version of CUPS. My knowledge and time is just too limited to do that.
|
||||
- Create a virtual printer driver using for example IPP or the [Internet Printing Protocol](https://istopwg.github.io/ipp/ippguide.html). That involves implementing a lot of HTTP endpoints and would probably work but the effort is just too high. I only found existing IPP clients, not servers (one in Java, though).
|
||||
|
|
Loading…
Reference in New Issue