Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 15 Jul 2018, 21:20
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
No /dev/bus/usb/ in Lucid Puppy
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [30 Posts]   Goto page: 1, 2 Next
Author Message
ahoppin

Joined: 16 May 2011
Posts: 155

PostPosted: Fri 16 Mar 2018, 12:31    Post subject:  No /dev/bus/usb/ in Lucid Puppy
Subject description: Problems scanning as spot
 

Sorry the following is so long. The gist of it is that I need to know where the usb character special device files are in Lucid Puppy's /dev directory. I found some, but they don't do what I need them to do.

Details:

I'm using Lucid 5.2.5 full and xsane 0.996. (Old dog, I know, but still catching tennis balls just fine.)

Xsane says that the world will end if I run it as root, so for years I ran it as spot (su -c xsane spot) with a Umax scsi scanner. To do this I had a shell script that used sane-find-scanner to determine the scanner's port, then ran a chmod o+rw command on that port. Worked fine.

chmod o+rw `sane-find-scanner | grep dev | cut -c52-`
su -c xsane spot

The Umax recently died in a power surge. I replaced it with an almost-as-old Epson Perfection 2400 USB scanner. This is listed as fully supported (as "Epson GT-9300 flatbed scanner") in sane.

It scans perfectly when I run xsane as root.

However, the same permissions trick I used before now doesn't work, so I can't scan as spot any more.

When I'm spot, sane-find-scanner reports:

found USB scanner (vendor=0x04b8, product=0x011b) at libusb:001:004

All well and good.

But as spot, scanimage -L says:

No scanners were identified.

So I can run xsane as root just fine, but not as spot.

I see lots of questions about this on other forums with Ubuntu, Arch, Slackware, and so on. All report the same symptom -- they can run xsane as root, but not as a normal user.

The forums have various solutions. The "legit" fix, I guess, uses udev.

Some suggest the same quick and dirty solution I used for the scsi scanner -- changing permissions of the USB device the scanner's using. And that's fine with me. But I can't get it to work with the USB port.

All these forums devoted to other distros say to set permissions on your scanner's USB device in /dev/bus/usb.

Following their format, for my present setup, that would be

chmod go+rw /dev/bus/usb/001/004

But that doesn't work.

The problem is that Lupu 5.2.5 doesn't have the /dev/bus directory at all.

(Precise 5.7.1 on another machine does, but I haven't yet tried using the scanner on that machine.)

Lucid DOES have /dev/usb, which contains character special files scanner0 (180, 48) and scanner1 (180, 49). Changing the permissions of these devices to 666 has no effect on sane or scanimage. Spot doesn't get to scan.

Lucid ALSO has the character special /dev/usbdev1.4 (189,3). That would seem to be equivalent to libusb:001:004. Changing that device's permissions to 666 ALSO has no effect on xsane or scanimage. Spot still doesn't get to scan.

I'm stumped.

I can scan as root, bypassing xsane's we're-all-gonna-die don't-run-me-as-root message.

But it's making me crazy that I can't figure out what device to change permissions on so that ***spot*** can talk to my USB scanner (which worked perfectly with my old SCSI scanner).

Again, sorry for the long post, I hope it makes some sense. I also hope that someone who knows and understands Lucid's USB system can help with this. Thanks!
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5086
Location: Republic of Novo Zelande

PostPosted: Fri 16 Mar 2018, 14:33    Post subject: Re: No /dev/bus/usb/ in Lucid Puppy
Subject description: Problems scanning as spot
 

ahoppin wrote:
When I'm spot, sane-find-scanner reports:

found USB scanner (vendor=0x04b8, product=0x011b) at libusb:001:004

All well and good.

But as spot, scanimage -L says:

No scanners were identified.
Hi ahoppin - finding an answer is above my intellect grade unfortunately, but I am interested to understand your method so I tried to emulate a little of what you did (although I am not using Lucid or spot - i am Slacko 5.6 and I assume root).

Here is what I get when I try the commands sane-find-scanner and scanimage -L

Code:
# sane-find-scanner

  # sane-find-scanner will now attempt to detect your scanner. If the
  # result is different from what you expected, first make sure your
  # scanner is powered up and properly connected to your computer.

  # No SCSI scanners found. If you expected something different, make sure that
  # you have loaded a kernel SCSI driver for your SCSI adapter.

found USB scanner (vendor=0x08ff, product=0x1600 [Fingerprint Sensor]) at libusb:006:002
  # Your USB scanner was (probably) detected. It may or may not be supported by
  # SANE. Try scanimage -L and read the backend's manpage.

  # Not checking for parallel port scanners.

  # Most Scanners connected to the parallel port or other proprietary ports
  # can't be detected by this program.
# scanimage -L

No scanners were identified. If you were expecting something different,
check that the scanner is plugged in, turned on and detected by the
sane-find-scanner tool (if appropriate). Please read the documentation
which came with this software (README, FAQ, manpages).
#


It found my builtin usb fingerprint reader (didn't even know I had one) but couldn't do anything with it. (A bit like spot with your epson).

The responses imply that "It may or may not be supported by SANE"

Is it possible that spot does not have access to a required Sane file (but root does)?

Are "sane-find-scanner" and "scanimage" parts of the same software or different modules? Would spot have equal access covering both modules?
Back to top
View user's profile Send private message 
ahoppin

Joined: 16 May 2011
Posts: 155

PostPosted: Fri 16 Mar 2018, 19:09    Post subject:  

Interesting thoughts, thanks for the response. I guess your fingerprint scanner is presenting itself to the OS as a USB scanner, but SANE supports only document and photo scanners (as far as I know). I would guess that that's why scanimage -L says "no scanners were identified," it's not one that SANE knows anything about.

But you have a point, that if SANE couldn't read the config files for the scanner, it might say the same thing for me. I checked permissions on /etc/sane.d/epson2.conf, and it's readable by all (same as umax.conf, which xsane used before), so I wouldn't think that would cause the problem. Same with /usr/lib/libsane-epson.so.1.0.20.

Sane-find-scanner, scanimage, and xsane are all part of the SANE package. I don't know why sane-find-scanner and scanimage -L give different results. If I did, I might have a better idea what's wrong.

I wonder if there's any way to get a debug trace from any of these utilities, see where they're failing. Might have to build them from source to do that.

I'm also wondering whether the Tahr xsane package from Ibiblio would work on Lucid, how many dependencies I'd have to track down, and how many library conflicts updating the libraries would introduce.
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5086
Location: Republic of Novo Zelande

PostPosted: Fri 16 Mar 2018, 19:28    Post subject:  

ahoppin wrote:
I'm also wondering whether the Tahr xsane package from Ibiblio would work on Lucid, how many dependencies I'd have to track down, and how many library conflicts updating the libraries would introduce.
I always feel that anything is worth a try - but only with the caveat that all such testing should be done without a savefile - using only the pristine puppy.sfs without modifications or overlays.

Given that I have no real clue why spot wont play ball I hope you don't mind if I chuck in some random thoughts (i love a good bug hunt...)

Any interesting thoughts in this link?
http://englanders.us/~jason/scanner.php
Quote:
Compile and install SANE (Scanner Access Now Easy)
I put a howto for building and installing Sane and a few frontends here
Add this line to /usr/local/etc/sane.d/epson.conf:
usb /dev/usb/scanner0
Uncomment the "epson" line in /usr/local/etc/sane.d/dll.conf
If your version of Slackware (>= 8.1 should) has a /etc/profile.d/ directory, create a /etc/profile.d/sane.sh script (chmod 755) that has this in it:
#!/bin/sh
export SANE_DEFAULT_DEVICE=/dev/usb/scanner0
If you don't have /etc/profile.d/, add that line to /etc/profile. Setting this environment variable tells scanimage and xscanimage what your scanner device is (without having to specify it on the commandline). If your (non-root) account is the only one that'll be using the scanner, you could also just throw that line in ~/.bash_login


EDIT : Also http://khk.net/sane/usb_scanner.html
Quote:
Configuring SANE

Create the device file in /dev according to the instructions in the USB Guide. The device name you are using is needed for the next step.

Here is the command I used to create this file:

mknod /dev/usbscanner0 c 180 48
chmod 666 /dev/usbscanner0
To actually use the scanner with SANE the only thing left to do is to configure SANE. The EPSON backend uses a file epson.conf that is either located in /etc/sane.d or in /usr/local/etc/sane.d (or wherever you or your Linux distribution intalled SANE). Edit this file and make sure that the following line is the only information in the file:

usb /dev/usbscanner0
Replace the /dev/usbscanner0 with the actual device name used in the previous step.


Does Spot have access to the whole of /dev and /proc?

EDIT2 :You've probably also seen this: https://bugzilla.redhat.com/show_bug.cgi?id=122328
It links to a page discussing hotplug permissions and scanner group declarations in /etc/group:
http://www.freecolormanagement.com/sane/libusb.html

EDIT 3:Apologies if none of this is relevant - but heres another couple of interesting links:

1) Explicitly specifying the usb parameters to scanimage in case Spot can't access some critical config file:
https://bugs.mageia.org/show_bug.cgi?id=5376
Quote:
[sane-find-scanner extract]
found USB scanner (vendor=0x04b8 [EPSON], product=0x0110 [EPSON Scanner]) at libusb:003:005

$ scanimage -L
No scanners were identified. If you were expecting something different,
check that the scanner is plugged in, turned on and detected by the
sane-find-scanner tool (if appropriate). Please read the documentation
which came with this software (README, FAQ, manpages).

$ scanimage -d epson:libusb:003:005 --batch-count=1 --batch=out%d.tif -p
Scanning 1 pages, incrementing by 1, numbering from 1
Scanning page 1
Scanned page 1. (scanner status = 5)

So works.

xsane alone doesn't.

Quote:
I think I found the issue.

In /etc/sane.d/dll.conf the epson entry is commented out. Putting it back solves the issue. I see that as a regression from Mageia 1 but there may be some good reasons for that.
HTH,
Bruno.


2) https://forums.mageia.org/en/viewtopic.php?t=3100&p=23565
Quote:
by MontyWilliams » Jul 27th, '12, 17:28

The bug fix (uncommenting epson in /etc/sane.d/dll.conf) enables the device to be seen. However it is identified as a GT-9300 just to confuse me - that is the Japanese designation.
I see that the Perfection 2400 photo is no longer a listed device in the MCC configuration options.


Well beyond my pay grade unfortunately Shocked
Back to top
View user's profile Send private message 
ahoppin

Joined: 16 May 2011
Posts: 155

PostPosted: Fri 16 Mar 2018, 22:26    Post subject:  

Wow, lots of material there. Regrettably I think I'm in over my head too. I can't even figure out which of them might apply to my situation. :-(

I think my main problem is that I don't understand how the USB system works, and especially how Lucid Puppy's differs from other distros'.

As a result, I can't figure out how to change the permissions of the USB device that xsane is looking for, so that xsane can see it when it's run as Spot.

I may have to just give up and run xsane as root, ignoring its alarming warnings ("You try to run XSane as root, that really is DANGEROUS!").

It just annoys me that I had no trouble figuring out how to run xsane as Spot when I had a SCSI scanner, but can't do it with a USB scanner.
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5086
Location: Republic of Novo Zelande

PostPosted: Fri 16 Mar 2018, 22:40    Post subject:  

One of those posts i highlighted talks about telling scanimage which device to use directly.

Maybe you could try the following syntax (both as root and spot):
Code:
$ scanimage -d epson:libusb:001:004 --batch-count=1 --batch=out%d.tif -p


(I replaced the libusb parameter in the webpage example with your figures of "libusb:001:004" reported by sane-find-scanner)

In theory that might allow spot to drive scanimage even in the absence of xsane's port config files. (or maybe it might need "epson2" instead of "epson" depending on where your driver is?)
Back to top
View user's profile Send private message 
ahoppin

Joined: 16 May 2011
Posts: 155

PostPosted: Fri 16 Mar 2018, 23:24    Post subject:  

# scanimage -d epson2:libusb:001:004 --batch-count=1 --batch=out%d.tif -p

scanimage: open of device epson2:libusb:001:004 failed: Access to resource has been denied

Well, foo.
Back to top
View user's profile Send private message 
bigpup


Joined: 11 Oct 2009
Posts: 10693
Location: Charleston S.C. USA

PostPosted: Fri 16 Mar 2018, 23:54    Post subject:  

Quote:
I can scan as root, bypassing xsane's we're-all-gonna-die don't-run-me-as-root message
.
So what!

I have never, I repeat never, had a problem caused by running any program as root.

Maybe, a small benefit to running a browser as spot.
That is about all spot was suppose to be about.

To be honest, I do not think running as spot ever got fully tested and bug fixed.

Running as spot does not do what a lot of people think it does.
http://www.puppylinux.org/wikka/spot?redirect=no

_________________
I have found, in trying to help people, that the things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected Shocked
Back to top
View user's profile Send private message 
ahoppin

Joined: 16 May 2011
Posts: 155

PostPosted: Sat 17 Mar 2018, 00:48    Post subject:  

I just plugged the scanner into my laptop and booted Tahr. Xsane found it and worked with it perfectly (if slow to start) when run as root.

But when run as spot, xsane could NOT find the scanner...

Until I did (as root):

# sane-find-scanner
found USB scanner ... at libusb:002:003 ... [LOTS more text]
# scanimage -L
device 'epson2:libusb:002:003' is a Epson GT-9300 flatbed scanner
# cd /dev/bus/usb/002
# chmod o+rw 003
# cd /dev
# chmod ugo+x bus

And then xsane worked when run as spot!

Now if I could just figure out how to do the same in Lucid -- but it doesn't have the directory /dev/bus. Instead, it has /dev/usbdevX.Y

where X is 1-7 and Y is 1,2,3,5,12,21.

When the scanner was at 001:004, chmod o+rw usbdev1.4 did NOT work.

Now after re-plugging it's at 001:006, and chmod o+rw usbdev1.6 still doesn't work.

I'm still stumped.

FWIW, Lucid 5.2.8 has BOTH /dev/usbdevX.Y and /dev/bus/usb.
Back to top
View user's profile Send private message 
ahoppin

Joined: 16 May 2011
Posts: 155

PostPosted: Sat 17 Mar 2018, 01:03    Post subject:  

> I have never, I repeat never, had a problem caused by running
> any program as root.

I don't really think that anything bad will happen as a result of running xsane as root. But the warning is annoying. Also, I'm trying to get my sweetie to scan her own stuff, and that's likely to scare her off.

Good news, though, I just discovered that I can install the package xsane-0.997-patched-2-w5c.pet from http://distro.ibiblio.org/puppylinux/pet_packages-tahr/ and it seems to work fine on Lucid. That version has no sky-is-falling root warning.

However, it still would be nice to know why chmod-ing usbdevX.Y didn't grant xsane permission to the usb scanner device file.
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5086
Location: Republic of Novo Zelande

PostPosted: Sat 17 Mar 2018, 01:20    Post subject:  

ahoppin wrote:
scanimage: open of device epson2:libusb:001:004 failed: Access to resource has been denied
Well, foo.
How would you interpret that answer? I think it confirms your focus on setting permissions. ("somewhere" !)
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5086
Location: Republic of Novo Zelande

PostPosted: Sat 17 Mar 2018, 01:26    Post subject:  

ahoppin wrote:
Until I did (as root):

# sane-find-scanner
found USB scanner ... at libusb:002:003 ... [LOTS more text]
# scanimage -L
device 'epson2:libusb:002:003' is a Epson GT-9300 flatbed scanner
# cd /dev/bus/usb/002
# chmod o+rw 003
# cd /dev
# chmod ugo+x bus

And then xsane worked when run as spot!
Interesting that scanimage here had no problem seeing the scanner prior to your permissions changes to the bus directory. I'm confused though - did Spot succeed in interfacing the scanner at that point? (prior to changing the permissions, but AFTER scanimage was able to identify the scanner).
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5086
Location: Republic of Novo Zelande

PostPosted: Sat 17 Mar 2018, 01:33    Post subject:  

ahoppin wrote:
# scanimage -L
device 'epson2:libusb:002:003' is a Epson GT-9300 flatbed scanner
# cd /dev/bus/usb/002
# chmod o+rw 003
# cd /dev
# chmod ugo+x bus

And then xsane worked when run as spot!

Now if I could just figure out how to do the same in Lucid -- but it doesn't have the directory /dev/bus. Instead, it has /dev/usbdevX.Y
Just for the hell of it - could you change permissions on ALL of the directories (recursively) in /dev (in Lucid)and see if it gives Spot what it wants?
Back to top
View user's profile Send private message 
ahoppin

Joined: 16 May 2011
Posts: 155

PostPosted: Sat 17 Mar 2018, 04:31    Post subject:  

> scanimage here had no problem seeing the scanner prior to
> your permissions changes ...

Oops, sorry that wasn't clear. The commands listed were typed as root.

After that, Spot could start and use xsane.

The above was in Tahr, but I think it would also work in Precise, and maybe in Lucid 5.2.8. Not Lucid 5.2.5, however.

There's no need to change the permissions of /dev, it's already 755 (rwxr-xr-x), so it's searchable by anyone.

The usbdev* files are at the first level under /dev, so there are no directories that would need to be changed.
Back to top
View user's profile Send private message 
Mike Walsh


Joined: 28 Jun 2014
Posts: 3901
Location: King's Lynn, UK.

PostPosted: Sat 17 Mar 2018, 17:48    Post subject:  

@ahoppin:-

I'm just gonna throw this out here. It'll probably fall on barren ground & refuse to take 'root' (sorry; I know, I know...!), but here goes anyway.

Now you've got an Epson scanner, as an alternative to Xsane.....have you considered trying Epson's own scanner packages?

It's only a suggestion, but you may quite like Epson's I-Scan app. I run an SX218 all-in-one (printer/scanner/copier; that kinda thing), but you've always had to install printer & scanner drivers separately on these things. Don't ask me why; that's just the way Epson have always done it....when they're not busy denying that they even do drivers for Linux, that is!





If you fancy taking a look at this, you're in luck. Epson used to make you download two packages for it; a 'data' package, which had to be installed first.....followed by the driver itself, which needed info from the data package to be able to run. A b]right[/b] PITA; nowadays, they appear to have finally condensed all this into one package (which makes more sense..!)

If you go here, to Epson's downloads page:-

http://download.ebz.epson.net/dsc/search/01/search/searchModule

Enter the model number (GT-9300), then below it, use the drop-down to select your OS; in this case, Linux.

The next page will give you the download link to the package. Click on this, then the following page will show you a huge list of all the models this driver will support. (Virtually every model they've ever produced...)

Scroll down to the bottom, and click on 'Accept'. A box will appear, where you'll want the first option; 'Package Download Page'. Click on this, and.....hooray, you've finally reached the download!

You'll want the 32-bit (i386) .deb package. Trust me on this.

Once all that's done, simply click on the downloaded package to install it.

-------------------------------------------------------------

One 'peculiarity' of this; it may say, the first time you try to launch it, that it can't find the scanner. That's OK; power your scanner down, wait a few seconds, then power it back on again. Now launch Image Scan! again; all things being equal, it'll fire up this time.

This is only a suggestion.....but many people don't seem to be aware that Epson even do Linux packages, let alone specific ones. Anyway, I'll leave that with ya.

Entirely your decision, of course. Personally, I've never been able to figure Xsane out, much less use it..! I've always found Image Scan! to be very easy to use.


Mike. Wink

_________________
MY PUPPY PACKAGES | 'Thanks' are always appreciated!
--------------------------------------

Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 2 [30 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1012s ][ Queries: 12 (0.0209s) ][ GZIP on ]