matmair / brother_ql-inventree

Python package for the raster language protocol of the Brother QL series label printers
GNU General Public License v3.0
26 stars 10 forks source link

Network backend improvements #62

Open vulpes2 opened 3 months ago

vulpes2 commented 3 months ago

Support for two-way communication and discovery (via SNMP) would be good to have at some point. There is an existing PR in the original repo that may be worth looking into: https://github.com/pklaus/brother_ql/pull/137

matmair commented 3 months ago

The current network backend seems half finished, and discovery would also be very interesting for inventree-brother-plugin

matmair commented 2 months ago

https://github.com/pklaus/brother_ql/pull/137 look interesting but seems to introduce pysnmp as a dependency. Would be cool if that dependency could be optional

vulpes2 commented 2 months ago

I looked into this and it's not an easy fix. The network backend is not half-finished, Brother doesn't support bidirectional comms through the raw network socket (port 9100) at all. The printer will only send back an error status when the buffer is full, but otherwise it won't respond to anything.

There are two channels that we can get stats from the printer with: IPP and SNMP. Both are kind of annoying to support and neither can be used for printing within the scope of this library (only URF is accepted over IPP on these printers). So basically you need to pick either IPP or SNMP, both would require a new dependency.