Add "brand_name" and "model_name" configuration attributes

Improve documentation

Fix some issue
This commit is contained in:
Ircama 2024-10-20 15:11:05 +02:00
parent f09eff6b98
commit 253c45bbc8
3 changed files with 48 additions and 8 deletions

View file

@ -20,10 +20,12 @@ A range of features are offered for both end-users and developers, making it eas
start with `@BDC [SP] ST2 [CR] [LF]` ...). It is used to convey various aspects of the status of the printer, such as errors, paper status, ink and more. The element fields of this format may vary depending on the printer model. The *Epson Printer Configuration Tool* can decode all element fields found in publicly available Epson Programming Manuals of various printer models (a relevant subset of fields used by the Epson printers).
- __Advanced Maintenance Functions__:
- Open the Web interface of the printer (via the default browser).
- Reset the ink waste counter.
The ink waste counters track the amount of ink discarded during maintenance tasks to prevent overflow in the waste ink pads. Once the counters indicate that one of the printer pads is full, the printer will stop working to avoid potential damage or ink spills. Resetting the ink waste counter extends the printer operation while a pad maintenance or tank replacement is programmed.
- Adjust the power-off timer for more accurate energy efficiency.
- Change the printer WiFi MAC address and the printer serial number (typically used in specialized scenarios where specific device identifiers are required).
- Access various administrative and debugging options.
- Read and write to EEPROM addresses for advanced configurations.
- Dump and analyze sets of EEPROM addresses.
@ -42,9 +44,10 @@ The GUI can automatically find and display printer IP addresses and model names,
- Read and write the EEPROM
- Detect the access key (*read_key* and *write_key*)
- Reset the ink waste counter
- Special features allow showing the internal configuration settings
The *First TI Received Time* in Epson printers typically refers to the timestamp of the first transmission instruction to the printer when it was first set up. This feature tracks when the printer first operated.
Special features allow showing the internal configuration settings.
The *First TI Received Time* in Epson printers typically refers to the timestamp of the first transmission instruction to the printer when it was first set up. This feature tracks when the printer first operated.
The software provides a configurable printer dictionary, which can be easily extended. In addition, a tool allows importing and converting an extensive Epson printer configuration DB.

View file

@ -76,6 +76,8 @@ class EpsonPrinter:
"main_waste": {"oids": [24, 25, 30], "divider": 73.5},
"borderless_waste": {"oids": [26, 27, 34], "divider": 34.34},
"wifi_mac_address": range(130, 136),
"brand_name": range(868, 932),
"model_name": range(934, 998),
"same-as": "XP-315"
},
"ET-4700": {
@ -1730,6 +1732,34 @@ class EpsonPrinter:
self.parm["serial_number"], label="serial_number")
)
def get_printer_brand(self) -> str:
"""Return the producer name of the printer ("EPSON")."""
if not self.parm:
logging.error("EpsonPrinter - invalid API usage")
return None
if "brand_name" not in self.parm:
return None
return ''.join(
[chr(int(i or "0x3f", 16))
for i in self.read_eeprom_many(
self.parm["brand_name"], label="get_brand_name"
) if i != '00']
)
def get_printer_model(self) -> str:
"""Return the model name of the printer."""
if not self.parm:
logging.error("EpsonPrinter - invalid API usage")
return None
if "model_name" not in self.parm:
return None
return ''.join(
[chr(int(i or "0x3f", 16))
for i in self.read_eeprom_many(
self.parm["model_name"], label="get_model_name"
) if i != '00']
)
def get_wifi_mac_address(self) -> str:
"""Return the WiFi MAC address of the printer."""
if not self.parm:
@ -1773,11 +1803,14 @@ class EpsonPrinter:
if "First TI received time" not in stats_result:
return stats_result
ftrt = stats_result["First TI received time"]
year = 2000 + ftrt // (16 * 32)
month = (ftrt - (year - 2000) * (16 * 32)) // 32
day = ftrt - (year - 2000) * 16 * 32 - 32 * month
stats_result["First TI received time"] = datetime.datetime(
year, month, day).strftime('%d %b %Y')
try:
year = 2000 + ftrt // (16 * 32)
month = (ftrt - (year - 2000) * (16 * 32)) // 32
day = ftrt - (year - 2000) * 16 * 32 - 32 * month
stats_result["First TI received time"] = datetime.datetime(
year, month, day).strftime('%d %b %Y')
except Exception:
stats_result["First TI received time"] = "?"
return stats_result
def get_printer_head_id(self) -> str: # only partially correct

6
ui.py
View file

@ -2199,7 +2199,7 @@ class EpsonPrinterUI(tk.Tk):
result = detect_sequence(eeprom, epson_name)
c = 0
for i in result:
conf_data["epson_name[%s]" % c] = range(i, i + 64)
conf_data["brand_name[%s]" % c] = range(i, i + 64)
c += 1
if "Model" in stats["snmp_info"] and stats["snmp_info"]["Model"]:
@ -2277,6 +2277,10 @@ class EpsonPrinterUI(tk.Tk):
except Exception as e:
self.handle_printer_error(e)
finally:
self.status_text.insert(
tk.END,
f"[INFO] Operation completed.\n"
)
self.update_idletasks()
self.config(cursor="")
self.update_idletasks()