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 Sun 23 Nov 2014, 10:58
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Filesystem
MTP automatic mounter (CLOSED)
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [12 Posts]  
Author Message
can8v

Joined: 15 Jul 2006
Posts: 584
Location: Yuba City, CA

PostPosted: Thu 30 Jan 2014, 03:26    Post subject:  MTP automatic mounter (CLOSED)
Subject description: requires go-mtpfs and libnotify.
 

***EDIT***
I have abandoned this project in favor of a completely different design. The new package is posted here: http://murga-linux.com/puppy/viewtopic.php?p=756455#756455
The PET package I posted in this thread does work and some might prefer it, but since I have abondoned it, I will not be supporting it, or coming out with any now feature releases or bug fixes (if there are any bugs). I have marked this thread, as CLOSED, Should somebody else wish to pursue further development on this project that would be fine by me, but a new thread should be opened.
***END EDIT***
This is a distro independent package (bash shell scripts) for auto mounting MTP devices, such as Android 4.x and up and many media players. You will need to install the go-mtpfs package from tempestuous available here:
http://murga-linux.com/puppy/viewtopic.php?t=91442#752416
These scripts make extensive use of notify-send, so libnotify is highly recommended. I suppose one could use this package without notifications, but you might run into some unexpected behavior that the notifications would explain to you and keep you from thinking there is a bug where there probably isn't. If you don't have/want notify-send I recommend launching the scripts from the command line, as some of the notifications also echo to the terminal.
I built this program because there is an issue with udev in some puppies (all versions of Saluki and Carolina and at least some versions of Fat Dog 64, and maybe others) that causes 01micko's excellent auto mounter to take 20-30 seconds to autodetect a connection to a MTP device. Since I use Carolina that is why all the notifications use notify-send. for ver. 0.2 I will try to automatically detect if notify-send is available and if it is not, then use GtkDialog instead. That is assuming we run into some folks using puppies that don't have notify-send and want to use this package.
Usage:
After installing Tempestuous' go-mtpfs package and this package, then you need to decide how you would like to launch the scripts.
I chose to make a custom action in Thunar file manager, this makes a right click context menu item. You can do this as follows.
Open Thunar -> Edit -> create custom action
the scripts will have been installed in the /root/my-applications/bin directory the mount script is mountMTP.sh and the unmount script is unmountMTP.sh
You can simply navigate to them in a file manager and open them, or you can create symlinks on your desktop, create menu entries, etc.
The important thing here is that after you mount a MTP device the first time there is a monitor script that will continuously monitor your USB ports waiting for the next time you plug it in and when you do it will recognize it as your MTP device and automount it. When you are done with it just unmount it using the unmount script. It is important that if you use the mount script to mount it or you auto-mount it that you use the unmountMTP.sh script to unmount it. If you mount from the terminal using go-mtpfs directly from the terminal then you will need to unmount directly from the terminal. That said if you like the command line, that is another option for using these scripts.
simply install the packages, plug in your device and at the command line type:
# mountMTP.sh

The automount magic needs the USB monitor to be started. it is in the /root/Startup directory and will start automatically every time you start your computer, but unless you just happened to restart your computer after you installed the package, you will need to manually start the monitor this time. You can start it at the command line by typing:
# dmesgParse.sh

or you can simply navigate to /root/Startup in your file manager and double click the file.

When you are ready to unmount your device just launch the unmountMTP.sh script by any method you like. at the command line it is
# unmountMTP.sh
That's it. Enjoy!
Report any bugs or suggestions here. I am plan at least one more version after this, maybe more, who knows.
[/img]
Screenshot-2.jpg
Description  An RCT6378W2 tablet automatically mounted to /root/RCT6378W2. The notification in the upper right corner requires notify-send (libnotify).
jpg

 Download 
Filename  Screenshot-2.jpg 
Filesize  37.38 KB 
Downloaded  285 Time(s) 
customAction1.png
Description  custom action window in Thunar file manager
png

 Download 
Filename  customAction1.png 
Filesize  214.9 KB 
Downloaded  288 Time(s) 
CS-MTPmounter-i486.pet
Description 
pet

 Download 
Filename  CS-MTPmounter-i486.pet 
Filesize  2.78 KB 
Downloaded  197 Time(s) 

Last edited by can8v on Sat 08 Feb 2014, 22:50; edited 3 times in total
Back to top
View user's profile Send private message Visit poster's website 
Sylvander

Joined: 15 Dec 2008
Posts: 3517
Location: West Lothian, Scotland, UK

PostPosted: Thu 30 Jan 2014, 10:44    Post subject:  

1. Followed your instructions as best I could....
Installed: CS-MTPmounter-i486.pet and go-mtpfs-20130628.pet

2. At times I was confused...
Things didn't seem to be going forward in a simple manner...
Had trouble when I tried to use your commands in a terminal.
But in the end...

3. It's all now working quite routinely... Very Happy
i.e. Provided I use the dialog windows that automatically pop up when I connect the Samsung Galaxy tab-2 10.1 tablet.
As follows:
a. I plug in the tablet.

b. Two windows atomatically appear on the desktop: 1 for pupcamera; 1 for MTP Device.

c. I use "MTP Device" to mount the "Samsung GT-P5110 detected".

d. An Xfe window opens with 1 folder hierachy pane and 2 file panes displayed.
I can use this to navigate to "/mnt/MTPdevice/Tablet", and [further navigate and] display file content.

e. Then I can close Xfe, left-click on the small phone icon down at bottom right, and an "Unmount" dialog is displayed, asking if I'd like to unmount the GT-P5110.
I click "Yes", and a green message says it's "safe to disconnect", so I do that.

f. I can then plug the tablet in once again, and the sequence sucessfully begins anew.

4. I noticed that when attempting to use commands in a terminal [or open the .sh files], things didn't go well for me [I'm probably doing something wrong].
I noticed it being reported that "notify-send" couldn't be found.
How would I check if that's installed?
00.jpg
 Description   
 Filesize   13.88 KB
 Viewed   754 Time(s)

00.jpg

Back to top
View user's profile Send private message 
Sylvander

Joined: 15 Dec 2008
Posts: 3517
Location: West Lothian, Scotland, UK

PostPosted: Thu 30 Jan 2014, 11:09    Post subject: Re: MTP automatic mounter
Subject description: requires go-mtpfs and libnotify.
 

can8v wrote:
The automount magic needs the USB monitor to be started. it is in the /root/Startup directory and will start automatically every time you start your computer, but unless you just happened to restart your computer after you installed the package, you will need to manually start the monitor this time. You can start it at the command line by typing:
# dmesgParse.sh

a. Tried the command, and all I get is a red flashing underscore.
I've restarted a number of times since I installed the PET files.

b. Does the "automount magic" auto mount a tablet when you connect it?

c. What name does the "USB monitor" go by?
Do you see the necessary in the /root/Startup folder as per screenshot below?
00.jpg
 Description   
 Filesize   32.4 KB
 Viewed   794 Time(s)

00.jpg

Back to top
View user's profile Send private message 
can8v

Joined: 15 Jul 2006
Posts: 584
Location: Yuba City, CA

PostPosted: Thu 30 Jan 2014, 12:13    Post subject:  

Sylvander wrote:
1. Followed your instructions as best I could....
Installed: CS-MTPmounter-i486.pet and go-mtpfs-20130628.pet

2. At times I was confused...
Things didn't seem to be going forward in a simple manner...
Had trouble when I tried to use your commands in a terminal.
But in the end...

3. It's all now working quite routinely... Very Happy
i.e. Provided I use the dialog windows that automatically pop up when I connect the Samsung Galaxy tab-2 10.1 tablet.
As follows:
a. I plug in the tablet.

b. Two windows atomatically appear on the desktop: 1 for pupcamera; 1 for MTP Device.

c. I use "MTP Device" to mount the "Samsung GT-P5110 detected".

d. An Xfe window opens with 1 folder hierachy pane and 2 file panes displayed.
I can use this to navigate to "/mnt/MTPdevice/Tablet", and [further navigate and] display file content.

e. Then I can close Xfe, left-click on the small phone icon down at bottom right, and an "Unmount" dialog is displayed, asking if I'd like to unmount the GT-P5110.
I click "Yes", and a green message says it's "safe to disconnect", so I do that.

f. I can then plug the tablet in once again, and the sequence sucessfully begins anew.

4. I noticed that when attempting to use commands in a terminal [or open the .sh files], things didn't go well for me [I'm probably doing something wrong].
I noticed it being reported that "notify-send" couldn't be found.
How would I check if that's installed?

It seems you used 01micko's program to mount you Galaxy. my program would not mount anything to /mnt/MTPdevice. nor does it put a phone icon in the system tray or anywhere else. I am glad to see you go your device mounted though.

If you want to try the other package after you unmount your device
go to /root/my-applications/bin/ and open mountMTP.sh
This should open xfe with the contents of your tablet or phone or whatever MTP device you are trying to mount.When you are finished unmount by opening /root/my-applications/bin/unmountMTP.sh after that it should auto mount and open xfe with the contents of your device displayed every time you plug it in. just remember to unmount it by opening the unmountMTP.sh file prior to unplugging it otherwise you might have to reboot your computer before you can mount the device again.

If you finally have it worked out how to get your device working with 01micko's program, you might want to just stick with that though.
Back to top
View user's profile Send private message Visit poster's website 
Sylvander

Joined: 15 Dec 2008
Posts: 3517
Location: West Lothian, Scotland, UK

PostPosted: Thu 30 Jan 2014, 13:09    Post subject:  

1. "It seems you used 01micko's program to mount you Galaxy. my program would not mount anything to /mnt/MTPdevice. nor does it put a phone icon in the system tray or anywhere else."
a. That has me perplexed.
Before I started on your PET, I deleted the existing pupsave file, and restored a backup I'd made...I thought I'd made it prior to the install of micko's pet.
Perhaps I'd made it AFTER installing his pet.

2. "If you want to try the other package after you unmount your device
go to /root/my-applications/bin/ and open mountMTP.sh
This should open xfe with the contents of your tablet or phone or whatever MTP device you are trying to mount.
"
Did that, and it worked just fine.
See screenshot below, of folder system under "/mnt/USB2.0-Print_".

3. "When you are finished unmount by opening /root/my-applications/bin/unmountMTP.sh"
Ok, that worked.
/mnt/USB2.0-Print_ is now empty.
Closed all Xfe windows, and...
I've now unplugged the tablet.

4. "after that it should auto mount and open xfe with the contents of your device displayed every time you plug it in."
Plugged it back in [heard a sound from the tablet], but I don't see any reaction here in Puppy.
I ran Xfe, and /mnt/USB2.0-Print_ is empty as before.
00.jpg
 Description   
 Filesize   67.23 KB
 Viewed   715 Time(s)

00.jpg

Back to top
View user's profile Send private message 
Sylvander

Joined: 15 Dec 2008
Posts: 3517
Location: West Lothian, Scotland, UK

PostPosted: Thu 30 Jan 2014, 13:46    Post subject:  

1. Decided to do a check on my PupsaveHotBackup=precisesave.3fs.BKP-14.01.27-09.34.
Compare this with my post here date & time = Mon 27 Jan 2014, 05:49. [the final hotbackup made about 4 hrs after this!]
I say there that I made the hot-backup just prior to having a 2nd go with the new updated instructions.
Hence there should have been no trace of the 1st attempt in the hot-backup because I didn't save any session changes during that session, nor at shutdown.
And yet...
I must have made a later backup methinks.

2. Just now...
After I deleted the existing pupsave, and restored the hot-backup = precisesave.3fs.BKP-14.01.27-09.34 [using a 2nd Puppy = Slacko-5.5.91]...
And rebooted into Precise-5.6.1...
And connected the tablet...
Two windows auto-ran = "MTP Device" & "PupCamera".
That aught not to have happened.

3. Looks like traces of the [2nd?] install of micko's prog's are included in the precisesave.3fs.BKP-14.01.27-09.34.
Any idea what I aught to do about that?
Should I eliminate those prior to installing yours?
Or can both happily co-exist?
Back to top
View user's profile Send private message 
can8v

Joined: 15 Jul 2006
Posts: 584
Location: Yuba City, CA

PostPosted: Thu 30 Jan 2014, 13:54    Post subject:  

@Sylvander
Quote:

4. "after that it should auto mount and open xfe with the contents of your device displayed every time you plug it in."
Plugged it back in [heard a sound from the tablet], but I don't see any reaction here in Puppy.
I ran Xfe, and /mnt/USB2.0-Print_ is empty as before.


Have you rebooted your computer since you installed the package?
If not try opening this file /root/Startup/dmesgParse.sh
It might seem like nothing has happened, but you will have started a background process (because the file is in the /root/Startup folder it will start automatically when you start your computer), that monitors your USB ports. Then plug your device back in and it should automatically mount.

Also please advise which puppy you are using so far I gather you are using xfe, but that is all I know.
Also I would like to know if you get the notification in the upper right corner of your screen when you mount your device. It disappears automatically after a few seconds. If you are not sure what I am talking about have a look at the screen shots I attached to my first post in this thread.
Back to top
View user's profile Send private message Visit poster's website 
Sylvander

Joined: 15 Dec 2008
Posts: 3517
Location: West Lothian, Scotland, UK

PostPosted: Thu 30 Jan 2014, 16:38    Post subject:  

1. "Have you rebooted your computer since you installed the package?"
I've restored the PupsaveHotBackup file, so at this time your program is no longer installed
I was intending to re-install, but I'm beginning to wonder whether I aught not.

2. "...Then plug your device back in and it should automatically mount. "
a. Hmmm, I'm beginning to think I don't fancy it auto-mounting, if unmounting it is less than really simple.
I'd find myself with a mounted tablet having forgotten how to dismount it.

b. I like the way my "Precise-5.6.1" is working right now, where 2 windows auto-appear on the desktop [PupCamera & MTP], and I can choose which to use to mount the tablet by just clicking the mount button on the one of my choice.
Then with MTP, a little phone icon appears down at bottom right, and I can use that to dismount the tablet.

3. "please advise which puppy you are using"
Precise-5.6.1

4. "I would like to know if you get the notification in the upper right corner of your screen when you mount your device"
When your program was installed I didn't get that.
I could begin again, just as an exercise, and try to get that.
I'll probably begin doing that tomorrow morning.

5. "have a look at the screen shots I attached to my first post in this thread."
I've done that, and it got me thinking...
I wouldn't want auto-mount unless dismounting was really easy.
What about an icon created on the desktop once detected as connected [like the drive partitions], with something indicating that it's a tablet and its mounted, and the user just clicks that to dismount it?
And the icon disappears when the tablet is disconnected.
Back to top
View user's profile Send private message 
can8v

Joined: 15 Jul 2006
Posts: 584
Location: Yuba City, CA

PostPosted: Thu 30 Jan 2014, 16:56    Post subject:  

Quote:
What about an icon created on the desktop once detected as connected [like the drive partitions], with something indicating that it's a tablet and its mounted, and the user just clicks that to dismount it?
And the icon disappears when the tablet is disconnected.


That would be a nearly ideal solution and I did consider it when I was writing this program.

I personally love to be able to right click to get to my mount and unmount options, because it is fast even when the desktop is covered over with open programs. I realize however, that I am probably in the minority here. At any rate that is not the reason I didn't include a feature like that in the first version. The reason was all the choices puppy users have in selecting a window manager (ie. JWM, XFCE, LXDE, IceWM, etc.). I haven't even tried all of the various window managers myself, so I certainly don't know how to make those icons appear in each of them. I am especially fond of XFCE and it would be very easy to make that happen in XFCE, but I will need more time to figure out if I can make it work more universally. I will likely get the dialogs working for those that don't have notify-send, then work on some more universal and easier ways to launch the scripts. Those are the weak areas of the package right now.
Back to top
View user's profile Send private message Visit poster's website 
can8v

Joined: 15 Jul 2006
Posts: 584
Location: Yuba City, CA

PostPosted: Thu 30 Jan 2014, 21:08    Post subject:  

Ok here is a new version that has Desktop icons that work in XFCE and maybe LXDE and some others. I doubt it will work in JWM. For JWM you will likely still have to create your own links to the scripts, so that you can launch the applications from your choice of locations. Basically if you have a /root/Desktop folder where you place files and sym links and they appears on your desktop this version will make set up and use much smoother.
After the pet is installed you will have an "Add New MTP Device" icon on your desktop. Simply plug in your MTP enabled device and open the "Add New MTP Device" link from the desktop.
In about 1 second you will:
- have a notification telling you that your device is mounted and reminding you to unmount it before you unplug it.
- see that the "Add New MTP Device" has changed to a "Unmount [Your Device]" link (it will actually name your device ie. "Unmount Nexus_7"
- have a new file manager window open and displaying the contents of your devices.

As before, after the first time you manually mount your device in this way, it will automatically mount your device each time you plug it in.

Additionally I added a feature to the mount script to check if the USB monitor is running and if not then it starts it for you, so you don't have to start it manually. Everytime you start your computer it will start the monitor automatically so you could feasibly only have to click the "Add new MTP Device" link once per device (ie. once for your phone and once for your tablet).
Here is a screencast:
http://youtu.be/N-asaTKmnyo
CS-MTP-Automounter-0-2.pet
Description  Ver. 0.2
pet

 Download 
Filename  CS-MTP-Automounter-0-2.pet 
Filesize  2.89 KB 
Downloaded  191 Time(s) 
Back to top
View user's profile Send private message Visit poster's website 
Sylvander

Joined: 15 Dec 2008
Posts: 3517
Location: West Lothian, Scotland, UK

PostPosted: Fri 31 Jan 2014, 06:58    Post subject:  

OK...
1. I installed your latest 0.2 version.
Seemed to install OK.

2. Plugged-in my tablet.
Saw nothing happening [e.g. no notification at top right on desktop], other than the usual 2 windows by micko's program.
Should I temporarily eliminate the install of micko's, or does it happily co-exist?

3. Found some [*MTP*] files as per sceenshot below.
The file in /root/Desktop doesn't appear on the desktop.
Can you tell me how to make it appear on the desktop?
My window manager is JWM.

4. If/when I "Open" "Add New MTP Device" and choose "Execute", I get an Xfe window that I can use to navigate to the [files on the] now mounted filesystem [under GT-P5110] of the tablet.
The file name then changes to "Unmount GT-P5110".
If I "Open2 that and "Execute", the filename toggles to "Add New MTP Device" once again.

5. I'll reboot without saving, to eliminate this installation, and re-do the installation at some future session, in line with any instructions given by yourself.
00.jpg
 Description   
 Filesize   27.15 KB
 Viewed   663 Time(s)

00.jpg

Back to top
View user's profile Send private message 
can8v

Joined: 15 Jul 2006
Posts: 584
Location: Yuba City, CA

PostPosted: Fri 31 Jan 2014, 09:41    Post subject:  

@Sylvander
Yes, JWM is not supported. In a day or two or three I should be at version 0.4 that version will include support for JWM/ROX pinboard, at that point it should work correctly on your system. Version 0.3 will be another feature release, but you can probably skip it as the features Wilmot work in JWM until 0.4 anyway.
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [12 Posts]  
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.1123s ][ Queries: 13 (0.0047s) ][ GZIP on ]