diff --git a/mac/daemon.py b/mac/daemon.py index 91f2084..f9f6f0d 100644 --- a/mac/daemon.py +++ b/mac/daemon.py @@ -97,6 +97,16 @@ def do_print(body, encode): return {'ok': False, 'error': 'RFID encode failed verification', 'epc': epc, 'epcBefore': before, 'readBack': p.read_uhf(), 'note': 'nothing printed -- no label wasted'} + # DISARM the firmware's own RFID pass before printing. We have already encoded and + # verified the chip ourselves (above), so the PRINT job carries no RFID data -- and with + # encoding armed the firmware treats that as a failed encode and VOIDs the label, + # overprinting "VOID VOID VOID" across the bottom third, on top of the info line and the + # QR. Seen on the bench. SET RFID OFF stops it, and it costs nothing: proven live that + # both UHF READ and UHF WRITE keep working with the firmware pass off, and the module + # stays alive for the next label. So it is simply never re-armed. + if encode: + p.cmd('SET RFID OFF') + time.sleep(0.4) # 1) direct thermal. Wait out transient busy states before feeding to clear, # so we don't waste a label on a momentary post-print code. p.ribbon_off()