View Full Version: pv2tool for linux

camerahacks >>Applications / Developers >>pv2tool for linux


<< Prev | Next >>

ygfperson- 09-06-2005
pv2tool for linux
I am starting a pv2tool linux port on the pv2tool sourceforge page. It should be relatively easy to port since Pv2Tool is very similar to Ops and all of the ops for linux code can be borrowed. For instance, one of the most difficult parts of the ops for linux project was implementing the file tree view on the window. Implementing this in pv2tool for linux is as easy as changing the commands sent and parsing the data gotten back differently. Progressbars are another thing already figured out. Anything done mostly with libusb is easy to port. Pretty much the project will consist of copying a button's code from pv2tool and making it suitable for gtk and c. Things with dialog boxes and other graphical bricabrac are a little trickier. (Ie: porting the unlock code could be done in 15 minutes, where porting something with a lot of checkboxes would take hours for someone with a little experience in gtk.) Anyone who wants to help is welcome!

ygfperson- 09-16-2005

I've put together a very primitive version of pv2tool for linux. It opens, unlocks, and closes the camera. (Ignore the non-functioning update-directory-listing button). The files will be or are in the sourceforge cvs under modulename pv2tool-for-linux. (See sticky on this forum for location of sourceforge page) I need somebody to -*test*-('") the unlocking button if possible because my camera is already permanently unlocked and can't be a good -*test*-('") subject. I believe it should work since the code is essentially bill's with few changes, but I want to be sure. The next part is improving the 'update-directory-listing' button so it works. This will probably be the most difficult part. I'll: - start with the ops-for-linux code and remove references to partitions and a "root" node since cameras have only one partition - put the bootsector reading into a function and replace GetFileInfo with something which access this bootsector information instead - If a bunch of buttons are simple commands to be sent, that'll be easy to implement. (That rhymes!)

ygfperson- 10-07-2005

things work now! The CVS version allows you to open, unlock, take a pic, and update the file listing (with icons!). The update file listing thing was definitely the hardest thing to implement. It's there now though. Everything else should be bananas.

agrippa_cash- 11-01-2005

I looked around the SF page and didn't see any mention of linux. I tried "make"ing around in my unzipped folders, but clearly that isn't the way to do it.

ygfperson- 11-04-2005

it's only in the cvs repository right now. it's far from complete though, and the functions it does do now probably wouldn't allow you to do much

enigma-- 11-25-2005

could you try porting pv2 fetch too?

Beef- 12-06-2005

it's only in the cvs repository right now. it's far from complete though, and the functions it does do now probably wouldn't allow you to do much Hi, ygfperson. I 'm glad to see you started porting pv2tool to Linux. I made up a cable for the PV2 that I picked up a couple of weeks ago. This is the result of the Vulcan nerve-pinch: INFO FIRMWARE 6550 HARDWARE 06 TYPEID 2B CMP TYPEID 2B ID XXXXXXXXXXXX REALM ID 20 I switched it off, plugged in the USB cable; it gave a little chirp and lit up. The device is detected, and shows up in dmesg|tail like this: ohci_hcd 0000:00:02.0: wakeup usb 1-3: new full speed USB device using address 3 usb 1-3: configuration #1 chosen from 2 choices Looking at usbview showed me the digital camer (in red, for some reason) in the tree. Clicking on this, showed the following information: Digital Camera Manufacturer: SMaL Speed: 12Mb/s (full) USB Version: 1.10 Device Class: 00(>ifc ) Device Subclass: 00 Device Protocol: 00 Maximum Default Endpoint Size: 64 Number of Configurations: 2 Vendor Id: 0dca Product Id: 0027 Revision Number: 0.01 Config Number: 1 Number of Interfaces: 1 Attributes: 80 MaxPower Needed: 200mA Interface Number: 0 Name: (none) Alternate Number: 0 Class: ff(vend.) Sub Class: 00 Protocol: 00 Number of Endpoints: 2 Endpoint Address: 81 Direction: in Attribute: 2 Type: Bulk Max Packet Size: 64 Interval: 0ms Endpoint Address: 01 Direction: out Attribute: 2 Type: Bulk Max Packet Size: 64 Interval: 0ms Config Number: 2 Number of Interfaces: 1 Attributes: 80 MaxPower Needed: 100mA Interface Number: 0 Name: Alternate Number: 0 Class: ff(vend.) Sub Class: 00 Protocol: 00 Number of Endpoints: 2 Endpoint Address: 81 Direction: in Attribute: 2 Type: Bulk Max Packet Size: 64 Interval: 0ms Endpoint Address: 01 Direction: out Attribute: 2 Type: Bulk Max Packet Size: 64 Interval: 0ms I finally managed to compile the code, but it took me a while to figure out why I was getting error messages about libraries and package-config files. But I got there in the end, and the program runs. Need to be root, though; GTK programs can't run with the set UID bit on, so I really have to be root to get anything done. That sort of defeats the idea of letting my kids loose with the whole set-up. There's no way I'm giving a three year-old root access! I still have to unlock the camera, though. I need to brace the assembly a bit; when the back is off the camera, there isn't enough force pressing the plug against the tracks on the edge connector. What I really need to find out now, is which file I need to modify on a linux system, to add the CVS_RED identifier (like windows users do in usb.inf, IIRR). Beef

enigma-- 12-09-2005

beef, you could always just sudo and then run the program

BillW- 12-09-2005

...There's no way I'm giving a three year-old root access! "Hey Johnny, what are you typing there? rm -fr / ? Get away from the enter key!!! No!!!!" "Johnny, if I've told you once, I've told you 1000 times. Don't force a libc upgrade!" (sorry, couldn't resist)

Beef- 12-10-2005

Heh, I'll worry about sudo or some other mechanism once get this camera unlocked. Plugged in the camera (no batteries) # lsusb Bus 003 Device 004: ID 04cf:8818 Myson Century, Inc. Bus 003 Device 001: ID 0000:0000 Bus 002 Device 002: ID 051d:0002 American Power Conversion Back-UPS Pro 500 Bus 002 Device 001: ID 0000:0000 Bus 001 Device 002: ID 0dca:0027 CVS Pharmacies CVS Red id 027 Bus 001 Device 001: ID 0000:0000 Put in the batteries, and shorted pin 6 to pin 7 # lsusb Bus 003 Device 004: ID 04cf:8818 Myson Century, Inc. Bus 003 Device 001: ID 0000:0000 Bus 002 Device 002: ID 051d:0002 American Power Conversion Back-UPS Pro 500 Bus 002 Device 001: ID 0000:0000 Bus 001 Device 003: ID 0dca:002b CVS Pharmacies CVS Red id 02b Bus 001 Device 001: ID 0000:0000 Great! This has changed the device ID to 002b # pv2tool usb device with VID==04cf PID==0002 usb device with VID==0000 PID==0002 usb device with VID==051d PID==0001 usb device with VID==0000 PID==0002 usb device with VID==0dca PID==0002 Found the camcorder: SMaL Digital Camera, VID:0DCA PID:002B Found camcorder. Connected to camcorder. Opened the camera, so far so good. But then I click on "unlock": Requesting challenge from camera WARNING: (unlock_camera.c, 684): No challenge received. That doesn't look encouraging. So, I try to download a file. No response. Try to update directory listing: ERROR: (update_directory_listing.c, 151): ChangeDirectory(/) failed file listing updated correctly And then I try to download the flash. I get prompted for a file to save the flash, and see this: Transfering /root/pv2_002b from the camera. ERROR: (download_flash.c, 31): Read Flash Error ERROR: (download_flash.c, 48): Read Flash Error Oops! the pv2tool window no onger gets redrawn, looks like the program has hung. Ctrl-C kills it. I unplug the cable, plug it back in again, and what do I see? # lsusb Bus 003 Device 004: ID 04cf:8818 Myson Century, Inc. Bus 003 Device 001: ID 0000:0000 Bus 002 Device 002: ID 051d:0002 American Power Conversion Back-UPS Pro 500 Bus 002 Device 001: ID 0000:0000 Bus 001 Device 004: ID 0dca:0027 CVS Pharmacies CVS Red id 027 Bus 001 Device 001: ID 0000:0000 The camera has gone back to being device ID 0027!!! What am I doing wrong? Beef.

BillW- 12-10-2005

I don't know if ygfperson has ported the "SDRAM Keyscan" button - is it there on the panel? If not, you'll need to grab a Windows box somewhere to unlock the cam. Either way, you should be able to follow brite_eye's instructions on the legal method (check out the HOWTO section). Note that you *don't* need to hit unlock when you're connecting in bootloader mode; bootloader doesn't have the concept of a locking.

Beef- 12-10-2005

I don't know if ygfperson has ported the "SDRAM Keyscan" button - is it there on the panel? If not, you'll need to grab a Windows box somewhere to unlock the cam. Either way, you should be able to follow brite_eye's instructions on the legal method (check out the HOWTO section). Note that you *don't* need to hit unlock when you're connecting in bootloader mode; bootloader doesn't have the concept of a locking. That might be the problem... that I'm running pv2tool under Linux, and I'm following (or trying to follow) the instructions for the Windows version. It's true, that there is no "SDRAM Keyscan" button for me. I'll try the "brite_eye's instructions on the legal method" as you suggest. Beef.

brite_eye- 12-10-2005

If you want an alternative to SDRAM keyscan - check my now outdated post before BillW made it much easier: forumer.com/viewtopic.php?t=318" target="_blank">http://camerahacks.10.forumer.com/viewtopic.php?t=318

BillW- 12-10-2005

Did ygfperson implement "transfer memory" and the pv2keys.txt mechanism? If not, then he can't follow that post.

texaspyro- 12-11-2005

"Johnny, if I've told you once, I've told you 1000 times. Don't force a libc upgrade!" Johnny can't grep...

Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.