Scanner GUI with NodeRed

In a former post I installed CUPS printer software for a Cannon printer. The scanning functionality is supported by the package SANE. But there is no nice GUI for the scanning function so I made one, with NodeRed(NR), which I really think is "wife" enabled.



If you are new to NodeRed here is a post to start with.

The first thing you have to check, with CUPS installed(including SANE), are which options the scanner accepts. It's done with the command 

$ sudo scanimage --help

Among others, one respons was regarding resolution

--resolution auto||75|150|300|600|1200dpi [75]

another was mode

--mode auto|Color|Gray|Lineart [Color]


which values I want to be able to change via the scanner GUI.

Lineart was a new scan function to me and very nice for drawings, since there is no greyscale, just black/white.

The NR flow starts with setting my defaults, via the function node "Default scan settings", as flow context data
  • Resolution     300 Dpi
  • Mode             Auto
The function node "Issue scan command" builds the command for the "Exec" node. To get unique file names I'm using the time but substitute the colons, ":", to a dash, "-", due too that in the Apple world colons are not allowed in filenames.

During the scan process the scan button goes red with a wait message and if somethings goes wrong with the scan command you will get an popup message.


The template node, the actual scan button, took some Googling to create....

<style>
.button {
height: 100%;
border-radius: 35px;
font-size: 28px;
font-weight: bold;
border-color: white;
border-style: solid;
border-width:10px;
}
</style>
<md-button
class="button"
style="{{'background-color:'+ msg.background}}"
ng-click="send({payload: 'scan'})">
<div ng-bind-html= "msg.topic"></div>
</md-button>

Comments

Popular post, last 30 days

Raspberry Pi OS Lite with GUI, RDP, VNC, Chromium

NetworkManager UI and access point, hotspot

iCloud drive sync, or mount, with a Linux, Ubuntu, device

Installing Ubuntu 24.04 or 24.10/25.04 on an old MacBook Air(2011)

Raspberry Pi 2, 3, 4, 5 USB SSD or USB drive boot

Clone the Raspberry boot disk

Signal K quick install, Raspberry Pi, Ubuntu

SeaTalk1 to NMEA 0183 converter, DIY

Volvo Penta NMEA 2000 Gateway

Waveshare CAN hat with Signal K & OpenPlotter