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-30-2006, 01:22 AM   #46
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,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
When I release a stable version, libprs500 will be installable via a single command, provided you have python2.5, Qt4, PyQt4 and libusb installed already. I'm not at all familiar with apple's packaging technologies, so I cant help you much there.

Last edited by kovidgoyal; 11-30-2006 at 01:24 AM.
kovidgoyal is offline   Reply With Quote
Old 11-30-2006, 08:55 AM   #47
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
You may already know this, but I just tried to run the gui and got this error

Quote:
File "/Users/seamus/prs-500/trunk/libprs500/gui/main.py", line 514, in timerEvent
self.establish_connection()
File "/Users/seamus/prs-500/trunk/libprs500/gui/main.py", line 550, in establish_connection
space = self.dev.available_space()
File "/Users/seamus/prs-500/trunk/libprs500/communicate.py", line 205, in run_session
res = func(*args, **kwargs)
File "/Users/seamus/prs-500/trunk/libprs500/communicate.py", line 495, in available_space
res = self._send_validated_command(FreeSpaceQuery(path), timeout=5000) # Timeout needs to be increased as it takes time to read card
File "/Users/seamus/prs-500/trunk/libprs500/communicate.py", line 300, in _send_validated_command
PRS500Device._validate_response(res, type=command.type, number=cnumber)
File "/Users/seamus/prs-500/trunk/libprs500/communicate.py", line 245, in _validate_response
"\nrnumber: expected="+hex(number)+" actual="+hex(res.rnumber))
libprs500.errors.ProtocolError: Inavlid response.
type: expected=0x1 actual=0xfffffffe00000000L
rnumber: expected=0x53 actual=0x53
actually as I read the code that's throwing the error, it looks like you already know this can happen.

but it looks nice!
seamusfp is offline   Reply With Quote
Advert
Old 11-30-2006, 10:47 AM   #48
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,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
While I know it can happen, it should not be happening. Can ypu put a print path statement above the line
Code:
 
res = self._send_validated_command(FreeSpaceQuery(path), timeout=5000) # Timeout needs to be increased as it takes time to read card
and try the command prs500 df
kovidgoyal is offline   Reply With Quote
Old 11-30-2006, 11:02 AM   #49
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
before i left for work i tried prs500 df, and it worked, so i'm pretty confused about why the gui can't do the same thing. when i get home i'll try adding the print path.

i also sometimes get a seg fault, though that may be from some of the things i was trying to get it working also after running the gui, the command line app doesn't work unless i disconnect and reconnect the reader, though that's probably because i haven't had a chance to let the gui end gracefully yet.

Last edited by seamusfp; 11-30-2006 at 12:03 PM.
seamusfp is offline   Reply With Quote
Old 11-30-2006, 11:36 AM   #50
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,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Sync up before testing as I've added a possible fix.
kovidgoyal is offline   Reply With Quote
Advert
Old 11-30-2006, 08:30 PM   #51
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
Ok, i've synced up. Still not working

though it's a new error

Quote:
Python(1442,0xa000cfc0) malloc: *** error for object 0x31bdeb0: incorrect checksum for freed object - object was probably modified after being freed, break at szone_error to debug
Python(1442,0xa000cfc0) malloc: *** set a breakpoint in szone_error to debug
Bus error
also after this happens the command line app no longer works, it throws an error similar to what the gui was throwing with rev120.

edit: also if i start prs500-gui then connect the reader, the progress bar moves back and forth but nothing actually happens.

Last edited by seamusfp; 11-30-2006 at 08:57 PM.
seamusfp is offline   Reply With Quote
Old 11-30-2006, 09:23 PM   #52
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,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Hmm well I'm going to wait till the GUI stabilizes a bit more before I track down this bug, since I cant replicate it and guessing is getting me nowhere.
kovidgoyal is offline   Reply With Quote
Old 11-30-2006, 09:53 PM   #53
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
fair enough!

Good luck!

I couldn't figure out where it was coming from (the error wasn't too usefull...) I may try stepping through some of it...
seamusfp is offline   Reply With Quote
Old 12-02-2006, 12:11 AM   #54
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,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The location of my svn server has changed. The new command to check out the development version is:
svn co https://svn.kovidgoyal.net/code/prs-500
kovidgoyal is offline   Reply With Quote
Old 12-04-2006, 12:28 AM   #55
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,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The connection problems in the GUI should be fixed now. If not try increasing the timeout value in the open method in communicate.py. It's at 10000 right now.
kovidgoyal is offline   Reply With Quote
Old 12-04-2006, 09:09 AM   #56
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
another error that doesn't make sense

Quote:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/Current/bin/prs500-gui", line 8, in <module>
load_entry_point('libprs500==0.2.1', 'gui_scripts', 'prs500-gui')()
File "/Users/seamus/prs-500/trunk/libprs500/gui/main.py", line 755, in main
gui = MainWindow(window, options.log_packets)
File "/Users/seamus/prs-500/trunk/libprs500/gui/main.py", line 593, in __init__
self.library_model.set_data(LibraryDatabase(str(se lf.database_path)))
File "/Users/seamus/prs-500/trunk/libprs500/gui/main.py", line 192, in set_data
self._data = self.db.get_table(self.FIELDS)
File "/Users/seamus/prs-500/trunk/libprs500/gui/database.py", line 77, in get_table
cur = self.con.execute("select " + cols + " from books_meta")
sqlite3.OperationalError: no such column: rating
I'm guessing it's cause I don't have sql properly installed? that's the only reason I can think of.
seamusfp is offline   Reply With Quote
Old 12-04-2006, 01:03 PM   #57
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,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
My fault I forgot to mention that the database format has changed since the last revision. Either delete ~/library.db or
Code:
sqlite3 ~/library.db
sqlite> alter table books_meta add column rating integer;
kovidgoyal is offline   Reply With Quote
Old 12-04-2006, 08:27 PM   #58
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 tried, new messages, but they seem to be related. still in the establish connection section.

Quote:
File "/Users/seamus/prs-500/trunk/libprs500/gui/main.py", line 715, in establish_connection
Python(393,0xa000cfc0) malloc: *** error for object 0x31bb1a0: incorrect checksum for freed object - object was probably modified after being freed, break at szone_error to debug
Python(393,0xa000cfc0) malloc: *** set a breakpoint in szone_error to debug
space = self.dev.available_space()
File "/Users/seamus/prs-500/trunk/libprs500/communicate.py", line 157, in run_session
if not dev.handle: dev.open()
File "/Users/seamus/prs-500/trunk/libprs500/communicate.py", line 226, in open
version = self._bulk_read(24, data_type=USBProtocolVersion)[0].version
File "/Users/seamus/prs-500/trunk/libprs500/communicate.py", line 320, in _bulk_read
packet = bulk_read_packet(data_type=data_type, size=packet_size)
File "/Users/seamus/prs-500/trunk/libprs500/communicate.py", line 312, in bulk_read_packet
data = data_type(self.handle.bulkRead(PRS500Device.PRS500 _BULK_IN_EP, size))
File "/Users/seamus/prs-500/trunk/libprs500/prstypes.py", line 625, in __init__
raise PacketError(str(self.__class__)[7:-2] + " packets must have a length of atleast 16 bytes")
PacketError: 'libprs500.prstypes.USBProtocolVersion packets must have a length of atleast 16 bytes
Unable to connect to device. Please try unplugging and reconnecting it
Unable to connect to device. Please try unplugging and reconnecting it
I did a little searching to see what's up, it looks like malloc in OSX is sort of broken,

Quote:
The implementation of realloc on Darwin never frees memory, so when using a
large buffer size on incomplete reads you end up with lots of small strings that
actually take up a large allocation.
I haven't found a workaround yet...

Edit: I found someone who was getting the malloc errors in some other program and traced it to adding/removing whitespace I removed lines and that eliminated the malloc portion of the error, but the rest remains a la

Quote:
File "/Users/seamus/prs-500/trunk/libprs500/gui/main.py", line 689, in establish_connection
space = self.dev.available_space()
File "/Users/seamus/prs-500/trunk/libprs500/communicate.py", line 157, in run_session
if not dev.handle: dev.open()
File "/Users/seamus/prs-500/trunk/libprs500/communicate.py", line 226, in open
version = self._bulk_read(24, data_type=USBProtocolVersion)[0].version
File "/Users/seamus/prs-500/trunk/libprs500/communicate.py", line 320, in _bulk_read
packet = bulk_read_packet(data_type=data_type, size=packet_size)
File "/Users/seamus/prs-500/trunk/libprs500/communicate.py", line 312, in bulk_read_packet
data = data_type(self.handle.bulkRead(PRS500Device.PRS500 _BULK_IN_EP, size))
File "/Users/seamus/prs-500/trunk/libprs500/prstypes.py", line 625, in __init__
raise PacketError(str(self.__class__)[7:-2] + " packets must have a length of atleast 16 bytes")
PacketError: 'libprs500.prstypes.USBProtocolVersion packets must have a length of atleast 16 bytes
Unable to connect to device. Please try unplugging and reconnecting it
Unable to connect to device. Please try unplugging and reconnecting it

Last edited by seamusfp; 12-04-2006 at 08:45 PM.
seamusfp is offline   Reply With Quote
Old 12-04-2006, 09:53 PM   #59
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,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Hmm can you try increasing the timeout for bulk reads. replace line 312 in communicate.py by
data = data_type(self.handle.bulkRead(PRS500Device.PRS500 _BULK_IN_EP, size, timeout=5000))

Also can you open a ticket about this at
https://libprs500.kovidgoyal.net/newticket

More convenient than a forum. Thanks
kovidgoyal is offline   Reply With Quote
Old 12-12-2006, 12:00 AM   #60
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,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Here's a puzzle for all of you that have too much time on your hands. I just finished adding support for syncing the time to libprs500, unfortunately there's one field of 4 bytes I cant interpret. Here are the time set command packets
Code:
# 16:11 11th dec 2006
00000000: 0401 0000 0100 0000 0000 0000 1c00 0000  ................
00000010: 20fe ffff d607 0000 0c00 0000 0c00 0000   ...............
00000020: 0000 0000 0b00 0000 0800 0000            ............

# 16:20odd 11th nov 2006
00000000: 0401 0000 0100 0000 0000 0000 1c00 0000  ................
00000010: 20fe ffff d607 0000 0b00 0000 0c00 0000   ...............
00000020: 0000 0000 1500 0000 0a00 0000            ............

# 16:25odd 16th dec 2006
00000000: 0401 0000 0100 0000 0000 0000 1c00 0000  ................
00000010: 20fe ffff d607 0000 0c00 0000 1100 0000   ...............
00000020: 0000 0000 1c00 0000 2200 0000            ........"...

# 04:34odd 11th dec 2006
00000000: 0401 0000 0100 0000 0000 0000 1c00 0000  ................
00000010: 20fe ffff d607 0000 0c00 0000 0b00 0000   ...............
00000020: 0c00 0000 2200 0000 3500 0000            ...."...5...
As you can see the time information starts from byte 20 in 4byte blocks that are encoded little-endian (least significant first). Thus d6070000=2006. From byte 20 its year, month, day, hour, minute and second. The first 4 bytes are the command number, the next four are the command type and 1c is the command length. The question is what are bytes 16-19? They are the same in all time set packets I've seen (20fe ffff) and I can't figure them out? Are they and epoch, an offset of some sort, random garbage? Changing the value doesn't seem to affect the time set operation as far as I can tell, but you never know.

For those of you who actually read this far, as a reward for your patience, here's a link that documents the progress (or lack of it) I'm making with libprs500 and its GUI.
https://libprs500.kovidgoyal.net/timeline
kovidgoyal 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 01:00 AM.


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