Salve, ho un printer server basato su slitaz-6.0 (current64). Funziona tutto, 3 stampanti ed uno scanner. Volevo aggiungere la funzione scanbd per la copia in locale ma mi trovo in difficoltà.
Vi chiedo come si imposta il /etc/services per avere saned alla richiesta di rete?
Io ho aggiunto
sane-port 6566/tcp sane saned # SANE network scanner daemon
e ad inetd.conf
sane-port stream tcp nowait saned.saned /usr/sbin/saned saned
ma se non avvio come utente normale “saned -a” non funziona.
Volendo integrare scanbd, le stesse due configurazioni sopra vanno cambiate?
Ho seguito varie guide trovate in rete ma ancora brancolo nel buio :-/
ottengo la copia dal pulsante sullo scanner, ma mi viene inibito l'accesso diretto (mi manca la funzione del servizio scanbm)
https://sourceforge.net/p/scanbd/discussion/897647/thread/1ebb0193/
https://wiki.archlinux.org/title/Scanner_Button_Daemon
https://learntutorials.net/it/raspberry-pi/topic/6701/creare-una-stazione-di-scansione-con-scanbd--raspbian-
Grazie a chiunque contribuisca a sbrogliare l'intrigo ;-)
Battaglia con Saned e Scanbd
(16 posts) (2 voices)-
Posted 2 weeks ago #
-
Hi gibor,
If understand (hope translation don't change sentence), you need to login as usual user for command to work ?
sane don't listen to 6566 port ?
I go to read and understand how should work, and how i could test it, i have hp deskjet 4100 work with hp-scan, maybe i can try to do something similar you want with scanbd
Posted 1 week ago # -
Ciao Shann,
Riassumo brevemente: scanbd mi serve tramite script per eseguire scansione sullo scanner e copia su di altra stampante.
il demone saned non si avvia in automatico. lo fa solo se do il comando come utente tux (normale) saned -a.
ma se avvio inetd il demone viene ucciso.
il demone scanbd viene avviato senza problemi da /etc/init.d/scanbd, ma richiede per forza anche un'avvio separato da inetd come scanbm (che è un semplice symlink a scanbd) funzione necessaria quando dalla rete scanimage chiede accesso allo scanner. in quel momento a sua volta scanbm interrompe momentaneamente il polling e lascia eseguire la scansione da remoto.
Non so come ma non mi sembra che ora saned sia in ascolto sulla porta tcp. Mi pare che l'avvio che eseguo sia in standalone, e che così inetd non sia necessario.Sempre se ho capito bene le caotiche istruzioni.
--------------------------------------------------------------------------
Hi Shann,
To summarize briefly: I need scanbd via script to scan on the scanner and copy to another printer.
The saned daemon does not start automatically. It only does so if I give the command as user tux (normal) saned -a.
But if I start inetd, the daemon is killed.
The scanbd daemon starts without problems from /etc/init.d/scanbd, but it also requires a separate start from inetd as scanbm (which is a simple symlink to scanbd), a function that is necessary when scanimage requests access to the scanner from the network. At that moment, scanbm temporarily interrupts polling and allows remote scanning to be performed.
I don't know how, but it doesn't seem to me that saned is now listening on the TCP port. It seems to me that the startup I perform is standalone, and that inetd is therefore not necessary.
That is, if I have understood the chaotic instructions correctly.Translated with DeepL.com (free version)
Posted 1 week ago # -
Grazie per la spiegazione.
Sviluppo libconfuse-dev, libconfuse richiesto da scanbd.
Per essere sicuri che abbiamo le stesse funzionalità, puoi confermare di usare questo comando di configurazione:# SliTaz package receipt.
PACKAGE="scanbd"
VERSION="f909458c"
CATEGORY="system-tools"
SHORT_DESC="Scanner button daemon looking for scanner button pressed."
MAINTAINER="maintainer@slitaz.org"
LICENSE="GPL2"
WEB_SITE="https://gitlab.com/sane-project/frontend/scanbd/"TARBALL="$PACKAGE-$VERSION.tar.gz"
WGET_URL="https://gitlab.com/sane-project/frontend/scanbd/-/archive/$VERSION/$TARBALL"DEPENDS="libconfuse dbus sane-backends"
BUILD_DEPENDS="libconfuse-dev libusb-compat-dev dbus-dev sane-backends-dev"HOST_ARCH="i486 x86_64"
# Rules to configure and make the package.
compile_rules()
{
./configure \
--prefix=/usr \
--with-docdir=/usr/share/doc/$PACKAGE-$VERSION \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--disable-systemd \
--with-systemdsystemunitdir="" \
$CONFIGURE_ARGS &&
make &&
make -j 1 DESTDIR=$DESTDIR install
}# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
mkdir -p $fs/usr/sbin
cp -a $install/usr/sbin/* $fs/usr/sbin
}Puoi postare per favore lo script /etc/init.d/scanbd ? Grazie.
Posted 1 week ago # -
Libconfuse compiled from source with
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
Scanbd compiled from source with
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-udev --with-group=scanner
/etc/init.d/scanbd#!/bin/sh
# /etc/init.d/scanbd: Start, stop and restart scanbd daemon on SliTaz, at boot
# time or with the command line.
#
# To start daemon at boot time, just put the right name in the $RUN_DAEMONS
# variable of /etc/rcS.conf and configure options with /etc/daemons.conf.
#
. /etc/init.d/rc.functions
. /etc/daemons.confNAME=scanbd
DESC="scanbd daemon"
DAEMON=/usr/sbin/scanbd
OPTIONS=$SCANBD_OPTIONS
PIDFILE=/var/run/scanbd.sockcase "$1" in
stop)
echo -n "Stopping $DESC: $NAME... "
killall -q scanbd
rm -f $PIDFILE
status
;;
start)
if [ ! -e $PIDFILE ]; then
echo -n "Starting $DESC: $NAME... "
$DAEMON $OPTIONS
status
else
echo -n "Not starting $DESC: $DESC is already running"
false
status
fi
;;
*)
echo ""
echo -e "33[1mUsage:33[0m /etc/init.d/basename $0[start|stop]"
echo ""
exit 1
;;
esacexit 0
Posted 1 week ago # -
Grazie Gibor,
Continua a lavorarci domani :)
Posted 1 week ago # -
Ciao Gibor,
Ho ricompilato scanbd con
--enable-udev --with-group=scanner, ho aggiunto integration/99-saned.rules su /etc/udev/rules.dPer un motivo sconosciuto, il demone scanbd non si avvia :/
root@slitaz:~# /etc/init.d/scanbd start
Avvio demone scanbd: scanbd... [ Echec ]Se provo a eseguire scanbd, il processo non viene registrato,
ps fauxnon elenca alcun processo :/Se capisco i pacchetti ArchLinux di scanbd, fornisce il doppio del servizio systemd per scanbd e scanbm.
Posted 1 week ago # -
I have some commitments that are taking up all my time, but I will resume my attempts as soon as I can.
However, there are two steps: a sane configuration as a client (net backend only) in /etc/sane.d, and a server in /etc/scanbd/sane.d (scanner USB backend).
To test it, you need to start in debug mode and foreground “scanbd -d 7 -f” from there, find out what's missing.
The main suspect is SANE_CONFIG_DIR not set. To hijack the startup, just use
SANE_CONFIG_DIR=/etc/scanbd/sane.d scanbd -d 7 -f
I made my last attempts by recompiling saned-1.4.0, and it seems that several problems have disappeared. It accepts saned -l -D without any issues, and it listens on port 6566.
--------------------------------------------------------------------------
Mi sono sopraggiunti impegni che non mi lasciano tempo, appena posso riprenderò i tentativi.
Comunque i passaggi sono due: una configurazione saned come client (solo net backend) in /etc/sane.d, ed una server in /etc/scanbd/sane.d (backend usb dello scanner).
Per provare ti serve l'avvio in debug e foreground “scanbd -d 7 -f” da lì scopri cosa manca.
Il principale indiziato è SANE_CONFIG_DIR no set. Per dirottare l'avvio basta
SANE_CONFIG_DIR=/etc/scanbd/sane.d scanbd -d 7 -f
gli ultimi tentativi li ho fatti ricompilando saned-1.4.0, e mi pare che parecchi problemi scompaiano. Accetta pure saned -l -D senza storie, ed è in ascolto sulla porta 6566.Posted 1 week ago # -
Ok, grazie per le informazioni, devo verificarlo.
Se la versione 1.4.0 funziona senza problemi, devo assicurarmi che il bump della versione 1.0.32 non faccia regressione e aggiornarlo.
Per scanbd, quali file hai nel pacchetto? Nel mio caso solo la cartella sbin e le regole udev, ma hai detto di definire SANE_CONFIG_DIR=/etc/scanbd/sane.d?
Posted 1 week ago # -
files.list
/etc/init.d/scanbd
/etc/dbus-1/system.d/scanbd_dbus.conf
/etc/scanbd/scripts/example.script
/etc/scanbd/scanner.d
/etc/scanbd/scanner.d/avision.conf
/etc/scanbd/scanner.d/fujitsu.conf
/etc/scanbd/scanner.d/pixma.conf
/etc/scanbd/scanner.d/snapscan.conf
/etc/scanbd/scanner.d/plustek.conf
/etc/scanbd/scanner.d/canon.conf
/etc/scanbd/scanner.d/hp.conf
/etc/scanbd/scanbd.conf
/usr/share/man/man8
/usr/share/man/man8/scanbm.8
/usr/share/man/man8/scanbd.8
/usr/sbin/scanbd
/usr/sbin/scanbmThey were just tests, since it only worked when I put dll.conf and pixma.conf directly in the /etc/scanbd folder.
They talk about two saned configurations (server/client), and scanbd was looking for the configuration in /etc/sane.d, when in fact the server configuration was in /etc/scanbd/sane.d. With that trick, I was diverting the startup.
From what I understood, scanbd wants the saned server configuration, while the real saned (daemon or inetd) wants the client configuration. Through the localhost, it must point to the server managed by scanbd.
Since the guides on the net are ambiguous, and inserting only the copy of the files from /etc/sane.d into /etc/scanbd/sane.d was the only way I found to start it.
But for me, it's still all to be discovered...
---------------------------------------------------------------------------
Erano solo prove visto che funzionava solo nel caso che inserivo dll.conf e pixma.conf direttamente nella cartella /etc/scanbd.
Parlano di due configurazioni di saned (server/client) e scanbd cercava la configurazione in /etc/sane.d, quando invece quella di server stava in /etc/scanbd/sane.d, con quel trucco deviavo l'avvio.
Da quello che capivo scanbd vuole la configurazione saned server, mentre il saned reale (daemon o inetd) quella di client. Attraverso il localhost deve puntare al server gestito da scanbd.
Visto che le guide in rete sono ambigue, ed inserendo solo la copia dei file di /etc/sane.d in /etc/scanbd/sane.d era l'unico modo che avevo trovato per avviarlo.
Ma per me è ancora tutto da scoprire...Posted 1 week ago # -
Allora sono riuscito a far funzionare i pulsanti da scanbd, ma non tutto va alla perfezione.
C'è un discreto ritardo fra la pressione del tasto scan e l'avvio della scansione (25-30”) ed ancora non ho capito da dove proviene questo ritardo. Visto che da riga di comando, o da xsane la scansione è immediata.
Tornando alla configurazione inizio col dire che la cosa è parecchio complicata. I pacchetti sane-backends e scanbd sul repo sono sbagliati. Come fare a correggerli è tutto da scoprire.
Saned deve avviarsi come demone senza problemi. Cosa che non avviene.
Scanbd deve dare l'output in foreground da riga di comando. Cosa che non avviene.
Ricompilati entrambi da sorgenti e quei problemi scompaiono.
Come configurare scanbd:
Si inizia con il testare scanimage -L che riconosca lo scanner. Se sì si prosegue con il passo successivo.
Copia della cartella /etc/sane.d in /etc/scanbd/sane.d
modifica di /etc/sane.d./dll.conf con abilitato solo il backend net attivo
modifica di /etc/sane.d./net.conf con le righe attive e così modificate
connect_timeout = 3
localhost
modifica di /etc/scanbd/sane.d./dll.conf con abilitato solo il backend dello scanner usato attivo
modifica di /etc/scanbd/sane.d./saned.conf con le righe attive e così modificate# /etc/services must also be properly configured to start
# the saned daemon as documented in saned(8), services(4)
# and inetd.conf(4) (or xinetd.conf(5)).
#required
localhostmodifica di /etc/scanbd/scanbd.conf cambiando user in root e group in scanner. Inoltre bisogna cambiare il percorso alle riga
saned_env = { "SANE_CONFIG_DIR=/etc/scanbd" } in
saned_env = { "SANE_CONFIG_DIR=/etc/scanbd/sane.d" }
modifica di /etc/inetd.conf commentando l'eventuale saned ed inserendo
sane-port stream tcp nowait root /usr/sbin/scanbm scanbm
modifica di /etc/services aggiungendo le righe
sane-port 6566/tcp # SANE Control Port
sane-port 6566/udp # SANE Control Port
modifica di /etc/dbus-1/system.d/scanbd_dbus.conf cambiando l'user saned in root (causava problema nell'esecuzione degli script)
riavvio di inetd (/etc/init.d/inetd restart)
ora se non ho saltato passaggi la verifica di scanimage -L deve mostrare la periferica come net:
se fin qui tutto va bene ora si avvia scanbd in debug con
SANE_CONFIG_DIR=/etc/scanbd/sane.d scanbd -d 7 -f
si deve vedere in terminale il polling sullo scanner
da altro terminale si esegue il comando scanimage -A
se restituisce le opzioni del backend significa che scanbm è intervenuto ed è tutto a posto
ora creazione del lanciatore in /etc/init.d/scanbd#!/bin/sh
# /etc/init.d/scanbd: Start, stop and restart scanbd deamon on SliTaz, at boot
# time or with the command line.
#
# To start daemon at boot time, just put the right name in the $RUN_DAEMONS
# variable of /etc/rcS.conf and configure options with /etc/daemons.conf.
#
. /etc/init.d/rc.functions
. /etc/daemons.confNAME=scanbd
DESC="scanbd deamon"
DAEMON=/usr/sbin/scanbd
OPTIONS=$SCANBD_OPTIONS
PIDFILE=/var/run/scanbd.sock
case "$1" in
stop)
echo -n "Stopping $DESC: $NAME... "
killall -q scanbd
rm -f $PIDFILE
status
;;
start)
if [ ! -e $PIDFILE ]; then
echo -n "Starting $DESC: $NAME... "
SANE_CONFIG_DIR=/etc/scanbd/sane.d $CONFIG $DAEMON $OPTIONS
status
else
echo -n "Not starting $DESC: $DESC is already running"
false
status
fi
;;
*)
echo ""
echo -e "33[1mUsage:33[0m /etc/init.d/basename $0[start|stop]"
echo ""
exit 1
;;
esacexit 0
gli script desiderati per ora non li ho descritti, ma il percorso va inserito al posto di example.script in
/etc/scanbd/scanner.d/”scanner”.conf
con scanner.conf si identifica il vostro rilevato.
Dopo tanti tentativi spero di non aver tralasciato nessun passaggio.Posted 1 week ago # -
Ciao Gibor,
Grazie per le informazioni, devo prendermi del tempo per i test nel tardo pomeriggio, poi inizierò ad allenarmi per le prossime due settimane.
Posted 1 week ago # -
Sebbene ritengo sia argomento di nicchia vi aggiorno sugli sviluppi di scanbd, visto che sembra funzioni tutto alla perfezione. Per arrivare a questo punto sono cambiate alcune cose:
1)compilato scanbd con
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --with-group=scanner USE_SANE=yes
2)abbandonato la doppia configurazione di sane.d (solo quella originale funzionante in /etc/sane.d come prima dell'installazione di scanbd)
3)aggiunta dell'utente saned (saned:x:1001:96:saned:/dev/null:/bin/false)
4)ripristino dell'utente saned in /etc/dbus-1/system.d/scanbd_dbus.conf
5)in /etc/scanbd/scanbd.conf indicato il percorso di sane.d (saned_env = { "SANE_CONFIG_DIR=/etc/sane.d" })
6)avvio di scanbd senza il dirottamento precedente (rimosso SANE_CONFIG_DIR=/etc/scanbd/sane.d dal lanciatore).
7)/etc/inetd.conf con entrambe le righe abilitate
sane-port stream tcp nowait root /usr/sbin/saned saned
sane-port stream tcp nowait root /usr/sbin/scanbm scanbm
8)gli script vanno inseriti obbligatoriamente in /etc/scanbd/scripts
il mio es.
cat /etc/scanbd/scripts/fotocopia-bn.bin
#!/bin/sh
scanimage -l 0 -t 0 -x 210 -y 297 --button-controlled=no --resolution 150 -o /tmp/image.png ; convert -brightness-contrast -10,20 /tmp/image.png /tmp/image.pdf ; lp -d Laserjet2100 /tmp/image.pdf; rm /tmp/image.pdf; rm /tmp/image.pngHo ottenuto che il ritardo alla pressione del pulsante è scomparso
inoltre si può eseguire la scansione sia da remoto che in locale come prima dell'installazione di scanbd.Ci tenevo a descrivere questo poiché si differenzia in maniera abbastanza sostanziale da ciò che viene detto in rete sulla varie guide.
Posted 3 days ago # -
Ciao Gibor,
Scusa se, con l'addestramento, non perdo tempo a ricontrollare le cose di "scanbd" :/.
È bello leggere che hai una soluzione funzionante e che la condividi, ho aggiornato la ricevuta di "scanbd" con le tue note.Tranne la cartella degli script con /etc/scanbd/scripts/fotocopia-bn.bin
# SliTaz package receipt.
PACKAGE="scanbd"
VERSION="f909458c"
CATEGORY="system-tools"
SHORT_DESC="Scanner button daemon looking for scanner button pressed."
MAINTAINER="maintainer@slitaz.org"
LICENSE="GPL2"
WEB_SITE="https://gitlab.com/sane-project/frontend/scanbd/"TARBALL="$PACKAGE-$VERSION.tar.gz"
WGET_URL="https://gitlab.com/sane-project/frontend/scanbd/-/archive/$VERSION/$TARBALL"DEPENDS="libconfuse dbus udev sane-backends"
BUILD_DEPENDS="libconfuse-dev libusb-compat-dev dbus-dev \
udev-dev sane-backends-dev"HOST_ARCH="i486 x86_64"
# Rules to configure and make the package.
compile_rules()
{
./configure \
--prefix=/usr \
--with-docdir=/usr/share/doc/$PACKAGE-$VERSION \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--disable-systemd \
--with-systemdsystemunitdir="" \
--enable-udev \
--with-group=scanner \
USE_SANE=yes \
$CONFIGURE_ARGS &&
make &&
make -j 1 DESTDIR=$DESTDIR install
}# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
mkdir -p $fs/usr/sbin $fs/etc/init.d $fs/etc/udev/rules.d
mkdir -p $fs/etc/dbus-1/system.d $fs/etc/scanbd
cp -a $install/usr/sbin/* $fs/usr/sbin
cp -a $src/integration/99-saned.rules $fs/etc/udev/rules.d
sed -i 's/GROUP="saned"/GROUP="scanner"/' \
$fs/etc/udev/rules.d/99-saned.rules
cp -a $src/conf/scanbd.conf $fs/etc/scanbd
sed -i 's|SANE_CONFIG_DIR=/etc/scanbd|SANE_CONFIG_DIR=/etc/sane.d|g' \
$fs/etc/scanbd/scanbd.conf
cp -a $src/integration/scanbd_dbus.conf $fs/etc/dbus-1/system.d
cp -a $stuff/scanbd $fs/etc/init.d
}post_install()
{
chroot "$1/" adduser -D -s /bin/false -h /dev/null saned[ -s "$1/etc/inetd.conf" ] &&
! grep -qs sane-port "$1/etc/inetd.conf" &&
cat >> "$1/etc/inetd.conf" <<EOT
sane-port stream tcp nowait root /usr/sbin/saned saned
sane-port stream tcp nowait root /usr/sbin/scanbm scanbm
EOT
true
}post_remove()
{
echo "Removing user/group saned"
chroot "$1/" deluser saned
grep -q sane-port "$1/etc/inetd.conf" &&
sed -i '/sane-port/d' "$1/etc/inetd.conf"
}Spero che funzioni come previsto.
Posted 3 days ago # -
Test che sto facendo, scanbd si è rifiutato di avviarsi
Si rifiuta di avviare scanbd.conf che fa riferimento a scanner.d/avision.conf. Se cambio il percorso corretto, si lamenta dell'opzione sconosciuta.
Se commento "linee avision.conf, fujitsu.conf, hp.conf, snapscan.conf, canon.conf e plustek.conf", il demone scanbd si avvia correttamente.
Posted 3 days ago #
Reply »
You must log in to post.