gphotofs to make camera appear as memory stick
- Moose On The Loose
- Posts: 965
- Joined: Thu 24 Feb 2011, 14:54
gphotofs to make camera appear as memory stick
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.
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.
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
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
- Moose On The Loose
- Posts: 965
- Joined: Thu 24 Feb 2011, 14:54
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.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
I know it works with Android. Does the IPhone do the same?.... Phones have managed appearing as usb memory for years
I think mtab always shows the mount as a "loop" I should be able to parse that to get the offending item.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.
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
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.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
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
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
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
- Moose On The Loose
- Posts: 965
- Joined: Thu 24 Feb 2011, 14:54
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.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?
- Moose On The Loose
- Posts: 965
- Joined: Thu 24 Feb 2011, 14:54
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.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...
.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 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.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.
Yes, a quick script solves it for one user at a time.In my case I just made an icon to a mini script since gphotofs will autodetect whats there for you.
mike
- Moose On The Loose
- Posts: 965
- Joined: Thu 24 Feb 2011, 14:54
I just thought, perhaps there should also be a hook to the pnethoodmikeb 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
- BarryK
- Puppy Master
- Posts: 9392
- Joined: Mon 09 May 2005, 09:23
- Location: Perth, Western Australia
- Contact:
Dropped!!? Good reason!!?Moose On The Loose wrote: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.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?
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]
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.
- Moose On The Loose
- Posts: 965
- Joined: Thu 24 Feb 2011, 14:54
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.BarryK wrote:Dropped!!? Good reason!!?Moose On The Loose wrote: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.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?
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.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.
- Moose On The Loose
- Posts: 965
- Joined: Thu 24 Feb 2011, 14:54
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.dejan555 wrote:It's probably called "gtkam" in most puppies
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.
mike
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.
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....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.
mike
- Moose On The Loose
- Posts: 965
- Joined: Thu 24 Feb 2011, 14:54
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.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.
On SuSE, the camera interface was one RPM and it did a great many camera models. Setup took basically no time at all.