11-10-2006, 06:31 AM | #16 |
Zealot
Posts: 107
Karma: 35
Join Date: Oct 2006
Location: Greensboro, NC
Device: Sony Librie / Sony Clie / Sony Reader
|
I'm on Mac OS X, which is BSD-based, so I took the plunge to see if I could use your app. I used Fink (and the FinkCommander GUI) to upgrade python 2.3 to 2.5, installed/compiled pyUSB 0.3.5, then installed libprs500-0.2. setup.py ran without errors, and I could get prs500.py to run, but it gives me errors when trying to read the device. I don't have udev on my version of Linux (it's apparently only in the Debian distros), so I had to create the udev folder, and the 90-local.rules file. That didn't affect the read errors I was getting from prs500.py, so I think udev is not related to the the problem.
I don't have python-dev or libusb-dev installed, and they aren't available as Fink packages. (Neither is udev.) Have you tried your app on other Linux boxes? For now, I consider libprs500-0.2 a proof-of-concept. If I could see it installed and run on other Linux boxes, then I'd call it a prototype. (Okay, I just looked up the two terms, and they appear synonymous, so I may be splitting hairs. If I could reproduce your results, I'd call it a prototype. Perhaps others have had more success.) |
11-10-2006, 11:22 AM | #17 |
creator of calibre
Posts: 43,739
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Well I've tested it on Gentoo and Kubuntu. libusb has problems on Mac OSX, unfortunately I dont have a Mac on which to test it. If you look at the code in communicate.py there is a todo in there about mac osx. If you post the error messages you get that would be helpful.
|
Advert | |
|
11-11-2006, 02:22 AM | #18 |
Zealot
Posts: 107
Karma: 35
Join Date: Oct 2006
Location: Greensboro, NC
Device: Sony Librie / Sony Clie / Sony Reader
|
In that case, it's a prototype.
I will post the error messages when I get a chance: my forum-reading computer is different from the one I tested libprs500 on, so I couldn't easily paste the error messages into the reply I was writing. libusb was installable via Fink, so it may be OK now. Let me look into that, and into the todo in communicate.py--that's where the error originated. |
11-11-2006, 02:45 AM | #19 |
creator of calibre
Posts: 43,739
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Yeah there's no fundamental reason why this shouldn't work on OSX, besides a little tweaking of the USB parameters. I've updated the first post in the thread with the most up-to-date installation information.
|
11-11-2006, 03:03 AM | #20 |
Zealot
Posts: 107
Karma: 35
Join Date: Oct 2006
Location: Greensboro, NC
Device: Sony Librie / Sony Clie / Sony Reader
|
I was also trying to get others to post tales of their success/failure with libprs500. Every little bit helps.
Well? Anyone?? |
Advert | |
|
11-13-2006, 07:39 PM | #21 |
Member
Posts: 14
Karma: 10
Join Date: Nov 2006
Device: prs-500
|
Thanks for providing linux library, works well in Kubuntu.
The only thing that I got problem with is help message for cp command. Part of it says "Device paths have the form: device:mountpoint/my/path" It took me 10 min to figure out that "device" should be just the word "device" and not an actual linux device (considering there is no device created for reader it was long 10 min). Other then this the utility is very usable, thanks. |
11-14-2006, 11:22 AM | #22 |
creator of calibre
Posts: 43,739
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Glad to hear that it works. I'll improve the usage message for the next release.
|
11-14-2006, 06:16 PM | #23 |
creator of calibre
Posts: 43,739
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I've isolated the problem on OSX to bulk reads failing in libusb. Unfortunately, I dont have enough access to an OSX system to debug that.
Uploaded a new version that makes the usage of cp a little clearer (I hope). |
11-15-2006, 01:32 AM | #24 |
Zealot
Posts: 107
Karma: 35
Join Date: Oct 2006
Location: Greensboro, NC
Device: Sony Librie / Sony Clie / Sony Reader
|
my error messages
Ok, here's the errors I got from libprs500-0.2:
Code:
VeeTechV1:/sw/bin wdmoates$ prs500.py info Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/Current/bin/prs500.py", line 290, in <module> main() File "/Library/Frameworks/Python.framework/Versions/Current/bin/prs500.py", line 183, in main dev.open() File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/libprs500/communicate.py", line 196, in open version = self._bulk_read(24, data_type=USBProtocolVersion)[0].version File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/libprs500/communicate.py", line 289, in _bulk_read packet = bulk_read_packet(data_type=data_type, size=packet_size) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/libprs500/communicate.py", line 281, in bulk_read_packet data = data_type(self.handle.bulkRead(PRS500Device.PRS500_BULK_IN_EP, size)) usb.USBError: usb_bulk_read: An error occured during read (see messages above) Code:
VeeTechV1:/sw/bin wdmoates$ prs500.py info Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/Current/bin/prs500.py", line 290, in <module> main() File "/Library/Frameworks/Python.framework/Versions/Current/bin/prs500.py", line 183, in main dev.open() File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/libprs500/communicate.py", line 192, in open version = self._bulk_read(24, data_type=USBProtocolVersion)[0].version File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/libprs500/communicate.py", line 286, in _bulk_read packet = bulk_read_packet(data_type=data_type, size=packet_size) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/libprs500/communicate.py", line 278, in bulk_read_packet data = data_type(self.handle.bulkRead(PRS500Device.PRS500_BULK_IN_EP, size)) usb.USBError: usb_bulk_read: An error occured during read (see messages above) However, I did have some other successes: Only Python 2.3 comes with Mac OS X versions 10.3 and 10.4, and Apple's documentation on it is sketchy. I first tried using Fink to upgrade, where I had to install xfree86 to upgrade to Python 2.5. The second time, I found out Python's website had Mac installers for Python 2.5 (you can find them here ), so I did that on my second Mac, which made things much easier. In both cases, I've gotten libusb and pyUSB to install without much problem--they're mostly idiot-proof. Here's the libprs500 commands which perform without error: prs500.py prs500.py --version (when unplugged) prs500.py info When I use these commands, I get the same bulk_read_packet error I mentioned above: prs500.py info prs500.py df prs500.py cat prs500.py ls If you need more info, let me know. |
11-15-2006, 12:32 PM | #25 |
creator of calibre
Posts: 43,739
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Thanks, yeah that's the same error I was getting in my testing. Unfortunately, the problem seems to be in the libusb implementation on the Mac. Basically any attempt to perform bulk read/writes fails.
I don't know enough about USB internals on the Mac to debug it. Knowing me I'm probably not going to be able resist the challenge to learn though ;-) |
11-23-2006, 02:59 PM | #26 |
Enthusiast
Posts: 43
Karma: 432
Join Date: Nov 2006
Location: Connecticut
Device: Sony PRS-500
|
I've been lurking on this thread for a bit hoping someone would solve the OS X problem.
But I decided to take the plunge and see if I could help work on things. However, I'm a bit of unix noob and can't seem to find python 2.5, I downloaded fink but I can only see 2.3 and 2.4. |
11-23-2006, 03:20 PM | #27 |
creator of calibre
Posts: 43,739
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
http://www.python.org/download/
I will get around to working on OSX, it's just not high on my list of priorities. Right now I'm working on reverse engineering the LRF format and building a GUI. |
11-23-2006, 04:51 PM | #28 |
Wizard
Posts: 3,442
Karma: 300001
Join Date: Sep 2006
Location: Belgium
Device: PRS-500/505/700, Kindle, Cybook Gen3, Words Gear
|
Let me know if you need any help with that
|
11-23-2006, 05:08 PM | #29 |
Fully Converged
Posts: 18,163
Karma: 14021202
Join Date: Oct 2002
Location: Switzerland
Device: Too many to count here.
|
I'd be interested, too!
|
11-23-2006, 07:15 PM | #30 |
creator of calibre
Posts: 43,739
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Well I have written a meta information reader/writer for LRF in python, that seems to be more complete than existing tools. That's what I need for the GUI atm, so I will work on the rest of the LRF format later. If you want to track development
Code:
svn co https://svn.kovidgoyal.net/code/prs-500 Code:
python setup.py develop Additional requirements: pyxml and PyQt4 Last edited by kovidgoyal; 12-02-2006 at 01:36 AM. |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
KDK Reverse Engineering - For Those who Cannot wait... | DairyKnight | Kindle Developer's Corner | 0 | 05-14-2010 12:29 AM |
Reverse-engineering the .IMP format | nrapallo | IMP | 23 | 02-12-2009 01:44 PM |
Reverse engineering the Cybook hard-/software | srml | Gen3 Developer's Corner | 8 | 07-07-2008 04:27 PM |
PC sync protocol | dumky | Which one should I buy? | 2 | 01-04-2008 01:33 PM |
Introduction to Reverse Engineering Software | Colin Dunstan | Deals and Resources (No Self-Promotion or Affiliate Links) | 0 | 05-25-2004 11:31 AM |