mirror of
https://github.com/Ircama/epson_print_conf.git
synced 2024-10-18 01:00:36 -04:00
New comments
This commit is contained in:
parent
18b26d3896
commit
902fd1bf2c
2 changed files with 41 additions and 8 deletions
16
README.md
16
README.md
|
@ -11,10 +11,14 @@ A range of features are offered for both end-users and developers, making it eas
|
||||||
## Key Features
|
## Key Features
|
||||||
|
|
||||||
- __SNMP Interface__: Seamlessly connect and manage Epson printers using SNMP over TCP/IP, supporting Wi-Fi connections (not USB).
|
- __SNMP Interface__: Seamlessly connect and manage Epson printers using SNMP over TCP/IP, supporting Wi-Fi connections (not USB).
|
||||||
|
|
||||||
|
Printers are queried via Simple Network Management Protocol (SNMP) with a set of Object Identifiers (OIDs) used by Epson printers. Some of them are also valid with other printer brands. SNMP is also used to manage the EEPROM and read/set specific Epson configuration.
|
||||||
|
|
||||||
- __Detailed Status Reporting__: Produce a comprehensive printer status report (with options to focus on specific details).
|
- __Detailed Status Reporting__: Produce a comprehensive printer status report (with options to focus on specific details).
|
||||||
|
|
||||||
Epson printers produce a status response in a proprietary "new binary format" named @BDC ST2, including a binary data structure which is partially undocumented (such messages
|
Epson printers produce a status response in a proprietary "new binary format" named @BDC ST2, including a data structure which is partially undocumented (such messages
|
||||||
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 the Epson Programming Manuals publicly available (a subset of fields used by the Epson printers).
|
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__:
|
- __Advanced Maintenance Functions__:
|
||||||
- Reset the ink waste counter.
|
- Reset the ink waste counter.
|
||||||
|
|
||||||
|
@ -23,6 +27,7 @@ A range of features are offered for both end-users and developers, making it eas
|
||||||
- Access various administrative and debugging options.
|
- Access various administrative and debugging options.
|
||||||
- Read and write to EEPROM addresses for advanced configurations.
|
- Read and write to EEPROM addresses for advanced configurations.
|
||||||
- Dump and analyze sets of EEPROM addresses.
|
- Dump and analyze sets of EEPROM addresses.
|
||||||
|
|
||||||
- __User-Friendly Interfaces__:
|
- __User-Friendly Interfaces__:
|
||||||
- __Graphical User Interface (GUI)__: Intuitive interface with an autodiscovery function that detects printer IP addresses and model names.
|
- __Graphical User Interface (GUI)__: Intuitive interface with an autodiscovery function that detects printer IP addresses and model names.
|
||||||
- __Command Line Tool__: For users who prefer command-line interactions, providing the full set of features.
|
- __Command Line Tool__: For users who prefer command-line interactions, providing the full set of features.
|
||||||
|
@ -433,8 +438,7 @@ import logging
|
||||||
|
|
||||||
logging.basicConfig(level=logging.DEBUG, format="%(message)s") # if logging is needed
|
logging.basicConfig(level=logging.DEBUG, format="%(message)s") # if logging is needed
|
||||||
|
|
||||||
printer = EpsonPrinter(
|
printer = EpsonPrinter(model="XP-205", hostname="192.168.178.29")
|
||||||
model="XP-205", hostname="192.168.1.87")
|
|
||||||
|
|
||||||
if not printer.parm:
|
if not printer.parm:
|
||||||
print("Unknown printer")
|
print("Unknown printer")
|
||||||
|
@ -464,6 +468,10 @@ print("get_last_printer_fatal_errors:", ret)
|
||||||
ret = printer.get_stats()
|
ret = printer.get_stats()
|
||||||
print("get_stats:", ret)
|
print("get_stats:", ret)
|
||||||
|
|
||||||
|
# Dump all printer parameters
|
||||||
|
from pprint import pprint
|
||||||
|
pprint(printer.parm)
|
||||||
|
|
||||||
printer.reset_waste_ink_levels()
|
printer.reset_waste_ink_levels()
|
||||||
printer.brute_force_read_key()
|
printer.brute_force_read_key()
|
||||||
printer.write_first_ti_received_time(2000, 1, 2)
|
printer.write_first_ti_received_time(2000, 1, 2)
|
||||||
|
|
|
@ -683,6 +683,23 @@ class EpsonPrinter:
|
||||||
"Power Off Timer": f"{EEPROM_LINK}.111.116.2.0.1.1"
|
"Power Off Timer": f"{EEPROM_LINK}.111.116.2.0.1.1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MIB_INFO_ADVANCED = {
|
||||||
|
"Printer Status": f"{MIB_MGMT}.1.25.3.5.1.1", # hrPrinterStatus
|
||||||
|
"Printer Alerts": f"{MIB_MGMT}.1.43.18.1.1.8", # prtAlertDescription
|
||||||
|
"Printer Marker Supplies Level": f"{MIB_MGMT}.1.43.11.1.1.9", # prtMarkerSuppliesLevel
|
||||||
|
"Printer Marker Life Count": f"{MIB_MGMT}.1.43.11.1.1.6", # prtMarkerLifeCount
|
||||||
|
"Input Tray Status": f"{MIB_MGMT}.1.43.8.2.1.10", # prtInputStatus
|
||||||
|
"Output Tray Status": f"{MIB_MGMT}.1.43.9.2.1.10", # prtOutputStatus
|
||||||
|
"Printer Description": f"{MIB_MGMT}.1.25.3.2.1.3", # hrDeviceDescr
|
||||||
|
"Device Identification": f"{MIB_MGMT}.1.43.5.1.1.17", # prtGeneralSerialNumber
|
||||||
|
"Job Count": f"{MIB_MGMT}.1.43.10.2.1.4", # prtJobEntryJobCount
|
||||||
|
"Toner Level": f"{MIB_MGMT}.1.43.11.1.1.9.1", # prtMarkerSuppliesLevel
|
||||||
|
"Error Status": f"{MIB_MGMT}.1.43.16.5.1.2", # prtConsoleDisplayBufferText
|
||||||
|
"Power On Time": f"{MIB_MGMT}.1.25.3.2.1.5", # hrDeviceUptime
|
||||||
|
"Device Name": f"{MIB_MGMT}.1.1.5", # sysName
|
||||||
|
"Device Location": f"{MIB_MGMT}.1.1.6", # sysLocation
|
||||||
|
}
|
||||||
|
|
||||||
session: object
|
session: object
|
||||||
model: str
|
model: str
|
||||||
hostname: str
|
hostname: str
|
||||||
|
@ -1421,13 +1438,21 @@ class EpsonPrinter:
|
||||||
data_set["unknown"].append((hex(ftype), item))
|
data_set["unknown"].append((hex(ftype), item))
|
||||||
return data_set
|
return data_set
|
||||||
|
|
||||||
def get_snmp_info(self, mib_name: str = None) -> str:
|
def get_snmp_info(
|
||||||
|
self,
|
||||||
|
mib_name: str = None,
|
||||||
|
advanced: bool = False
|
||||||
|
) -> str:
|
||||||
"""Return general SNMP information of printer."""
|
"""Return general SNMP information of printer."""
|
||||||
sys_info = {}
|
sys_info = {}
|
||||||
if mib_name and mib_name in self.MIB_INFO.keys():
|
if advanced:
|
||||||
snmp_info = {mib_name: self.MIB_INFO[mib_name]}
|
oids = {**self.MIB_INFO, **self.MIB_INFO_ADVANCED}
|
||||||
else:
|
else:
|
||||||
snmp_info = self.MIB_INFO
|
oids = self.MIB_INFO
|
||||||
|
if mib_name and mib_name in oids.keys():
|
||||||
|
snmp_info = {mib_name: oids[mib_name]}
|
||||||
|
else:
|
||||||
|
snmp_info = oids
|
||||||
for name, oid in snmp_info.items():
|
for name, oid in snmp_info.items():
|
||||||
logging.debug(
|
logging.debug(
|
||||||
f"SNMP_DUMP {name}:\n"
|
f"SNMP_DUMP {name}:\n"
|
||||||
|
|
Loading…
Reference in a new issue