DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2009-04-28 22:46:18

Pingue28
Member
Registered: 2009-04-28
Posts: 8

Scanner: hplip & sane-backends

Hi,
I try to configure my printer/scanner HP Photosmart C4280 to be use with my DNS323.
I read lot of topics to know how install sane-backends and use my DNS-323 as a scanner's server.

Here the procedure I used that start with an empty DNS-323 (with no customization) (FW: 1.06)

Code:

1. Copy fun_plug and fun_plug.tgz to Volume1
2. Reboot
3. Delete fun_plug.tgz from Volume1
4. Install IPKG:
mkdir -p /opt
mkdir -p /mnt/HD_a2/ipkg/opt
mount -o bind /mnt/HD_a2/ipkg/opt /opt
export PATH=/opt/bin:/opt/sbin:$PATH

feed=http://ipkg.nslu2-linux.org/feeds/optware/dns323/cross/unstable
ipkg_name=`wget -qO- $feed/Packages | awk '/^Filename: ipkg-opt/ {print $2}'`
wget $feed/$ipkg_name
zcat $ipkg_name | tar -xOvf - ./data.tar.gz | zcat | tar -C / -xvf -
echo src dns323 http://ipkg.nslu2-linux.org/feeds/optware/dns323/cross/unstable >> /opt/etc/ipkg.conf
ipkg update


5. Install SANE & HPLIB
ipkg remove hpijs

ipkg install sane-backends
ipkg install libieee1284
echo "sane-port  stream  tcp  nowait  root.root  /opt/sbin/saned saned" > /ffp/etc/inetd.conf

ipkg install cups
ipkg install hplip # Choice for dll.conf => Overwrite current version

ipkg install python
ipkg install coreutils

mkdir /opt/bin/data
mkdir /opt/bin/data/models
ln -s /opt/share/hplip/data/models/models.dat /opt/bin/data/models
ln -s /opt/share/hplip/hpssd.py /opt/bin

cd /opt/bin
rm python
ln -s /opt/bin/python2.5 python
ln -s /bin/env /usr/bin/env

./python2.5 hp-probe
# Here, my printer/scanner is detected by hp-probe and by sane-find-scanner

# In /opt/etc/sane.d/dll.d, I just have "hpaio"

SANE_DEBUG_DLL=128 scanimage -L

scanimage debug:

Code:

/opt/bin # SANE_DEBUG_DLL=128 ./scanimage -L
[sanei_debug] Setting debug level of dll to 128.
[dll] sane_init: SANE dll backend version 1.0.12 from sane-backends 1.0.20cvs
[dll] sane_init/read_dlld: processing /opt/etc/sane.d/dll.d ...
[dll] sane_init/read_dlld: done.
[dll] sane_init/read_config: reading dll.conf
[dll] add_backend: adding backend `hpaio'
[dll] sane_get_devices
[dll] load: searching backend `hpaio' in `/opt/lib/sane'
[dll] load: trying to load `/opt/lib/sane/libsane-hpaio.so.1'
[dll] load: dlopen()ing `/opt/lib/sane/libsane-hpaio.so.1'
[dll] load: dlopen() failed (File not found)
[dll] sane_get_devices: found 0 devices

scanimage don't find /opt/lib/sane/libsane-hpaio.so but the file is there!
I tried to recreate links, and finally, I copied the real so to so.1 and so.1.0.0

May be, I have to update hplip but I didn't find how to compile the new version in my Dns323.

Does somebody have had this problem?
If not, how can I compile hplip for my DNS323.

Thanks,
David

Offline

 

#2 2009-04-29 02:29:17

bzhou
Member
Registered: 2008-02-15
Posts: 171

Re: Scanner: hplip & sane-backends

I'm not sure, but uclibc (early version) might have problem of dlopen'ed lib dlopen'ing another lib.
See http://www.geocities.com/robm351/uclibc/index-8.html
That's also why optware python links with more libs than necessary if it's uclibc.
You might want to try LD_PRELOAD and see if it helps.

Offline

 

#3 2009-04-29 12:20:53

Pingue28
Member
Registered: 2009-04-28
Posts: 8

Re: Scanner: hplip & sane-backends

IT WORKS !!!!! THANKS!!!

I have to install dbus and export LD_PRELOAD :

Code:

ipkg install dbus
export LD_PRELOAD=/opt/lib/sane/libsane-hpaio.so.1

/ # scanimage -L
[sanei_debug] Setting debug level of dll to 128.
[dll] sane_init: SANE dll backend version 1.0.12 from sane-backends 1.0.20cvs
[dll] sane_init/read_dlld: processing /opt/etc/sane.d/dll.d ...
[dll] sane_init/read_dlld: done.
[dll] sane_init/read_config: reading dll.conf
[dll] add_backend: adding backend `hpaio'
[dll] sane_get_devices
[dll] load: searching backend `hpaio' in `/opt/lib/sane'
[dll] load: trying to load `/opt/lib/sane/libsane-hpaio.so.1'
[dll] load: dlopen()ing `/opt/lib/sane/libsane-hpaio.so.1'
[dll] init: initializing backend `hpaio'
[dll] init: backend `hpaio' is version 1.0.0
[dll] sane_get_devices: found 1 devices
device `hpaio:/usb/Photosmart_C4200_series?serial=TH123456789P' is a Hewlett-P
ackard Photosmart_C4200_series all-in-one
[dll] sane_exit: exiting
[dll] sane_exit: calling backend `hpaio's exit function
[dll] sane_exit: finished

Thanks,
David

Offline

 

#4 2009-04-29 13:58:56

Pingue28
Member
Registered: 2009-04-28
Posts: 8

Re: Scanner: hplip & sane-backends

Now I have the same problem as craig: http://dns323.kood.org/forum/viewtopic.php?pid=26765
When I run scanimage to start an aquisition, I got a dbus error:

Code:

/ # scanimage
process 9438: arguments to dbus_connection_send() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 3046.
This is normally a bug in some application using the D-Bus library.
  D-Bus not compiled with backtrace support so unable to print a backtrace
Aborted

My scanner moves a bit and writes "Scanning..." on his little embedded screen and nothing...
I have to turn it off and on to reset it.

Hope somebody have resolved this problem.
Thanks,
David

Offline

 

#5 2009-05-01 13:08:00

Pingue28
Member
Registered: 2009-04-28
Posts: 8

Re: Scanner: hplip & sane-backends

Now everything works.
Here a clean procedure to install ffp+ipkg+sane-backends+hplip(Library for HP printers)

Code:

1. Copy fun_plug and fun_plug.tgz to Volume1
2. Reboot
3. Delete fun_plug.tgz from Volume1 if still present

********************************************************
4. Install IPKG:
********************************************************
mkdir -p /opt
mkdir -p /mnt/HD_a2/ipkg/opt
mount -o bind /mnt/HD_a2/ipkg/opt /opt
export PATH=/opt/bin:/opt/sbin:$PATH

feed=http://ipkg.nslu2-linux.org/feeds/optware/dns323/cross/unstable
ipkg_name=`wget -qO- $feed/Packages | awk '/^Filename: ipkg-opt/ {print $2}'`
wget $feed/$ipkg_name
zcat $ipkg_name | tar -xOvf - ./data.tar.gz | zcat | tar -C / -xvf -
echo src dns323 http://ipkg.nslu2-linux.org/feeds/optware/dns323/cross/unstable >> /opt/etc/ipkg.conf
ipkg update

********************************************************
5. Install SANE & HPLIB
********************************************************
cd /opt
ipkg install sane-backends
ipkg install libieee1284
ipkg install hplip # Default choice for dll.conf => Y overwrite current version
ipkg install cups
ipkg install dbus

mkdir /opt/bin/data
mkdir /opt/bin/data/models
ln -s /opt/share/hplip/data/models/models.dat /opt/bin/data/models
ln -s /opt/share/hplip/hpssd.py /opt/bin

echo "sane-port  stream  tcp  nowait  root.root  /opt/sbin/saned saned" > /ffp/etc/inetd.conf

echo "echo \"sane-port 6566/tcp # SANE network scanner daemon\" >> /etc/services" > /ffp/start/sane.sh
echo "echo \"usbfs           /proc/bus/usb   usbfs   defaults''',devmode=0666'''   0  0\" >> /etc/fstab" >> /ffp/start/sane.sh
echo "mount /proc/bus/usb -o remount,devmode=0666" >> /ffp/start/sane.sh

echo "mkdir -p /opt" >> /ffp/start/sane.sh
echo "mount -o bind /mnt/HD_a2/ipkg/opt /opt" >> /ffp/start/sane.sh
#echo "export PATH=\$PATH:/opt/bin:/opt/sbin" >> /ffp/start/sane.sh # Doesn't works => PATH added to /ffp/etc/rc

echo "groupadd -g 84 messagebus" >> /ffp/start/sane.sh
echo "useradd -c 'System message bus' -u 84 -g messagebus -d '/' -s /bin/false messagebus" >> /ffp/start/sane.sh
echo "/opt/bin/dbus-daemon --system --print-address" >> /ffp/start/sane.sh

chmod a+x /ffp/start/inetd.sh
chmod a+x /ffp/start/sane.sh

#edit the /opt/etc/sane.d/saned.conf to include your network range or ip-addresses where you want to scan from
vi /opt/etc/sane.d/saned.conf

#Edit /ffp/etc/rc and add :/opt/bin:/opt/sbin to the PATH export
vi /ffp/etc/rc

reboot

Finally, if you want install fan control script (http://dns323.kood.org/hardware:fan) download "fonz_funplug_0.3_w_fan_control.rar" and copy ctrl_fanspeed.sh into /ffp/start/
Activate the script "chmod a+x /ffp/start/ctrl_fanspeed.sh"

David

Offline

 

#6 2009-05-01 16:10:33

LuckyBlack
Member
Registered: 2009-04-30
Posts: 51

Re: Scanner: hplip & sane-backends

hi Pingue, i followed your procedure and the installation was fine... but there is a problem...
using the Xsane Win32 version to access my DeskJetF370 attached to DNS-323 , when i try to acquire preview i'm asked for USER a PWD but i didn't set password or user... which one i must use ??

Offline

 

#7 2009-05-01 17:31:49

Pingue28
Member
Registered: 2009-04-28
Posts: 8

Re: Scanner: hplip & sane-backends

Happy to know my procedure help!
It's the user "root"

Do you know if XSane is better than SaneTwain?
Is it working with TWAIN?

Offline

 

#8 2009-05-01 17:45:50

LuckyBlack
Member
Registered: 2009-04-30
Posts: 51

Re: Scanner: hplip & sane-backends

ok the user it's "root" but i have no password for root.... when i insert the user e press ok Xsane crash...
I tryed also SaneTwain 1.27c and 1.29RC2 it recognize the scanner , don't ask for password but when i try to scan don't do anything
and the power led on my DeskJetF370 start to blink but the scanner doesn't work

Offline

 

#9 2009-05-01 17:47:18

LuckyBlack
Member
Registered: 2009-04-30
Posts: 51

Re: Scanner: hplip & sane-backends

another question... if i cannot make sane work, i would uninstall it... can you provide a procedure to do this... thank

Offline

 

#10 2009-05-01 17:50:19

Pingue28
Member
Registered: 2009-04-28
Posts: 8

Re: Scanner: hplip & sane-backends

Is /opt/bin/scanimage working on DNS323 (by telnet)?
If not, use this: SANE_DEBUG_DLL=128 scanimage to have a trace.

To uninstall and clean your DNS323 you can type:

Code:

rm -R /mnt/HD_a2/ffp/
rm -R /mnt/HD_a2/ipkg/

But be carefull with this command, because you can delete everything if you make a mistake.

Offline

 

#11 2009-05-01 19:02:10

LuckyBlack
Member
Registered: 2009-04-30
Posts: 51

Re: Scanner: hplip & sane-backends

i want to uninstall only the part relative to sane and ipkg non ffp i use it...

Offline

 

#12 2009-05-01 22:33:00

luusac
Member
Registered: 2008-04-29
Posts: 360

Re: Scanner: hplip & sane-backends

doesn't optware include a remove command? ipkg remove packagename

Offline

 

#13 2009-05-10 00:19:33

ijm51000
New member
Registered: 2009-05-10
Posts: 1

Re: Scanner: hplip & sane-backends

I am having the same problem as LuckyBlack, it did all work test scans from windows and linux clients using xsane no problem, had to reboot and now I get 'authorisation required for net:xxx.xxx.xxx.xxx'  backend requests plain text password, root user and password just kills xsane.  Anyone solved this yet?

Offline

 

#14 2009-05-11 02:11:21

Pingue
Member
Registered: 2008-05-19
Posts: 11

Re: Scanner: hplip & sane-backends

I don't understant?
It did works and after a reboot of your DNS323, it doesn't ?

I don't know how works xsane but sanetwain just need a username which is root.
Here my sane twain configuration (C:\WINDOWS\sanetwain.ini)

Code:

[Connection]
Host=192.168.3.15
User=root
Port=6566
GetDevices=1
Device=hpaio:/usb/Photosmart_C4200_series?serial=TH882993884
[Preview]
UseMinimum=0
Resolution=30
AutoStart=0
[Scan]
AutoStart=0
[General]
TopMost=1
HideDisabled=0
RemoveRegions=1
SaveRegions=0
WindowSize=132;162;493;635
Language=en
[ADF]
SinglePage=1
[Save]
AsJPEG=0
JPEGQuality=80

Let me know,
David

Last edited by Pingue (2009-05-11 02:12:12)

Offline

 

#15 2009-05-11 13:23:57

LuckyBlack
Member
Registered: 2009-04-30
Posts: 51

Re: Scanner: hplip & sane-backends

also my config is like your  Pingue,  but as ijm51000 sayd i can't succeed in make it working... with my HP DESKJET F370

Last edited by LuckyBlack (2009-05-11 13:24:26)

Offline

 

#16 2009-05-11 19:08:23

Pingue
Member
Registered: 2008-05-19
Posts: 11

Re: Scanner: hplip & sane-backends

First of all, did you copy each line of my procedure one by one?
(because I have seen it doesn't work to copy and paste more than one line at the same time)

If scanimage works and if it's a problem of sane's networking part:

Try this manually:

Code:

groupadd -g 84 messagebus
useradd -c 'System message bus' -u 84 -g messagebus -d '/' -s /bin/false messagebus
/opt/bin/dbus-daemon --system --print-address

If it works, it's a problem in your sane.sh
If it doesn't, check your saned.conf: you have to uncomment a line to include the address of your network (192.168.1.0 in example).
If it doesn't, check /ffp/etc/inetd.conf (that's here we tell to start saned when a connection is made)

If it doesn't, you can check every files which are modified by my procedure with "echo xxx > file"

Hope it will help you to find the problem.
David

Last edited by Pingue (2009-05-11 19:09:16)

Offline

 

#17 2009-05-11 19:42:52

LuckyBlack
Member
Registered: 2009-04-30
Posts: 51

Re: Scanner: hplip & sane-backends

if i run scanimage this is result....

root@dlink-DD598E:/opt/bin# ./scanimage
process 14173: arguments to dbus_connection_send() were incorrect, assertion "co
nnection != NULL" failed in file dbus-connection.c line 3099.
This is normally a bug in some application using the D-Bus library.
  D-Bus not compiled with backtrace support so unable to print a backtrace
Aborted

Offline

 

#18 2009-05-11 20:06:10

Pingue
Member
Registered: 2008-05-19
Posts: 11

Re: Scanner: hplip & sane-backends

I have had the same problem and I fixed it with :

Code:

groupadd -g 84 messagebus
useradd -c 'System message bus' -u 84 -g messagebus -d '/' -s /bin/false messagebus
/opt/bin/dbus-daemon --system --print-address

Offline

 

#19 2009-05-11 20:35:55

LuckyBlack
Member
Registered: 2009-04-30
Posts: 51

Re: Scanner: hplip & sane-backends

i have it in my sane.sh

but i soved

inserting this line

rm /opt/var/run/dbus/pid at top of sane.sh

now xsane go

Last edited by LuckyBlack (2009-05-11 20:50:39)

Offline

 

#20 2009-05-17 15:27:07

Pingue
Member
Registered: 2008-05-19
Posts: 11

Re: Scanner: hplip & sane-backends

Sorry, I didn't see but I have had the same problem.
Here the new procedure:

Code:

1. Copy fun_plug and fun_plug.tgz to Volume1
2. Reboot
3. Delete fun_plug.tgz from Volume1 if still present

********************************************************
4. Install IPKG:
********************************************************
mkdir -p /opt
mkdir -p /mnt/HD_a2/ipkg/opt
mount -o bind /mnt/HD_a2/ipkg/opt /opt
export PATH=/opt/bin:/opt/sbin:$PATH

feed=http://ipkg.nslu2-linux.org/feeds/optware/dns323/cross/unstable
ipkg_name=`wget -qO- $feed/Packages | awk '/^Filename: ipkg-opt/ {print $2}'`
wget $feed/$ipkg_name
zcat $ipkg_name | tar -xOvf - ./data.tar.gz | zcat | tar -C / -xvf -
echo src dns323 http://ipkg.nslu2-linux.org/feeds/optware/dns323/cross/unstable >> /opt/etc/ipkg.conf
ipkg update

********************************************************
5. Install SANE & HPLIB
********************************************************
cd /opt
ipkg install sane-backends
ipkg install libieee1284
ipkg install hplip # Default choice for dll.conf => Y overwrite current version
ipkg install cups
ipkg install dbus

mkdir /opt/bin/data
mkdir /opt/bin/data/models
ln -s /opt/share/hplip/data/models/models.dat /opt/bin/data/models
ln -s /opt/share/hplip/hpssd.py /opt/bin

echo "sane-port  stream  tcp  nowait  root.root  /opt/sbin/saned saned" > /ffp/etc/inetd.conf

echo "echo \"sane-port 6566/tcp # SANE network scanner daemon\" >> /etc/services" > /ffp/start/sane.sh
echo "echo \"usbfs           /proc/bus/usb   usbfs   defaults''',devmode=0666'''   0  0\" >> /etc/fstab" >> /ffp/start/sane.sh
echo "mount /proc/bus/usb -o remount,devmode=0666" >> /ffp/start/sane.sh

echo "mkdir -p /opt" >> /ffp/start/sane.sh
echo "mount -o bind /mnt/HD_a2/ipkg/opt /opt" >> /ffp/start/sane.sh
#echo "export PATH=\$PATH:/opt/bin:/opt/sbin" >> /ffp/start/sane.sh # Doesn't works => PATH added to /ffp/etc/rc

echo "groupadd -g 84 messagebus" >> /ffp/start/sane.sh
echo "useradd -c 'System message bus' -u 84 -g messagebus -d '/' -s /bin/false messagebus" >> /ffp/start/sane.sh
echo "rm /opt/var/run/dbus/pid" >> /ffp/start/sane.sh
echo "/opt/bin/dbus-daemon --system --print-address" >> /ffp/start/sane.sh

chmod a+x /ffp/start/inetd.sh
chmod a+x /ffp/start/sane.sh

edit the /opt/etc/sane.d/saned.conf to include your network range or ip-addresses where you want to scan from
vi /opt/etc/sane.d/saned.conf

Edit /ffp/etc/rc and add :/opt/bin:/opt/sbin to the PATH export
vi /ffp/etc/rc

reboot

David

Offline

 

#21 2012-12-06 03:06:46

Berengodo
New member
Registered: 2012-12-05
Posts: 2

Re: Scanner: hplip & sane-backends

EXCELENT JOB.   WORKS GREAT !    Have a DNS 323 Firmware 1.09 fonz fun plug 07.  usb HP Photosmart C4400.  With the sanetwain  I don´t need to unplug my printer tu use the scanner anymore: Shareport never worked well for me, I'm W7 user and Shareport crashed all the time, or went unplugged in the middle of a printjob... anoying... no to mention the absurd of sharing devecies on the network BUT only 1 user per  device at the time...

The printer server of the dns 323 (without the portshare) has always been a great deal and with this procedure you can run your MFC printer on it as well.   Thanks Pingue and all you guys !

Last edited by Berengodo (2012-12-06 03:48:39)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB