You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I guess I somehow broke the connection to the printer (A40). After unsuccessful attempts to print PDF files (tried to convert them to Pillow images and printImage()) my printer doesn't even react to turning it off, it just stays on.
Steps...
Code: PDF-to-Image and printImage()
importsubprocessfrompathlibimportPathfromPILimportImagefrompdf2imageimportconvert_from_pathimportperipagedefget_mac_and_model():
print('Retrieving MAC and Peripage model...')
result=subprocess.run(['hcitool', 'scan'], capture_output=True)
raw_output=result.stdout.decode()
out=raw_output.replace('Scanning ...\n\t', '').split('\t')
mac=out[0].strip()
model=out[1].strip()
print(f'[{model}] on [{mac}] found')
returnmac, modelmac, model=get_mac_and_model()
printer=peripage.Printer(mac, peripage.PrinterType.A40)
printer.connect()
printer.reset()
# Set print concentrationprinter.setConcentration(1)
defprint_pdf(file_path: Path) ->None:
# Convert to PDF-file to multiple images...print('Converting a PDF-file into images...')
pages=convert_from_path(file_path, 200)
images_files= []
forcount, pageinenumerate(pages):
img_name=f'out_{count}.jpg'page.save(img_name, 'JPEG')
images_files.append(img_name)
print(f'New PDF page converted: {img_name}')
# Print save images...print('Printing images...')
forimg_nameinimages_files:
withImage.open(img_name) asimg:
printer.printlnASCII('NEW PAGE')
printer.printImage(img)
printer.printBreak(100)
print(f'Printed: {img}')
if__name__=='__main__':
print_pdf(Path('local_file.pdf'))
Printer Response
It started to use paper, not printing anything on it (before that, I successfully printed "HONK" from the README.md). So I've decided to turn it off by opening the cover (yes, I didn't read the instruction). It kind of worked, the printer stopped. However, it doesn't really work now.
Current State
Now I can't really use the printer. I've tried to install drivers on Win10 but the installer doesn't see the printer as well. None of my tries succeeded in bringing back the printer's functionality. I still see a green LED bear-face no matter what I do.
P.S. Strangely enough, Win10 gave me multiple power surge warnings when I was connecting the printer via a USB-hub. So I might accidentally kill the hub.
P.P.S. Bluetooth-pairing process works just fine on both, Ubuntu and Win10.
Error
> peripage -m <mac_address> -p A40 -e
Traceback (most recent call last):
File "<string>", line 3, in recv
_bluetooth.timeout: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 5, in recv
bluetooth.btcommon.BluetoothError: timed out
The text was updated successfully, but these errors were encountered:
I guess I somehow broke the connection to the printer (A40). After unsuccessful attempts to print PDF files (tried to convert them to Pillow images and
printImage()
) my printer doesn't even react to turning it off, it just stays on.Steps...
Code: PDF-to-Image and
printImage()
Printer Response
It started to use paper, not printing anything on it (before that, I successfully printed "HONK" from the README.md). So I've decided to turn it off by opening the cover (yes, I didn't read the instruction). It kind of worked, the printer stopped. However, it doesn't really work now.
Current State
Now I can't really use the printer. I've tried to install drivers on Win10 but the installer doesn't see the printer as well. None of my tries succeeded in bringing back the printer's functionality. I still see a green LED bear-face no matter what I do.
P.S. Strangely enough, Win10 gave me multiple power surge warnings when I was connecting the printer via a USB-hub. So I might accidentally kill the hub.
P.P.S. Bluetooth-pairing process works just fine on both, Ubuntu and Win10.
Error
The text was updated successfully, but these errors were encountered: