diff --git a/mac/daemon.py b/mac/daemon.py index 364258e..f1ddf6c 100644 --- a/mac/daemon.py +++ b/mac/daemon.py @@ -83,6 +83,12 @@ def do_print(body, encode): before = verified = None if encode: + # Deliberately NO `SET RFID` here. It was tried as an "arm the radio first" step and + # made things worse: on this firmware a SET RFID sent while the module is already + # active silenced every UHF command that followed (READ/QUERY returned no bytes at + # all, all tag types, until a power-cycle) -- and that looks identical to a media + # alignment problem. The printer arms RFID itself on power-up; leave that alone. + # Likewise never send &DEFAULT,i from here (README warns it re-arms/resets RFID). # UHF WRITE commits immediately -- it does NOT wait for PRINT (daemon.cs # assumed it did). That lets us read the chip back and confirm the encode # BEFORE spending a label on it. diff --git a/mac/urovo.py b/mac/urovo.py index be471a6..6f62ae9 100644 --- a/mac/urovo.py +++ b/mac/urovo.py @@ -226,9 +226,15 @@ class Urovo(object): def rfid_setup_default(self): self.cmd('&DEFAULT,i') def rfid_autocalibrate(self): self.cmd('&CALIBRATE,A,R') - def set_rfid(self, tag_type=0, rw_position=0, void_printout=0, + def set_rfid(self, tag_type=1, rw_position=0, void_printout=0, try_encode=3, error_handle=0, speed=1, retry=3): - """SET RFID -- positions are in DOTS (203dpi = 8 dots/mm), never mm.""" + """SET RFID -- positions are in DOTS (203dpi = 8 dots/mm), never mm. + + tag_type=1 is UHF Gen2. tag_type=0 is RFID OFF -- and it used to be the default here. + Seen live: after &DEFAULT,i the module went completely silent (UHF QUERY/READ returned + no bytes at all while model()/status() answered), reads failed at every media position, + and a 40 mm sweep found "no chip" on a roll whose inlay fills the label. SET RFID 1,... + brought it back on the first try. Never default to 0.""" self.cmd('SET RFID %s,%s,%s,%s,%s,%s,%s' % ( tag_type, rw_position, void_printout, try_encode, error_handle, speed, retry))