Revised documentation to support Linux

This commit is contained in:
Ircama 2024-08-08 02:32:03 +02:00
parent ba1a59815d
commit 73f7206bfd
2 changed files with 47 additions and 25 deletions

View file

@ -2,22 +2,37 @@
Epson Printer Configuration tool via SNMP (TCP/IP)
## Features
## Product Overview
- Interface Epson printers via SNMP (TCP/IP, with printers connected over Wi-Fi)
- Print the advanced status of the printer, with the possibility to restrict the query to specific information
- Other inspection features:
- Reset ink waste
- Change power off timer
- Other admin stuffs and debug options
- Read and write EEPROM addresses
- Dump a set of EEPROM addresses
- Both a GUI and a command line tool
- Python API interface
The *Epson Printer Configuration Tool* simplifies the management of Epson printers connected via Wi-Fi over the SNMP protocol (TCP/IP, not USB).
The GUI has an autodiscovery function which finds the printer IP addresses and their model names; it can be used to get the printer status, to set the "Power-off timer", to set the "TI Received Time" and to reset the ink waste counter.
A range of features are offered for both end-users and developers, making it easier to administer and maintain Epson printers.
The software provides a configurable printer dictionary, which can be easily extended. There is also a tool to import and convert an extensive Epson printer configuration DB.
## Key Features
- __SNMP Interface__: Seamlessly connect and manage Epson printers using SNMP over TCP/IP, supporting Wi-Fi connections.
- __Detailed Status Reporting__: Produce a comprehensive printer status report (with options to focus on specific details).
- __Advanced Maintenance Functions__:
- 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 replacement is programmed.
- Adjust the power-off timer for more accurate energy efficiency.
- Access various administrative and debugging options.
- Read and write to EEPROM addresses for advanced configurations.
- Dump and analyze sets of EEPROM addresses.
- __User-Friendly Interfaces__:
- __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.
- __Python API Interface__: For developers to integrate and automate printer management tasks.
The GUI can automatically find and display printer IP addresses and model names, allowing users to:
- Check printer status.
- Set the power-off timer.
- Reset the ink waste counter.
- Configure the _First TI Received Time_.
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.
## Installation
@ -57,7 +72,7 @@ It is tested with Ubuntu / Windows Subsystem for Linux, Windows.
### Running the pre-built GUI executable code
The *epson_print_conf.zip* archive in the [Releases](https://github.com/Ircama/epson_print_conf/releases/latest) folder incudes the *epson_print_conf.exe* executable file; the ZIP archive is auto-generated by a [GitHub Action](.github/workflows/build.yml). *epson_print_conf.exe* is a Windows GUI that can be directly executed.
The *epson_print_conf.zip* archive in the [Releases](https://github.com/Ircama/epson_print_conf/releases/latest) folder incudes the *epson_print_conf.exe* executable asset; the ZIP archive is auto-generated by a [GitHub Action](.github/workflows/build.yml). *epson_print_conf.exe* is a Windows GUI that can be directly executed.
### Running the GUI with Python
@ -67,10 +82,12 @@ Run *ui.py* as in this example:
python ui.py
```
This GUI runs on any Operating Systems supported by Python (not just Windows), but needs that [Tkinter](https://docs.python.org/3/library/tkinter.html) is installed. While the *Tkinter* package might be generally available by default with Windows, [it needs a specific installation on other Operating Systems](https://stackoverflow.com/questions/76105218/why-does-tkinter-or-turtle-seem-to-be-missing-or-broken-shouldnt-it-be-part).
GUI usage:
```
ui.py [-h] [-P PICKLE_FILE] [-O]
python ui.py [-h] [-P PICKLE_FILE] [-O]
optional arguments:
-h, --help show this help message and exit
@ -85,7 +102,7 @@ epson_print_conf GUI
### Using the command-line tool
```
epson_print_conf.py [-h] -m MODEL -a HOSTNAME [-p PORT] [-i] [-q QUERY_NAME] [--reset_waste_ink] [-d]
python epson_print_conf.py [-h] -m MODEL -a HOSTNAME [-p PORT] [-i] [-q QUERY_NAME] [--reset_waste_ink] [-d]
[--write-first-ti-received-time YEAR MONTH DAY] [--write-poweroff-timer MINUTES]
[--dry-run] [-R ADDRESS_SET] [-W ADDRESS_VALUE_SET] [-e FIRST_ADDRESS LAST_ADDRESS]
[--detect-key] [-S SEQUENCE_STRING] [-t TIMEOUT] [-r RETRIES] [-c CONFIG_FILE]
@ -170,7 +187,7 @@ python3 epson_print_conf.py -m XP-205 -a 192.168.1.87 -R 173,172
Note: resetting the ink waste counter is just removing a warning; not replacing the tank will make the ink spill.
## Creating an executable for the GUI
## Creating an executable asset for the GUI
Alternatively to running the GUI via `python ui.py`, it is possible to build an executable file via *pyinstaller*.
@ -183,9 +200,9 @@ pip install pyinstaller # if not yet installed
pyinstaller epson_print_conf.spec -- --default
```
Then run the *epson_print_conf.exe* file created in the *dist/* folder, which has the same options of `ui.py`.
Then run the executable file created in the *dist/* folder, which has the same options of `ui.py`.
An alternative way to create the executable file named *epson_print_conf.exe* from *ui.py* without using *epson_print_conf.spec* is the following:
An alternative way to create the executable file from *ui.py* without using *epson_print_conf.spec* is the following:
```bash
pyinstaller --onefile ui.py --name epson_print_conf --hidden-import babel.numbers --windowed
@ -200,9 +217,11 @@ python3 parse_devices.py -a 192.168.178.29 -s XP-205 -p printer_conf.pickle # u
pyinstaller epson_print_conf.spec
```
When the build operation is completed, you can run the *epson_print_conf.exe* file created in the *dist/* folder. This executable program does not have options, embeds the *printer_conf.pickle* file and starts with the default IP address and printer model defined in the build phase.
When the build operation is completed, you can run the executable program created in the *dist/* folder. It does not have options, embeds the *printer_conf.pickle* file and starts with the default IP address and printer model defined in the build phase.
The executable file is automatically generated by a [GitHub Action](.github/workflows/build.yml). It is included in a ZIP file named *epson_print_conf.zip* and uploaded into the [Releases](https://github.com/Ircama/epson_print_conf/releases/latest) folder.
The Windows *epson_print_conf.exe* executable file is automatically generated by a [GitHub Action](.github/workflows/build.yml). It is included in a ZIP file named *epson_print_conf.zip* and uploaded into the [Releases](https://github.com/Ircama/epson_print_conf/releases/latest) folder.
As mentioned in the [documentation](https://pyinstaller.org/en/stable/), PyInstaller supports Windows, MacOS X, Linux and other UNIX Operating Systems. It can create an executable file compatible with the operating system that is used to build the asset.
## Utilities and notes

11
ui.py
View file

@ -128,8 +128,8 @@ class EpsonPrinterUI(tk.Tk):
def __init__(self, conf_dict={}, replace_conf=False):
super().__init__()
self.title("Epson Printer Configuration - v" + VERSION)
self.geometry("450x500")
self.minsize(450, 500)
self.geometry("500x500")
self.minsize(500, 500)
self.printer_scanner = PrinterScanner()
self.ip_list = []
self.ip_list_cycle = None
@ -654,8 +654,11 @@ class EpsonPrinterUI(tk.Tk):
self.show_status_text_view()
model = self.model_var.get()
ip_address = self.ip_var.get()
if not model or not self._is_valid_ip(ip_address):
self.status_text.insert(tk.END, NO_CONF_ERROR)
if not self._is_valid_ip(ip_address):
self.status_text.insert(
tk.END,
"[ERROR] Please enter a valid IP address, or press 'Detect Printers'.\n"
)
self.config(cursor="")
self.update_idletasks()
return