mirror of
https://github.com/anikeen-com/print-cli.git
synced 2026-03-14 06:06:10 +00:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54a8ef2abd | ||
|
|
06765121cb | ||
|
|
fd0c32b32e | ||
|
|
a6804c306b | ||
|
|
402ece3e55 | ||
|
|
06c5ea9224 | ||
|
|
d3e1eccfa5 | ||
|
|
7c8086fea3 | ||
|
|
bbc50dc6dd | ||
|
|
5d0caeda1c | ||
|
|
a4451e3556 | ||
|
|
60ace31331 | ||
|
|
cc20006f3d | ||
|
|
2433ec846c |
35
README.md
35
README.md
@@ -1,34 +1,3 @@
|
||||
<p align="center">
|
||||
<img title="Laravel Zero" height="100" src="https://raw.githubusercontent.com/laravel-zero/docs/master/images/logo/laravel-zero-readme.png" alt="Laravel Zero Logo" />
|
||||
</p>
|
||||
# Print CLI
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/laravel-zero/framework/actions"><img src="https://github.com/laravel-zero/laravel-zero/actions/workflows/tests.yml/badge.svg" alt="Build Status" /></a>
|
||||
<a href="https://packagist.org/packages/laravel-zero/framework"><img src="https://img.shields.io/packagist/dt/laravel-zero/framework.svg" alt="Total Downloads" /></a>
|
||||
<a href="https://packagist.org/packages/laravel-zero/framework"><img src="https://img.shields.io/packagist/v/laravel-zero/framework.svg?label=stable" alt="Latest Stable Version" /></a>
|
||||
<a href="https://packagist.org/packages/laravel-zero/framework"><img src="https://img.shields.io/packagist/l/laravel-zero/framework.svg" alt="License" /></a>
|
||||
</p>
|
||||
|
||||
Laravel Zero was created by [Nuno Maduro](https://github.com/nunomaduro) and [Owen Voke](https://github.com/owenvoke), and is a micro-framework that provides an elegant starting point for your console application. It is an **unofficial** and customized version of Laravel optimized for building command-line applications.
|
||||
|
||||
- Built on top of the [Laravel](https://laravel.com) components.
|
||||
- Optional installation of Laravel [Eloquent](https://laravel-zero.com/docs/database/), Laravel [Logging](https://laravel-zero.com/docs/logging/) and many others.
|
||||
- Supports interactive [menus](https://laravel-zero.com/docs/build-interactive-menus/) and [desktop notifications](https://laravel-zero.com/docs/send-desktop-notifications/) on Linux, Windows & MacOS.
|
||||
- Ships with a [Scheduler](https://laravel-zero.com/docs/task-scheduling/) and a [Standalone Compiler](https://laravel-zero.com/docs/build-a-standalone-application/).
|
||||
- Integration with [Collision](https://github.com/nunomaduro/collision) - Beautiful error reporting
|
||||
|
||||
------
|
||||
|
||||
## Documentation
|
||||
|
||||
For full documentation, visit [laravel-zero.com](https://laravel-zero.com/).
|
||||
|
||||
## Support the development
|
||||
**Do you like this project? Support it by donating**
|
||||
|
||||
- PayPal: [Donate](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L)
|
||||
- Patreon: [Donate](https://www.patreon.com/nunomaduro)
|
||||
|
||||
## License
|
||||
|
||||
Laravel Zero is an open-source software licensed under the MIT license.
|
||||
Print CLI is the official repository for the print driver for Anikeen Events.
|
||||
|
||||
92
app/Commands/InitCommand.php
Normal file
92
app/Commands/InitCommand.php
Normal file
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
namespace App\Commands;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
use LaravelZero\Framework\Commands\Command;
|
||||
use Smalot\Cups\Builder\Builder;
|
||||
use Smalot\Cups\Manager\PrinterManager;
|
||||
use Smalot\Cups\Model\Printer;
|
||||
use Smalot\Cups\Transport\Client;
|
||||
use Smalot\Cups\Transport\ResponseParser;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
class InitCommand extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'init';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Create a print-cli configuration file';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
$username = getenv('USER') ?: get_current_user();
|
||||
$home = getenv('HOME');
|
||||
|
||||
$client = new Client();
|
||||
$builder = new Builder();
|
||||
$responseParser = new ResponseParser();
|
||||
|
||||
$printerManager = new PrinterManager($builder, $client, $responseParser);
|
||||
|
||||
$printers = Collection::make($printerManager->getList());
|
||||
|
||||
if ($printers->isEmpty()) {
|
||||
$this->error('We could not find any printers! Setup them first :)');
|
||||
return;
|
||||
}
|
||||
|
||||
$this->info('Please register printers first at:');
|
||||
$this->info('https://events.anikeen.com/console/resources/printers');
|
||||
|
||||
$password = $this->ask('What is your password?', match ($username) {
|
||||
'print-cli' => 'print-cli',
|
||||
'orangepi' => 'orangepi',
|
||||
default => null,
|
||||
});
|
||||
|
||||
$filename = $home . '/print-cli.yml';
|
||||
|
||||
$yaml = Yaml::dump(
|
||||
input: [
|
||||
'base_url' => 'https://events.anikeen.com',
|
||||
'printers' => $printers->map(function (Printer $printer) use ($username, $password) {
|
||||
$attributes = $printer->getAttributes();
|
||||
|
||||
$id = $this->ask(sprintf('What is your ID for %s?', $printer->getName()));
|
||||
|
||||
return [
|
||||
'id' => $id,
|
||||
'name' => $printer->getName(),
|
||||
'driver' => 'cups',
|
||||
'address' => $attributes['printer-uri-supported'][0],
|
||||
'username' => $username,
|
||||
'password' => $password,
|
||||
];
|
||||
})->toArray(),
|
||||
],
|
||||
inline: 100,
|
||||
indent: 2,
|
||||
flags: Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK
|
||||
);
|
||||
|
||||
file_put_contents(
|
||||
filename: $filename,
|
||||
data: preg_replace('/-\n\s+/', '- ', $yaml)
|
||||
);
|
||||
|
||||
$this->info(sprintf('Created configuration at %s', $filename));
|
||||
}
|
||||
}
|
||||
45
app/Commands/InitSupervisorCommand.php
Normal file
45
app/Commands/InitSupervisorCommand.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Commands;
|
||||
|
||||
use LaravelZero\Framework\Commands\Command;
|
||||
|
||||
class InitSupervisorCommand extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'init:supervisor';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Create a supervisor configuration file';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
$username = getenv('USER') ?: get_current_user();
|
||||
$home = getenv('HOME');
|
||||
|
||||
$ini = <<<INI
|
||||
[program:print-cli]
|
||||
directory = $home
|
||||
command = /usr/bin/php $home/.config/composer/vendor/bin/print-cli serve
|
||||
autostart = true
|
||||
autorestart = true
|
||||
stderr_logfile = /var/log/print-cli.err.log
|
||||
stdout_logfile = /var/log/print-cli.out.log
|
||||
stopwaitsecs = 3600
|
||||
user = $username
|
||||
INI;
|
||||
|
||||
echo $ini;
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Commands;
|
||||
|
||||
use Illuminate\Http\Client\ConnectionException;
|
||||
use Illuminate\Http\Client\RequestException;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
@@ -35,16 +36,33 @@ class ServeCommand extends Command
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
* @throws RequestException
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
try {
|
||||
$this->serve();
|
||||
} catch (Throwable $e) {
|
||||
if ($e instanceof RequestException && $e->response->status() === 422) {
|
||||
$this->error('Please check your configuration and try again.');
|
||||
$this->error($e->response->json()['message']);
|
||||
} else {
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws RequestException
|
||||
* @throws ConnectionException
|
||||
*/
|
||||
private function serve(): void
|
||||
{
|
||||
$this->info('Starting service...');
|
||||
|
||||
$yaml = $this->getConfiguration();
|
||||
$printerIds = array_map(fn($printer) => $printer['id'], $yaml['printers']);
|
||||
|
||||
$response = Http::patch(sprintf('%s/api/printers/register', $yaml['base_url']), [
|
||||
$response = Http::acceptJson()->patch(sprintf('%s/api/printers/register', $yaml['base_url']), [
|
||||
'printers' => $yaml['printers'],
|
||||
]);
|
||||
|
||||
@@ -54,7 +72,7 @@ class ServeCommand extends Command
|
||||
|
||||
do {
|
||||
try {
|
||||
$response = Http::get(sprintf('%s/api/printers/jobs', $yaml['base_url']), [
|
||||
$response = Http::acceptJson()->get(sprintf('%s/api/printers/jobs', $yaml['base_url']), [
|
||||
'printer_ids' => $printerIds,
|
||||
]);
|
||||
|
||||
@@ -67,6 +85,7 @@ class ServeCommand extends Command
|
||||
$jobs = $response->json();
|
||||
|
||||
if (empty($jobs)) {
|
||||
sleep(2);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -92,12 +111,13 @@ class ServeCommand extends Command
|
||||
private function getConfiguration(): array
|
||||
{
|
||||
$this->info('Reading configuration...');
|
||||
$yaml = file_get_contents(base_path('print-cli.yml'));
|
||||
$yaml = file_get_contents(getcwd() . '/print-cli.yml');
|
||||
return Yaml::parse($yaml);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws RequestException
|
||||
* @throws ConnectionException
|
||||
*/
|
||||
private function handleJob(array $job, mixed $yaml): void
|
||||
{
|
||||
@@ -150,10 +170,11 @@ class ServeCommand extends Command
|
||||
|
||||
/**
|
||||
* @throws RequestException
|
||||
* @throws ConnectionException
|
||||
*/
|
||||
private function markCompleted(array $job, mixed $yaml, int $jobId): void
|
||||
{
|
||||
$response = Http::patch(sprintf('%s/api/printers/jobs/%s/complete', $yaml['base_url'], $job['id']), [
|
||||
$response = Http::acceptJson()->patch(sprintf('%s/api/printers/jobs/%s/complete', $yaml['base_url'], $job['id']), [
|
||||
'job_id' => $jobId,
|
||||
]);
|
||||
$response->throw();
|
||||
@@ -161,10 +182,11 @@ class ServeCommand extends Command
|
||||
|
||||
/**
|
||||
* @throws RequestException
|
||||
* @throws ConnectionException
|
||||
*/
|
||||
private function markFailed(array $job, mixed $yaml, string $reason): void
|
||||
{
|
||||
$response = Http::patch(sprintf('%s/api/printers/jobs/%s/fail', $yaml['base_url'], $job['id']), [
|
||||
$response = Http::acceptJson()->patch(sprintf('%s/api/printers/jobs/%s/fail', $yaml['base_url'], $job['id']), [
|
||||
'reason' => $reason,
|
||||
]);
|
||||
$response->throw();
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"guzzlehttp/guzzle": "^7.8",
|
||||
"illuminate/http": "^11.5",
|
||||
"laravel-zero/framework": "^11.0.0",
|
||||
"smalot/cups-ipp": "dev-master",
|
||||
"ghostzero/cups-ipp": "^1.0",
|
||||
"symfony/yaml": "^7.1"
|
||||
},
|
||||
"require-dev": {
|
||||
@@ -28,12 +28,6 @@
|
||||
"mockery/mockery": "^1.6.11",
|
||||
"pestphp/pest": "^2.34.7"
|
||||
},
|
||||
"repositories": [
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://github.com/ghostzero/cups-ipp.git"
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"App\\": "app/",
|
||||
|
||||
1927
composer.lock
generated
1927
composer.lock
generated
File diff suppressed because it is too large
Load Diff
179
orangepi5plus.md
Normal file
179
orangepi5plus.md
Normal file
@@ -0,0 +1,179 @@
|
||||
# Installation
|
||||
|
||||
Installing Print-CLI on a Raspberry Pi is a quite simple process but requires some time installing the required
|
||||
packages. This guide will help you to install Print-CLI on a Raspberry Pi.
|
||||
|
||||
Estimated time: 30-60 minutes
|
||||
|
||||
## Step 1: Install the Raspberry Pi OS
|
||||
|
||||
Before we start, make sure you have created a bootable SD card with the **Ubuntu Server 22.04 LTS 64-bit** image. The
|
||||
simplest way is to use the Raspberry Pi Imager which enables you to select an Ubuntu image when flashing your SD card.
|
||||
|
||||
Recommended configuration:
|
||||
|
||||
- **OS**: Orange Pi 1.2.0 Jammy with Linux 5.10.160-rockchip-rk3588
|
||||
- **Username**: orangepi
|
||||
|
||||
## Step 2: Install Required Packages
|
||||
|
||||
**Tested Printers:**
|
||||
|
||||
- EPSON ET-2750 Series with driver: Epson Expression ET-2750 EcoTank - CUPS+Gutenprint v5.3.3 (color)
|
||||
- EPSON ET-2860 Series with driver: Epson Expression ET-2750 EcoTank - CUPS+Gutenprint v5.3.3 (color)
|
||||
|
||||
Next, we need to install the required packages for Print-CLI to work. Run the following commands and grab a coffee while
|
||||
the packages are being installed (it may take a while):
|
||||
|
||||
```bash
|
||||
sudo apt-get update
|
||||
sudo add-apt-repository ppa:ondrej/php
|
||||
sudo apt-get install -y git cups zip unzip supervisor \
|
||||
php-zip php-curl php-xml php-mbstring \
|
||||
printer-driver-gutenprint
|
||||
```
|
||||
|
||||
Install Composer as usual:
|
||||
|
||||
```
|
||||
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
||||
php composer-setup.php
|
||||
php -r "unlink('composer-setup.php');"
|
||||
sudo mv composer.phar /usr/local/bin/composer
|
||||
```
|
||||
|
||||
Finally, add the Composer bin directory to your PATH, so you can run the `print-cli` command from anywhere:
|
||||
|
||||
```bash
|
||||
echo 'export PATH="$PATH:$HOME/.config/composer/vendor/bin"' >> ~/.bashrc
|
||||
```
|
||||
|
||||
## Step 3: Ensure CUPS is Running
|
||||
|
||||
Now we need to ensure that the CUPS service is running. CUPS is the printing system used by Print-CLI to send print jobs
|
||||
to the printer. This is the most important step, so make sure you follow it carefully, otherwise, Print-CLI won't work
|
||||
as expected, and you won't be able to print anything.
|
||||
|
||||
```bash
|
||||
sudo cupsctl --remote-admin --remote-any
|
||||
sudo usermod -aG lpadmin orangepi
|
||||
sudo /etc/init.d/cups restart
|
||||
```
|
||||
|
||||
Make sure the CUPS service is running by visiting the following URL in your browser:
|
||||
|
||||
```text
|
||||
https://10.20.0.195:631/printers/
|
||||
```
|
||||
|
||||
You should see a page with a list of printers. If you don't see any printers, you may need to add one manually.
|
||||
|
||||
Ensure that you can print a test page by clicking on the printer name and selecting "Print Test Page".
|
||||
|
||||
### Find the Printer Address
|
||||
|
||||
To find the printer address, visit your Printers page in CUPS, and click on the printer name. The address in the browser
|
||||
should look like this:
|
||||
|
||||
```text
|
||||
https://10.20.0.195:631/printers/EPSON_ET_2720_Series
|
||||
```
|
||||
|
||||
It contains the Name of the printer, which is the `printer-name` part. You can use this address in the configuration
|
||||
file for Print-CLI. In most cases, just replace the `https` with `ipp` and replace the ip to `127.0.0.1`:
|
||||
|
||||
```text
|
||||
ipp://127.0.0.1:631/printers/EPSON_ET_2720_Series
|
||||
```
|
||||
|
||||
## Step 4: Install Print-CLI
|
||||
|
||||
So far, we have installed all the required packages and ensured that CUPS is running. Now we can install Print-CLI using
|
||||
Composer, the PHP package manager. Run the following command to install Print-CLI globally:
|
||||
|
||||
```bash
|
||||
composer global require anikeen/print-cli
|
||||
```
|
||||
|
||||
You can also use the same command to update Print-CLI to the latest version:
|
||||
|
||||
```bash
|
||||
composer global require anikeen/print-cli
|
||||
```
|
||||
|
||||
## Step 5: Configure Print-CLI
|
||||
|
||||
With the latest version, you can automatically create your `/home/orangepi/print-cli.yml` with:
|
||||
|
||||
```bash
|
||||
print-cli init
|
||||
```
|
||||
|
||||
To test the configuration, run the following command:
|
||||
|
||||
```bash
|
||||
print-cli serve
|
||||
```
|
||||
|
||||
If everything is configured correctly, you should see the following output:
|
||||
|
||||
```text
|
||||
Starting service...
|
||||
Reading configuration...
|
||||
Service started!
|
||||
```
|
||||
|
||||
You can exit the service by pressing `Ctrl+C`.
|
||||
|
||||
## Step 6: Supervisor Configuration
|
||||
|
||||
To run Print-CLI as a service, we can use Supervisor. Supervisor is a process control system that allows you to monitor
|
||||
and control a number of processes on UNIX-like operating systems.
|
||||
|
||||
Create a new configuration file `/etc/supervisor/conf.d/print-cli.conf`:
|
||||
|
||||
```bash
|
||||
print-cli init:supervisor | sudo tee /etc/supervisor/conf.d/print-cli.conf > /dev/null
|
||||
```
|
||||
|
||||
Now, update Supervisor to read the new configuration file and start the Print-CLI service:
|
||||
|
||||
```bash
|
||||
sudo supervisorctl reread
|
||||
sudo supervisorctl update
|
||||
sudo supervisorctl start print-cli
|
||||
```
|
||||
|
||||
## WLAN
|
||||
|
||||
https://www.makeuseof.com/connect-to-wifi-with-nmcli/
|
||||
|
||||
## Printer Offsets
|
||||
|
||||
### EPSON ET-2750 Series (with Gutenprint @ OrangePI)
|
||||
|
||||
> Some other OS and drivers need other offsets.
|
||||
|
||||
```json
|
||||
{
|
||||
"badge": {
|
||||
"offset": {
|
||||
"y": 0,
|
||||
"x": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### EPSON ET-2860 Series (Unconfirmed)
|
||||
|
||||
```json
|
||||
{
|
||||
"badge": {
|
||||
"offset": {
|
||||
"y": 0,
|
||||
"x": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
145
raspberry.md
Normal file
145
raspberry.md
Normal file
@@ -0,0 +1,145 @@
|
||||
# Installation
|
||||
|
||||
Installing Print-CLI on a Raspberry Pi is a quite simple process but requires some time installing the required
|
||||
packages. This guide will help you to install Print-CLI on a Raspberry Pi.
|
||||
|
||||
Estimated time: 30-60 minutes
|
||||
|
||||
## Step 1: Install the Raspberry Pi OS
|
||||
|
||||
Before we start, make sure you have created a bootable SD card with the **Ubuntu Server 22.04 LTS 64-bit** image. The
|
||||
simplest way is to use the Raspberry Pi Imager which enables you to select an Ubuntu image when flashing your SD card.
|
||||
|
||||
Recommended configuration:
|
||||
|
||||
- **OS**: Ubuntu Server 22.04 LTS 64-bit
|
||||
- **Username**: print-cli
|
||||
|
||||
## Step 2: Install Required Packages
|
||||
|
||||
Next, we need to install the required packages for Print-CLI to work. Run the following commands and grab a coffee while
|
||||
the packages are being installed (it may take a while):
|
||||
|
||||
```bash
|
||||
sudo apt-get update
|
||||
sudo add-apt-repository ppa:ondrej/php
|
||||
sudo apt-get install -y git cups zip unzip supervisor \
|
||||
composer php-zip php-curl php-xml php-mbstring
|
||||
```
|
||||
|
||||
Finally, add the Composer bin directory to your PATH, so you can run the `print-cli` command from anywhere:
|
||||
|
||||
```bash
|
||||
echo 'export PATH="$PATH:$HOME/.config/composer/vendor/bin"' >> ~/.bashrc
|
||||
```
|
||||
|
||||
## Step 3: Ensure CUPS is Running
|
||||
|
||||
Now we need to ensure that the CUPS service is running. CUPS is the printing system used by Print-CLI to send print jobs
|
||||
to the printer. This is the most important step, so make sure you follow it carefully, otherwise, Print-CLI won't work
|
||||
as expected, and you won't be able to print anything.
|
||||
|
||||
```bash
|
||||
sudo cupsctl --remote-admin --remote-any
|
||||
sudo usermod -aG lpadmin print-cli
|
||||
sudo /etc/init.d/cups restart
|
||||
```
|
||||
|
||||
Make sure the CUPS service is running by visiting the following URL in your browser:
|
||||
|
||||
```text
|
||||
https://10.20.0.195:631/printers/
|
||||
```
|
||||
|
||||
You should see a page with a list of printers. If you don't see any printers, you may need to add one manually.
|
||||
|
||||
Ensure that you can print a test page by clicking on the printer name and selecting "Print Test Page".
|
||||
|
||||
### Find the Printer Address
|
||||
|
||||
To find the printer address, visit your Printers page in CUPS, and click on the printer name. The address in the browser
|
||||
should look like this:
|
||||
|
||||
```text
|
||||
https://10.20.0.195:631/printers/EPSON_ET_2720_Series
|
||||
```
|
||||
|
||||
It contains the Name of the printer, which is the `printer-name` part. You can use this address in the configuration
|
||||
file for Print-CLI. In most cases, just replace the `https` with `ipp` and replace the ip to `127.0.0.1`:
|
||||
|
||||
```text
|
||||
ipp://127.0.0.1:631/printers/EPSON_ET_2720_Series
|
||||
```
|
||||
|
||||
## Step 4: Install Print-CLI
|
||||
|
||||
So far, we have installed all the required packages and ensured that CUPS is running. Now we can install Print-CLI using
|
||||
Composer, the PHP package manager. Run the following command to install Print-CLI globally:
|
||||
|
||||
```bash
|
||||
composer global require anikeen/print-cli
|
||||
```
|
||||
|
||||
You can also use the same command to update Print-CLI to the latest version:
|
||||
|
||||
```bash
|
||||
composer global require anikeen/print-cli
|
||||
```
|
||||
|
||||
## Step 5: Configure Print-CLI
|
||||
|
||||
With the latest version, you can automatically create your `/home/print-cli/print-cli.yml` with:
|
||||
|
||||
```bash
|
||||
print-cli init
|
||||
```
|
||||
|
||||
To test the configuration, run the following command:
|
||||
|
||||
```bash
|
||||
print-cli serve
|
||||
```
|
||||
|
||||
If everything is configured correctly, you should see the following output:
|
||||
|
||||
```text
|
||||
Starting service...
|
||||
Reading configuration...
|
||||
Service started!
|
||||
```
|
||||
|
||||
You can exit the service by pressing `Ctrl+C`.
|
||||
|
||||
## Step 6: Supervisor Configuration
|
||||
|
||||
To run Print-CLI as a service, we can use Supervisor. Supervisor is a process control system that allows you to monitor
|
||||
and control a number of processes on UNIX-like operating systems.
|
||||
|
||||
Create a new configuration file `/etc/supervisor/conf.d/print-cli.conf`:
|
||||
|
||||
```bash
|
||||
print-cli init:supervisor | sudo tee /etc/supervisor/conf.d/print-cli.conf > /dev/null
|
||||
```
|
||||
|
||||
Now, update Supervisor to read the new configuration file and start the Print-CLI service:
|
||||
|
||||
```bash
|
||||
sudo supervisorctl reread
|
||||
sudo supervisorctl update
|
||||
sudo supervisorctl start print-cli
|
||||
```
|
||||
|
||||
# Troubeshooting
|
||||
|
||||
## Orange PI 5 Plus Driver
|
||||
|
||||
### EPSON ET 2750
|
||||
Driver: Epson Expression ET-2750 EcoTank - CUPS+Gutenprint v5.3.3 (color)
|
||||
|
||||
```bash
|
||||
sudo apt install printer-driver-gutenprint
|
||||
```
|
||||
|
||||
## WLAN
|
||||
|
||||
https://www.makeuseof.com/connect-to-wifi-with-nmcli/
|
||||
Reference in New Issue
Block a user