Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 20 Oct 2014, 04:44
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Filesystem
gphotofs to make camera appear as memory stick
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [18 Posts]   Goto page: 1, 2 Next
Author Message
Moose On The Loose


Joined: 24 Feb 2011
Posts: 528

PostPosted: Tue 31 Dec 2013, 11:14    Post subject:  gphotofs to make camera appear as memory stick
Subject description: gtkam is really bad and I think I have a better solution
 

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.
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 8342

PostPosted: Tue 31 Dec 2013, 12:47    Post subject:  

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
Back to top
View user's profile Send private message 
Moose On The Loose


Joined: 24 Feb 2011
Posts: 528

PostPosted: Tue 31 Dec 2013, 13:13    Post subject:  

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.

Quote:

.... Phones have managed appearing as usb memory for years


I know it works with Android. Does the IPhone do the same?

Quote:

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:

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?

Quote:

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:

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
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 8342

PostPosted: Tue 31 Dec 2013, 13:23    Post subject:  

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
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Tue 31 Dec 2013, 20:54    Post subject:  

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?

_________________
http://bkhome.org/news/
Back to top
View user's profile Send private message Visit poster's website 
Moose On The Loose


Joined: 24 Feb 2011
Posts: 528

PostPosted: Wed 01 Jan 2014, 13:33    Post subject:  

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.
Back to top
View user's profile Send private message 
Moose On The Loose


Joined: 24 Feb 2011
Posts: 528

PostPosted: Wed 01 Jan 2014, 13:47    Post subject:  

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.



Quote:

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.


Quote:

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.

Quote:

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.
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 8342

PostPosted: Wed 01 Jan 2014, 14:14    Post subject:  

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
Back to top
View user's profile Send private message 
Moose On The Loose


Joined: 24 Feb 2011
Posts: 528

PostPosted: Wed 01 Jan 2014, 18:00    Post subject:  

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
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 8342

PostPosted: Wed 01 Jan 2014, 19:37    Post subject:  

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

mike
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Thu 02 Jan 2014, 06:10    Post subject:  

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.

_________________
http://bkhome.org/news/
Back to top
View user's profile Send private message Visit poster's website 
dejan555


Joined: 30 Nov 2008
Posts: 2681
Location: Montenegro

PostPosted: Thu 02 Jan 2014, 07:25    Post subject:  

It's probably called "gtkam" in most puppies
_________________


Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11117
Location: Arizona USA

PostPosted: Thu 02 Jan 2014, 09:43    Post subject:  

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.
Back to top
View user's profile Send private message 
Moose On The Loose


Joined: 24 Feb 2011
Posts: 528

PostPosted: Thu 02 Jan 2014, 10:55    Post subject:  

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.

Quote:

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.
Back to top
View user's profile Send private message 
Moose On The Loose


Joined: 24 Feb 2011
Posts: 528

PostPosted: Thu 02 Jan 2014, 11:00    Post subject:  

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.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [18 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Filesystem
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
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1011s ][ Queries: 11 (0.0047s) ][ GZIP on ]