Compare commits
No commits in common. "718f81b8e7e396a64a71391c73fb7434a4c7546b" and "5de6b107d27956e3cdcd773347312e74a2989828" have entirely different histories.
718f81b8e7
...
5de6b107d2
|
@ -33,9 +33,8 @@ systemctl enable --now /lib/systemd/system/reHDDPrinter.service
|
|||
- Brother QL-570
|
||||
- Paper With: 62mm or 696px
|
||||
|
||||
**Hint: Some Brother printers have enabled standby mode. This will disconnect the printer. See [Issue #12](https://git.mosad.xyz/localhorst/reHDDPrinter/issues/12) to disable standby.**
|
||||
|
||||
see https://github.com/pklaus/brother_ql for details for printer access
|
||||
see https://github.com/pklaus/brother_ql
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
import sysv_ipc
|
||||
import pycstruct
|
||||
import os
|
||||
import time
|
||||
from brother_ql.brother_ql_create import create_label
|
||||
from brother_ql.raster import BrotherQLRaster
|
||||
import layouter
|
||||
|
@ -18,7 +17,6 @@ str_buffer_size = 64 #keep this synchronous to reHDD
|
|||
msg_queue_key = 0x1B11193C0 #keep this synchronous to reHDD
|
||||
|
||||
file_name = "output.png"
|
||||
printer_path = "/dev/usb/lp0"
|
||||
|
||||
def get_struct_format():
|
||||
#keep this synchronous to struct in reHDD
|
||||
|
@ -59,15 +57,10 @@ def main():
|
|||
shred_timestamp=int(driveData['driveShredTimestamp']),\
|
||||
shred_duration=int(driveData['driveShredDuration']))
|
||||
|
||||
while(not os.path.exists(printer_path)):
|
||||
print("Printer not found, waiting ...")
|
||||
time.sleep(30) #sleep 30
|
||||
|
||||
layouter.generate_image(drive, rehdd_info, file_name)
|
||||
qlr = BrotherQLRaster("QL-570")
|
||||
create_label(qlr, file_name, '62')
|
||||
|
||||
with open(printer_path, 'wb') as file:
|
||||
with open("/dev/usb/lp0", 'wb') as file:
|
||||
file.write(qlr.data)
|
||||
os.remove(file_name)
|
||||
except sysv_ipc.ExistentialError:
|
||||
|
|
Loading…
Reference in New Issue