Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Sony Reader > Sony Reader Dev Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 11-28-2006, 09:35 AM   #31
seamusfp
Enthusiast
seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.
 
Posts: 43
Karma: 432
Join Date: Nov 2006
Location: Connecticut
Device: Sony PRS-500
I've investigated some on the Mac end and made some progress, it appears that the usb interface is idle normally.

Quote:
AppleUSBEHCI[0x327c000]::UIMCreateControlTransfer - control transaction while in idlesuspend - restarting bus
If i quickly repeat i get a different error message, with communication timing out.

Quote:
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 190, in open
res = self._send_validated_command(GetUSBProtocolVersion ())
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/libprs500/communicate.py", line 229, in _send_validated_command
res = self._send_command(command, response_type=response_type, timeout=timeout)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/libprs500/communicate.py", line 219, in _send_command
response = response_type(self.handle.controlMsg(0xc0, 0x81, Response.SIZE, timeout=timeout))
usb.USBError: usb_control_msg(DeviceRequestTO): transaction timed out
but by repeating the command quickly I was able to get it to run... sort of. If I (for lack of a better word) hammer the command I get

Quote:
Unable to find Sony Reader. Is it connected?
so, I guess this is progress?

Last edited by seamusfp; 11-28-2006 at 09:38 AM.
seamusfp is offline   Reply With Quote
Old 11-28-2006, 12:09 PM   #32
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,746
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Interesting, it may be that by adding a wake up command we can fix this. Could you sync to the latest version of libprs500, that would make it easier for me to keep track
Code:
svn co https://svn.kovidgoyal.net/code/prs-500
As root python setup.py develop to install and then the command is prs500.

Last edited by kovidgoyal; 12-02-2006 at 01:37 AM.
kovidgoyal is online now   Reply With Quote
Advert
Old 11-28-2006, 12:45 PM   #33
seamusfp
Enthusiast
seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.
 
Posts: 43
Karma: 432
Join Date: Nov 2006
Location: Connecticut
Device: Sony PRS-500
I'll sync up when I get home from work.
seamusfp is offline   Reply With Quote
Old 11-28-2006, 09:20 PM   #34
seamusfp
Enthusiast
seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.
 
Posts: 43
Karma: 432
Join Date: Nov 2006
Location: Connecticut
Device: Sony PRS-500
I installed it, but it didn't seem to go right. It is throwing an error importing VERSION, I tried to bypass that, and it's throwing an error importing TerminalController.

seamusfp is offline   Reply With Quote
Old 11-28-2006, 11:58 PM   #35
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,746
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
What did noy go well the python setup.py develop step or running prs500?
kovidgoyal is online now   Reply With Quote
Advert
Old 11-29-2006, 08:53 AM   #36
seamusfp
Enthusiast
seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.
 
Posts: 43
Karma: 432
Join Date: Nov 2006
Location: Connecticut
Device: Sony PRS-500
libprs500 did not seem to copy right, I deleted the egg files and ran setup.py from the tarball in the first post and it worked again.

so, I went back to that and got the USB prober working. more happens than the system logs led me to believe. first it looks for drivers, some of these it tries several times.

Quote:
7862.807 [5] Finding driver for interface #0 of Sony Portable Reader System, matching personality using com.apple.iokit.IOUSBMassStorageClass, score: 0, wildCard = 0
7862.807 [5] Finding driver for interface #0 of Sony Portable Reader System, matching personality using com.apple.driver.AppleUSBTCKeyboard, score: 0, wildCard = 0
7862.808 [5] Finding driver for interface #0 of Sony Portable Reader System, matching personality using com.apple.driver.AppleUSBTrackpad, score: 0, wildCard = 0
7862.808 [5] Finding driver for interface #0 of Sony Portable Reader System, matching personality using com.apple.driver.AppleUSBMergeNub, score: 0, wildCard = 0
7862.809 [5] Finding driver for interface #0 of Sony Portable Reader System, matching personality using com.apple.iokit.IOUSBHIDDriver, score: 0, wildCard = 0
7862.809 [5] Finding driver for interface #0 of Sony Portable Reader System, matching personality using com.apple.iokit.IOUSBMassStorageClass, score: 0, wildCard = 0
7862.809 [5] Finding driver for interface #0 of Sony Portable Reader System, matching personality using com.apple.driver.AppleUSBCDCECMData, score: 0, wildCard = 0
7862.809 [5] Finding driver for interface #0 of Sony Portable Reader System, matching personality using com.apple.driver.AppleUSBOpticalMouse, score: 0, wildCard = 0
7862.809 [5] Finding driver for interface #0 of Sony Portable Reader System, matching personality using com.apple.driver.AppleUSBCDCWCM, score: 0, wildCard = 0
7862.811 [5] Finding driver for interface #0 of Sony Portable Reader System, matching personality using com.apple.driver.AppleUSBCDCACMData, score: 0, wildCard = 0
7862.811 [5] Finding driver for interface #0 of Sony Portable Reader System, matching personality using com.apple.driver.AppleUSBIrDA, score: 0, wildCard = 0
7862.811 [5] Finding driver for interface #0 of Sony Portable Reader System, matching personality using com.apple.driver.AppleUSBCDCDMM, score: 0, wildCard = 0
7862.811 [5] Finding driver for interface #0 of Sony Portable Reader System, matching personality using com.apple.driver.AppleIRController, score: 0, wildCard = 0
7862.811 [5] Finding driver for interface #0 of Sony Portable Reader System, matching personality using com.apple.driver.AppleWWANVerizon, score: 0, wildCard = 0
7862.811 [5] Finding driver for interface #0 of Sony Portable Reader System, matching personality using com.apple.iokit.IOUSBHIDDriver, score: 0, wildCard = 0
7862.811 [5] Finding driver for interface #0 of Sony Portable Reader System, matching personality using com.apple.driver.AppleUSBCDCACMControl, score: 0, wildCard = 0
7862.811 [5] Finding driver for interface #0 of Sony Portable Reader System, matching personality using com.apple.driver.PreventMediaMountDriver, score: 0, wildCard = 0
7862.812 [5] Finding driver for interface #0 of Sony Portable Reader System, matching personality using com.apple.driver.AppleSM56KUSBAudio, score: 0, wildCard = 0
7862.812 [5] Finding driver for interface #0 of Sony Portable Reader System, matching personality using com.apple.driver.AppleHIDMouse, score: 0, wildCard = 0
7862.812 [5] Finding driver for interface #0 of Sony Portable Reader System, matching personality using com.apple.driver.AppleUSBDisplays, score: 0, wildCard = 0
7862.812 [5] Finding driver for interface #0 of Sony Portable Reader System, matching personality using com.apple.driver.AppleVerizonSupportKicker, score: 0, wildCard = 0
7862.813 [5] Finding driver for interface #0 of Sony Portable Reader System, matching personality using com.apple.driver.AppleUSBCDCEEM, score: 0, wildCard = 0
7862.814 [5] Finding driver for interface #0 of Sony Portable Reader System, matching personality using com.apple.driver.AppleUSBAudio, score: 0, wildCard = 0
7862.814 [5] Finding driver for interface #0 of Sony Portable Reader System, matching personality using com.apple.driver.AppleUSBCDCECMControl, score: 0, wildCard = 0
that was with a "sony" filter up

here's a more detailed look at what's happening
Quote:
193.221 [6] Sony Portable Reader System[0x3461d00]:FindConfig (1)
193.221 [5] Sony Portable Reader System[0x3461d00]::SetConfiguration Found an interface (0x39115a9)
193.221 [5] Sony Portable Reader System[0x3461d00]::SetConfiguration Attaching an interface (0x3aa5800)
193.221 [6] IOUSBInterface[0x3aa5800]::start - opening device[0x3461d00]
193.221 [5] CompositeDriverInterestHandler received kIOMessageServiceIsAttemptingOpen with argument: 0
193.221 [6] IOUSBDevice[0x3461d00]::handleOpen - IOUSBInterface[0x3aa5800] added to open set
193.221 [5] Sony Portable Reader System[0x3461d00]::SetConfiguration matching to interfaces (0)
193.227 [5] Finding driver for interface #0 of Sony Portable Reader System, matching personality using com.apple.iokit.IOUSBMassStorageClass, score: 0, wildCard = 0
193.227 [6] Matched: bConfigurationValue (1) bInterfaceNumber (0)
193.227 [6] Didn't Match: idVendor (1761,1356) idProduct (55349,667)
193.227 [5] Finding driver for interface #0 of Sony Portable Reader System, matching personality using com.apple.iokit.IOUSBMassStorageClass, score: 0, wildCard = 0
193.227 [6] Matched: bConfigurationValue (1) bInterfaceNumber (0)
193.227 [6] Didn't Match: idVendor (2060,1356) idProduct (544,667)
193.227 [5] Finding driver for interface #0 of Sony Portable Reader System, matching personality using com.apple.iokit.IOUSBMassStorageClass, score: 0, wildCard = 0
193.227 [6] Matched: bConfigurationValue (1) bInterfaceNumber (0)
193.227 [6] Didn't Match: idVendor (65535,1356) idProduct (65535,667)
at first I was thinking this happened when your program tries to connect, but i investigated more and found that it does the same thing when the reader is plugged in. so this is likely caused by the reset that occurs.
seamusfp is offline   Reply With Quote
Old 11-29-2006, 09:30 AM   #37
seamusfp
Enthusiast
seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.
 
Posts: 43
Karma: 432
Join Date: Nov 2006
Location: Connecticut
Device: Sony PRS-500
YES!

I got it to work!

in communicate.py

I commented out line 189

Quote:
self.handle.reset()
edit: for clarification, this was the source in the tarball in the first post, and on OS X v10.4.8 (this probably doesn't matter)

Last edited by seamusfp; 11-29-2006 at 09:59 AM.
seamusfp is offline   Reply With Quote
Old 11-29-2006, 11:46 AM   #38
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,746
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That's great. In fact the reset has already been removed from svn, it was left in from testing. Its good that it works on OS X.

As for libprs500 not copying right, the contents of the libprs500 directory under trunk should look like this:

libprs500:
cli
communicate.py
errors.py
gui
__init__.py
lrf
prstypes.py

libprs500/cli:
__init__.py
main.py
terminfo.py

libprs500/gui:
database.py
editbook.py
editbook.ui
images
images.qrc
images_rc.py
__init__.py
main.py
main.ui

libprs500/gui/images:
cherubs.jpg
clear.png
edit.png
fileopen.png
minus.png
mycomputer.png
plus.png
reader.png

libprs500/lrf:
__init__.py
meta.py

Last edited by kovidgoyal; 11-29-2006 at 11:52 AM.
kovidgoyal is online now   Reply With Quote
Old 11-29-2006, 12:35 PM   #39
seamusfp
Enthusiast
seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.
 
Posts: 43
Karma: 432
Join Date: Nov 2006
Location: Connecticut
Device: Sony PRS-500
I believe that was all there, however when i ran "sudo python2.5 setup.py develop" it didn't associate/copy things properly, and running prs500.py wouldn't import from the libprs500.
seamusfp is offline   Reply With Quote
Old 11-29-2006, 06:25 PM   #40
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,746
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Oh the develop command doesn't copy anything, it only creates an egg link to the source directory. The command to use is nor prs500 not prs500.py. prs500 is created by the develop command.
kovidgoyal is online now   Reply With Quote
Old 11-29-2006, 06:39 PM   #41
seamusfp
Enthusiast
seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.
 
Posts: 43
Karma: 432
Join Date: Nov 2006
Location: Connecticut
Device: Sony PRS-500
ahhhh

<--- noob!

Looking at the svn, it looks like you're making a gui wrapper for this, how is that going?

Ok i've tried the new code out (well downloaded last night) and it still has a reset in it causing problems, at line 258 in communicate.py. removing that info and ls seem to work, but books only gets 1 book in and vomits with

Quote:
Books in main memory:
1984 by George Orwell at /Data/media/books/CBUS12510000100J.lrf
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/Current/bin/prs500", line 8, in <module>
load_entry_point('libprs500==0.2.1', 'console_scripts', 'prs500')()
File "/Users/seamus/prs-500/trunk/libprs500/cli/main.py", line 211, in main
print book
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 11: ordinal not in range(128)

Last edited by seamusfp; 11-29-2006 at 07:52 PM.
seamusfp is offline   Reply With Quote
Old 11-29-2006, 09:11 PM   #42
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,746
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Oh I apologize, I had not committed the reset change from my working copy to svn. It's in now. Also a possible fix for the books problem.

The GUI is coming along...right now it can display the list of books (with their covers) on the device. I'm working on the code to manage an sqlite based library that keeps books in various formats as well as metadata for them. After that the only hurdle will be transferring books to the reader in an intelligent fashion.
kovidgoyal is online now   Reply With Quote
Old 11-29-2006, 09:57 PM   #43
seamusfp
Enthusiast
seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.seamusfp has a complete set of Star Wars action figures.
 
Posts: 43
Karma: 432
Join Date: Nov 2006
Location: Connecticut
Device: Sony PRS-500
awesome, that worked well!

there was 1 or 2 extra .encode's in prs-500.py around line 211 (not sure if i put them there or not, i was trying something along the lines of what you did, but python must have known i was a noob) and the edit marks for r120 caused some problems, so I just got rid of them (and the old lines)

unfortunately Ot4 hasn't been aquafied, and i haven't tried to set it up in darwin yet (not sure if that will work). so i couldn't check out the hard work you've put into the gui

Thanks for putting all this work in!
seamusfp is offline   Reply With Quote
Old 11-29-2006, 10:08 PM   #44
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,746
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Qt: http://www.trolltech.com/developer/downloads/qt/mac

sip: http://www.riverbankcomputing.co.uk/sip/download.php

pyqt http://www.riverbankcomputing.co.uk/pyqt/download.php


You will of course need Xcode to build them
kovidgoyal is online now   Reply With Quote
Old 11-29-2006, 11:36 PM   #45
William Moates
Zealot
William Moates began at the beginning.
 
Posts: 107
Karma: 35
Join Date: Oct 2006
Location: Greensboro, NC
Device: Sony Librie / Sony Clie / Sony Reader
Quote:
Originally Posted by seamusfp
in communicate.py

I commented out line 189

self.handle.reset()

edit: for clarification, this was the source in the tarball in the first post, and on OS X v10.4.8 (this probably doesn't matter)
seamusfp and kovidgoyal,

I looked in my version of communicate.py, found the line of code you mentioned, commented it out, and got prs500 to work, too! Glad to see someone figured out how to make it run on a Mac. (BTW, I'm on OS X v10.3.9.)

I'm going to look into Apple's documentation on installers, and see if this can be packaged in an installer. Making DMGs is easy, making stuff installable is something else.

P.S.: seamusfp, in case you didn't know, Xcode is on the OS X installation disc.
William Moates is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 06:30 AM.


MobileRead.com is a privately owned, operated and funded community.