Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
sitronix usb keychain
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
gerard
n00b
n00b


Joined: 07 Jan 2008
Posts: 2

PostPosted: Fri Jan 11, 2008 4:30 pm    Post subject: userspace program? Reply with quote

If the choice is, using a userspace program, maybe using gtkam with libgphoto (camlib) can be a good choice, some time ago i wrote to the gphoto mailinglist about this device. Some reaction was, its usb-storage so not for libgphoto.
I don't have a list with the correct reasons why usb-storage is not usable.
Reason for me to choice for libgphoto is that is included in many or all distrbutions so people can use it.

WingGnDm, if its OK with you i like to place your files on my homepage?
Back to top
View user's profile Send private message
WingGnDm
n00b
n00b


Joined: 12 Apr 2004
Posts: 23

PostPosted: Fri Jan 11, 2008 5:03 pm    Post subject: Reply with quote

That would be a good idea. I just read the email.

"No I don't think. The device is apparently a mass storage device.
Hub"

He is under the impression that these devices are actually mass storage device, but they aren't. The device that show up as a mass storage device doesn't even have a file system. It is just an interface for the device.

If you want, check out the libusb mailing list. You will see the discussion on these devices. The best thing to do is black list them as mass storage devices, and mark them as generic scsi devices, then use udev to create the standard /dev entry. Or we can go the even longer way and pretty much use libusb to access the device, but then we would basically be duplicating code thats already in the kernel.

The hardest part will be figuring out the format of the images. As of right now you can dump the images using the get_image function.
I believe i figured out how the device determines the number of pictures in the device. There is a bitmap in the map. On every line with the names of the files, there is a byte that is eigther 0 or 1, if its 1, then the image is valid, if its 0, it has been delete. The best way to handle this is run down the list of names, until you hit a null string. then use the bitmap to show which ones are valid and which have been delete. This could also allow us to recover deleted images. The images are marked invalid when you use the delete function in the device. The list is rewritten by the program.

gerard, it's fine by me if you post them on your site.

If anyone is able to figure out the image format, please post it here.
Back to top
View user's profile Send private message
dracohack
n00b
n00b


Joined: 10 Jan 2008
Posts: 2

PostPosted: Fri Jan 11, 2008 6:29 pm    Post subject: Reply with quote

I'm not aware of a function to allocate and zero an aligned area, but you could do the posix_memalign() and replace your for() loop with: memset(&get_map, 0, 512);

I'm at work right now and my keychain's at home, but if you can post a binary of a retrieved image i'd take a look at it and see what we can do to make it viewable.


edit: corrected my memset arguments
Back to top
View user's profile Send private message
greytortoise
n00b
n00b


Joined: 16 Jan 2008
Posts: 1

PostPosted: Wed Jan 16, 2008 1:34 am    Post subject: Try TIFF? Reply with quote

If you pull an image off of the keychain using the Mac PhotoViewer.app application, it saves the image in TIFF format. While it's possible that the image needs to be specifically formatted for the particular LCD display and is being reformatted by the app before saving it as a .tiff file, it is also quite possible that the device itself uses TIFF. TIFF is defined by Adobe in the spec: http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf, and is described as a format that describes and stores raster image data
Quote:
that typically comes from scanners, frame grabbers,
and paint- and photo-retouching programs
. Given the type of device, I'd be surprised if the image data wasn't either TIFF or something very close.
Back to top
View user's profile Send private message
blooflame
n00b
n00b


Joined: 25 Jan 2008
Posts: 1

PostPosted: Fri Jan 25, 2008 4:20 am    Post subject: Unlikely it's TIFF Reply with quote

I think TIFF requires too much processing for a small MCU.

Note, I'm not a Linux person yet, but I am trying to understand the tools for hacking this device (mine came from Digital Foci, seems that they sold this design to many).

I am currently using XP and USB Snoopy, trying to determine which device in Snoopy corresponds to the device...Someone above said something about 8/1403?

On Windows, the Photo Viewer uses JPG.

One thing I am going to try (when I get Snoopy figured out): create images of 128x128 in the following: pure red, pure blue, pure green, half red half blue (top bottom), and half red half blue (left right), then move them to the device and see what the data looks like.
Back to top
View user's profile Send private message
aiah
n00b
n00b


Joined: 28 Jan 2008
Posts: 1

PostPosted: Mon Jan 28, 2008 1:12 pm    Post subject: Reply with quote

Code:
[quote="WingGnDm"]this is the 512bytes sent to sector 49
http://filebin.ca/gejkhw/getimage

http://filebin.ca/tozxam/1image
this is one of the images in the device, if someone can figure out its format and make it usable it would help out a lot.
As far as i can tell, it should be 16bit rgb, 128x128.
[/quote]

The first 16bytes is a soort of header
F5 00 80 00 80 01 00 02 04 01 30 00 00 00 00 00

F5              posably some magic number to verify start of image
 00 80       128 possably x resolution
 00 80       128 possably y resolution
 01 00 02 01
30 00         length of image data

It seems the image data consists of blocks (subframe) of data each block starts with 2f (3f of 37)
Each block (subframe) is 8x8 pixels and arranges like
[01][17][32]....[96][112]
[02][18].
[03]
.....
[16][32]..............[][128]

2f block is 48bytes
3f block is 64 bytes
37 block is 56 bytes

Verify:
* to check this, randomly change some data achter the 2F and upload the memory image to the device, is will show a change in an area 8x8pix (subframe)
* analize the imagedatafile and you wil see the 2f/3f/37 repeating at the given offsets (according to blocksize)


Block data:

(a) 2f d5 4c 31 d2 c2 7e d4   
(b) ed f7 fd e2 cc f4 fd f9       
(c) 78 86 76 76 79 77 77 76 
     88 67 87 77 86 57 87 87 
     a8 77 88 77 76 68 88 77
     87 77 77 77 86 77 79 77 

32

This is where it realy gets weird, the data doesn't seem to be related to rgb values in any way.
I think its using an color lookup table.
* if you check the windows software viewer, it has a file called decodertable (the data contents of this file is also found in the device itself somewhere near address 0x8000 of the memory

Changing one byte in part (a) changes the whoile block (i assume it's some offset into the color/conversion table)
Changing one byte in part (b) changes the whole line of 8pix (i assume it's an offset into the color/conversions
Changing one byte in part (c) changes 2pixex on a line (4bits/pixel) this also fits whith the 32 bytes in part (c)    8x8 * (4bit/pix) = 256bit = 32 bytes


But so far  i'm still unable te produce anything representing an image :(



Other options:
Maby there is some 65c02 expert who can disaaemble the firmware (with notes) tp see how the image data is transfered to the LCD. (My 65c02 knowledge is to close to nonexistend to even try)
Or can start debuging the windows software to see what it does in detail.  (long ago in the windows98 days,  still had access to softice debugger)
Back to top
View user's profile Send private message
iibm
n00b
n00b


Joined: 27 Feb 2008
Posts: 1

PostPosted: Thu Feb 28, 2008 10:02 am    Post subject: Reply with quote

there is some answer here : http://picframe.spritesserver.nl/wiki/index.php/ImageEncoding
Back to top
View user's profile Send private message
ericm
n00b
n00b


Joined: 03 Apr 2008
Posts: 1

PostPosted: Thu Apr 03, 2008 4:26 am    Post subject: had a go writing set image Reply with quote

I had a go at writing a set image. From looking at a usb snoop I think the image gets loaded
via a sequence like:

send to block 0x31 -- 512 bytes
03 00 00 00 XX 00 00 ....

send to block 0x33 -- 0x8000 bytes 32728
the image data

send to block 0x31 -- 512 bytes
02 00 00 00 XX 00 00 ....

read from block 0x58 -- 512 bytes

I tried reading an image then writing it back with some changed bytes.
This ran okay but locked up the display and I have been unable to get it working again.
I guess this helps people in what not to do!
Back to top
View user's profile Send private message
NGE
n00b
n00b


Joined: 11 Apr 2008
Posts: 1

PostPosted: Fri Apr 11, 2008 9:31 am    Post subject: Reply with quote

Hello every one,
I have bought a keyChain, but like some1 told on the beginning of this thread this keychain have a "trap" my wife connected to the pc, and tryed to open on the Windows Usb devices and it asked to format the unit and she pressed "YES" !!!! but it have gived an error telling that cannot format the unit, but now when i insert pictures on the device using Picture Viwer, and then i try to see the pictures on the KeyChain nothing appens... Black Screen.. Any guess how to fix this problem ?

( Maybe she have deleted any page on the "formating process " ) ? I cant enter on the "memory stick" it ask me all the time to format it..

Thanks in advance.
Back to top
View user's profile Send private message
Jsines
n00b
n00b


Joined: 18 May 2008
Posts: 1

PostPosted: Sun May 18, 2008 10:29 pm    Post subject: Sitronix Key Chain Reply with quote

Sorry guys. I've read all the theads but I'm really not smart enough to understand enough to even ask a question about what you wrote. The basic question is, how can a real layman that just knows how to point and click get this stupid thing to work. i.e. accept pictures from the computer and show them back. I need something easy. Or is this item destined to be filed in the circular file on tthe floor?
_________________
J. Sines
Back to top
View user's profile Send private message
herberto07
n00b
n00b


Joined: 14 Dec 2012
Posts: 1

PostPosted: Fri Dec 14, 2012 2:48 pm    Post subject: Re: Sitronix Key Chain Reply with quote

Jsines wrote:
Sorry guys. I've read all the theads but I'm really not smart enough to understand enough to even ask a question about what you wrote. The basic question is, how can a real layman that just knows how to point and click get this stupid thing to work. i.e. accept pictures from the computer and show them back. I need something easy. Or is this item destined to be filed in the circular file on tthe floor?


Same here, any easy methods to get pix on this thing ??? Thanks all!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
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