gphotofs to make camera appear as memory stick

Filemanagers, partitioning tools, etc.
Post Reply
Message
Author
User avatar
Moose On The Loose
Posts: 965
Joined: Thu 24 Feb 2011, 14:54

gphotofs to make camera appear as memory stick

#1 Post by Moose On The Loose »

This may be above my skill level to do but I have started to take a look at it.

With changes to several parts of puppy's mounting and unmounting and putting up icons, I think I can make a camera like my DX6490 look to the user almost exactly like a memory stick. This has led me to look at pmount etc a little.

I am thinking of solving another common problem while I am at it:

If you attempt to unmount a partition that contains an SFS that is mounted by loopback, the unmount action fails. It seems to me that it would be easy to look for this condition and try first to unmount the SFS. This would mean that to the user, the unmount of the partition would just work as expected if the SFS was not actually in use.

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#2 Post by mikeb »

gphotofs does give mount like behaviour.... but depending on the camera may be limited...In my case one fails altogether and the other gives read only access...in the ends taking out the memory card is easier. Shame such sophisticated cameras use archaic protocols for file transfers.... Phones have managed appearing as usb memory for years.

Yes unmounting sfs...just need a neat way of detecting really..
Fuser might help since how does the system know which sfs is blocking release....or do a path comparison with losetup provinding the offending information.

At shutdown I do this by modifying the unmount loop to do any sfs first...it helps that I mount them in /mnt/filemnt subfolder to keep separate rather then the weird+naming+thing+that+goes+on+normal so the sfs mountpoints retain the original names and a sort gets the unmount order correct

me dumb

mike

User avatar
Moose On The Loose
Posts: 965
Joined: Thu 24 Feb 2011, 14:54

#3 Post by Moose On The Loose »

mikeb wrote:gphotofs does give mount like behaviour.... but depending on the camera may be limited...In my case one fails altogether and the other gives read only access...in the ends taking out the memory card is easier. Shame such sophisticated cameras use archaic protocols for file transfers
Perhaps I should go find the source code and see if I can find the cause of the issue. The camera I tried worked right out of the box. It could be something as simple as a typographical which is perhaps within my skill level to find.
.... Phones have managed appearing as usb memory for years
I know it works with Android. Does the IPhone do the same?
Yes unmounting sfs...just need a neat way of detecting really..
Fuser might help since how does the system know which sfs is blocking release....or do a path comparison with losetup provinding the offending information.
I think mtab always shows the mount as a "loop" I should be able to parse that to get the offending item.

Code: Select all

sh-4.1# cat /etc/mtab
rootfs / rootfs rw 0 0
/dev/root / ext2 rw,relatime,errors=continue 0 0
none /proc proc rw,relatime 0 0
none /dev/pts devpts rw,relatime,gid=2,mode=620 0 0
none /sys sysfs rw,relatime 0 0
shmfs /dev/shm tmpfs rw,relatime,size=516148k 0 0
none /proc/bus/usb usbfs rw,relatime 0 0
/dev/sdc1 /mnt/sdc1 ext3 rw,relatime,errors=continue,data=ordered 0 0
/dev/sda3 /mnt/sda3 ext3 rw,relatime,errors=continue,data=ordered 0 0
/dev/sdc2 /mnt/sdc2 ext2 rw,relatime,errors=continue 0 0
/dev/loop0 /mnt/+mnt+sdc2+lupusave-kicad2.2fs ext2 rw,relatime,errors=continue 0 0
Parsing that with some bash is within my skill level. Can you see a problem I've missed?
At shutdown I do this by modifying the unmount loop to do any sfs first...it helps that I mount them in /mnt/filemnt subfolder to keep separate rather then the weird+naming+thing+that+goes+on+normal so the sfs mountpoints retain the original names and a sort gets the unmount order correct
I can see myself doing the unmount of the loopbacks with a loop that tries to unmount each one and loops around if any worked but others failed. This way a loopback within a loopback will get undone without me having to do a lot of thinking about it.

Code: Select all

LOGIC=3
while [[ "$LOGIC" == 3 ]] ; do
  LOGIC=0
  for each loopback ; do
    try to unmount
    if it worked ; then
      LOGIC=$(( $LOGIC | 1 ))
    else
      LOGIC=$(( $LOGIC | 2 ))
      fi
    done
  done

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#4 Post by mikeb »

A separate loop ... yes no reason why this would not work ...I just liked the convenience of using the original loop. Its something that should have been added to puppy years ago so go for it...

Gphotofs...I recently compiled the latest version.
Some good info on his site... basically support is dependant on user feedback and more importantly how fully the manufacturer supports the protocol in use... In my case badly or not at all. So in other words you get lucky or you don't.

If you are one of the lucky ones then you have a nice convenient transparent file access via whatever funky lead is in use. It's usually nice and stable too unlike the guis that floated around.

In my case I just made an icon to a mini script since gphotofs will autodetect whats there for you.

mike

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#5 Post by BarryK »

Er, gphotofs and autodetection of a camera has been in Puppy for a long time.

It is called 'PupCamera' and is in the graphic menu.

Are you using a very old version of Puppy?
[url]https://bkhome.org/news/[/url]

User avatar
Moose On The Loose
Posts: 965
Joined: Thu 24 Feb 2011, 14:54

#6 Post by Moose On The Loose »

BarryK wrote:Er, gphotofs and autodetection of a camera has been in Puppy for a long time.

It is called 'PupCamera' and is in the graphic menu.

Are you using a very old version of Puppy?
Im using 5.2.8.006 right now and it is not here. Any guess when it got dropped. I suspect it was for a good reason but when I tried it manually, it worked nicely for me. I need to get some power onto my camera to work on it.

User avatar
Moose On The Loose
Posts: 965
Joined: Thu 24 Feb 2011, 14:54

#7 Post by Moose On The Loose »

mikeb wrote:A separate loop ... yes no reason why this would not work ...I just liked the convenience of using the original loop. Its something that should have been added to puppy years ago so go for it...
I've started on the project but I think I may make a "part way there" version and publish it that only adds the feature of unmounting things with the extra loop. I wonder about adding a tab for loopbacks also. This would allow manual unmounting without going back to the directory with the SFS in it.


Gphotofs...I recently compiled the latest version.
Some good info on his site... basically support is dependant on user feedback and more importantly how fully the manufacturer supports the protocol in use... In my case badly or not at all. So in other words you get lucky or you don't
.

I am starting to think that adding a test for gphotofs and making the sections of the new pmount conditional on it being in the system may be a good idea. I think there may be trouble if you use gtkam while the file system is mounted. Thus I am thinking that the script needs to do something to lock that combination out. I will test that and see.

Personally, I think replacing gtkam with a gtkdialog thing that fires off pmount to do the actual mounting, would be the way to go.

If you are one of the lucky ones then you have a nice convenient transparent file access via whatever funky lead is in use. It's usually nice and stable too unlike the guis that floated around.
If I am publishing this, it needs to be the luck of others we consider. I can slap together something that works just for me quicker than something I would let others see. I don't think there really is such a thing as the code police but I still don't want to get arrested on a charge of code too bogus to be allowed.
In my case I just made an icon to a mini script since gphotofs will autodetect whats there for you.
mike
Yes, a quick script solves it for one user at a time.

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#8 Post by mikeb »

Well creating a more integrated system for mounting systems of various types ...drives, images, archives?, cameras, network shares and so on....seems a good project...I do think I should add NFS shares to my drive icon handler for example.

mike

User avatar
Moose On The Loose
Posts: 965
Joined: Thu 24 Feb 2011, 14:54

#9 Post by Moose On The Loose »

mikeb wrote:Well creating a more integrated system for mounting systems of various types ...drives, images, archives?, cameras, network shares and so on....seems a good project...I do think I should add NFS shares to my drive icon handler for example.

mike
I just thought, perhaps there should also be a hook to the pnethood

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#10 Post by mikeb »

well more like the function of pnethood integrated into drive icons or pmount......unless samba is not that straightforward....

mike

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#11 Post by BarryK »

Moose On The Loose wrote:
BarryK wrote:Er, gphotofs and autodetection of a camera has been in Puppy for a long time.

It is called 'PupCamera' and is in the graphic menu.

Are you using a very old version of Puppy?
Im using 5.2.8.006 right now and it is not here. Any guess when it got dropped. I suspect it was for a good reason but when I tried it manually, it worked nicely for me. I need to get some power onto my camera to work on it.
Dropped!!? Good reason!!?

PupCamera was introduced to Woof in October 2011, and has been in all puppies built with Woof since:
http://bkhome.org/blog/?viewDetailed=02529

But, if you want to use an ancient version of Puppy that lacks so many good features, and you want to reinvent the wheel, that is your choice.

Anyway, I'll go away and leave you to it.
[url]https://bkhome.org/news/[/url]

User avatar
dejan555
Posts: 2798
Joined: Sun 30 Nov 2008, 11:57
Location: Montenegro
Contact:

#12 Post by dejan555 »

It's probably called "gtkam" in most puppies
puppy.b0x.me stuff mirrored [url=https://drive.google.com/open?id=0B_Mb589v0iCXNnhSZWRwd3R2UWs]HERE[/url] or [url=http://archive.org/details/Puppy_Linux_puppy.b0x.me_mirror]HERE[/url]

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#13 Post by Flash »

FWIW, I repair digital cameras for a living and I never connect a camera to a computer to read the memory card. It's too much trouble to have to install and configure the proprietary software for every different make and model of camera, and keep everything updated for new cameras and firmware upgrades, etc.. Of course, I'm only testing cameras when I take pictures, so I always take jpeg pictures, which any computer can open and display. Then all I have to do is remove the memory card from the camera and plug it into a universal card reader that I always leave connected to the computer.

User avatar
Moose On The Loose
Posts: 965
Joined: Thu 24 Feb 2011, 14:54

#14 Post by Moose On The Loose »

BarryK wrote:
Moose On The Loose wrote:
BarryK wrote:Er, gphotofs and autodetection of a camera has been in Puppy for a long time.

It is called 'PupCamera' and is in the graphic menu.

Are you using a very old version of Puppy?
Im using 5.2.8.006 right now and it is not here. Any guess when it got dropped. I suspect it was for a good reason but when I tried it manually, it worked nicely for me. I need to get some power onto my camera to work on it.
Dropped!!? Good reason!!?
I see so the time line I was thinking was meant by "gphotofs and autodetection of a camera has been in Puppy for a long time." Was about 2 years. Puppy 528 must predate that and even the version that I am using which has been called 5.2.8.06 hasn't had it added. My assumption of "dropped" was based on the idea that it would only get dropped for a good reason.
PupCamera was introduced to Woof in October 2011, and has been in all puppies built with Woof since:
http://bkhome.org/blog/?viewDetailed=02529

But, if you want to use an ancient version of Puppy that lacks so many good features, and you want to reinvent the wheel, that is your choice.

Anyway, I'll go away and leave you to it.
Since I now have quite a few things compiled for 5.2.8 for my own personal and business use, I think I will stay at 528 for a while.

User avatar
Moose On The Loose
Posts: 965
Joined: Thu 24 Feb 2011, 14:54

#15 Post by Moose On The Loose »

dejan555 wrote:It's probably called "gtkam" in most puppies
gtkam exists on 528. It crashes a lot. During the xmas break, I attempted to use it to get pictures from someones camera. It would never stay running long enough to actually do it. Only when I did the gphotofs method was I able to get the pictures. I found Barry's blog entry about it being dreadful and jumped to a conclusion as I explained in the reply to his post.

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#16 Post by mikeb »

gphotofs was introduced around puppy 4 time.... it has always autodetected the camera type as far as I remember.

At the time gtkam was used as a very unstable gui for it.....so the change has been with the gui not gtphotofs...that has simply been updated over time.
But, if you want to use an ancient version of Puppy that lacks so many good features, and you want to reinvent the wheel, that is your choice.
He might do a better job of it...who knows...others have.....and many would argue with the quality and longevity of Lucid which is still being supported by dedicated people. Don't think there is any need to be rude when someone is being enthusiastic really....

mike

User avatar
Moose On The Loose
Posts: 965
Joined: Thu 24 Feb 2011, 14:54

#17 Post by Moose On The Loose »

Flash wrote:FWIW, I repair digital cameras for a living and I never connect a camera to a computer to read the memory card. It's too much trouble to have to install and configure the proprietary software for every different make and model of camera, and keep everything updated for new cameras and firmware upgrades, etc.. Of course, I'm only testing cameras when I take pictures, so I always take jpeg pictures, which any computer can open and display. Then all I have to do is remove the memory card from the camera and plug it into a universal card reader that I always leave connected to the computer.
Many years back, I ran SuSE and did the download from my camera all the time. I since have bought a card reader. However not all digital cameras have removable memory cards. The ones worth repairing instead of buying a new one all do but some very cheap ones don't.

On SuSE, the camera interface was one RPM and it did a great many camera models. Setup took basically no time at all.

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

Tablets?

#18 Post by slavvo67 »

It would be nice if there was an application that did the same when connecting a tablets. Specific for me would be the Kindle Fire HD. Is there anything in the puppy world for this?

Post Reply