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 Sat 20 Oct 2018, 21:49
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Media Transfer Protocol MTP (SOLVED)
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 3 of 17 [250 Posts]   Goto page: Previous 1, 2, 3, 4, 5, ..., 15, 16, 17 Next
Author Message
tempestuous

Joined: 10 Jun 2005
Posts: 5470
Location: Australia

PostPosted: Thu 23 Jan 2014, 03:08    Post subject:  

can8v wrote:
sometimes after the
Code:
fusermount -u MTPdevice

command the device is still mounted.

Could the problem be that the go-mtpfs process is still running, and possibly remounting your device?
Earlier in this thread when I suggested using the "&" to background the process, I was actually a little worried about this.
I suggest you experiment by fully shutting down go-mtpfs before running the "fusermount -u" command.

There's another small potential problem I see -
can8v wrote:
Code:
cd /mnt
go-mtpfs "MTPdevice" &

This will mount your device at /mnt/MTPdevice
... but does that directory need to be created, first ??
Back to top
View user's profile Send private message 
tempestuous

Joined: 10 Jun 2005
Posts: 5470
Location: Australia

PostPosted: Thu 23 Jan 2014, 05:16    Post subject:  

can8v wrote:
I borrowed a second Nexus 7 from my wife, then connected both MTP devices to USB ports ...
...
and the Pup Camera application kept popping up ...

Yes, the guilty udev rule is /etc/udev/rules.d/88-puppy-autodetect.rules
specifically, this line -
Code:
ACTION=="add", SUBSYSTEM=="usb", ENV{INTERFACE}=="6/1/*", RUN+="/usr/sbin/pupautodetect camera"

You could either comment out this line, or delete/shift this entire udev rule altogether.
Back to top
View user's profile Send private message 
can8v

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

PostPosted: Thu 23 Jan 2014, 16:55    Post subject:  

tempestuous wrote:
can8v wrote:
sometimes after the
Code:
fusermount -u MTPdevice

command the device is still mounted.

Could the problem be that the go-mtpfs process is still running, and possibly remounting your device?
Earlier in this thread when I suggested using the "&" to background the process, I was actually a little worried about this.
I suggest you experiment by fully shutting down go-mtpfs before running the "fusermount -u" command.

There's another small potential problem I see -
can8v wrote:
Code:
cd /mnt
go-mtpfs "MTPdevice" &

This will mount your device at /mnt/MTPdevice
... but does that directory need to be created, first ??

Yes the directory needs to be created first. I should not have assumed people would realize to use the script without modification you would have to create this directory instead of /root/MTP. I am going to modify the script to look for the directory and create it if necessary and also change the unmount script to display a nicer splash message and hopefully have a 100% success rate, making the splash message nothing more than insurance.
Back to top
View user's profile Send private message Visit poster's website 
gcmartin

Joined: 14 Oct 2005
Posts: 6730
Location: Earth

PostPosted: Thu 23 Jan 2014, 17:44    Post subject:  

Can8v wrote:
... Yes the directory needs to be created first. I should not have assumed people would realize to use the script without modification you would have to create this directory instead of /root/MTP ...
I am wondering if what @Tempestuous shares was " is there anything already in /dev (or Linux) that can be/should be used?"
_________________
Get ACTIVE Create Circles; Do those good things which benefit people's needs!
We are all related ... Its time to show that we know this!
3 Different Puppy Search Engines or use DogPile
Back to top
View user's profile Send private message 
can8v

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

PostPosted: Fri 24 Jan 2014, 05:03    Post subject:  

Here is my working copy of my unmount script. It uses notify for the safe to eject MTP device message. I am now satisfied with the mount/unmount scripts and don't see any changes in the future, but you never know.

Code:
#!/bin/bash
# Put this script in the /root/my-applications/bin directory and make it executable
# Change directory to the mount point for the MTP device.
# In Thunar make a custom right click action that will execute this script, so that you can unmount your MTP device at any time from the right click menu in Thunar.
# Edit->Configure Custom Actions THen on the command line enter this script unmountMTP.sh it should find it if you have it in the /root/my-applications/bin directory.
# A similar setup should be available in other filemanager such as ROX, though I don't use them, so I cannot advise on how to set them up.
cd /mnt
# unmounts the MTP device.
fusermount -u MTPdevice
# Detect if MTP device unmount was successful.
# Looking for an empty mount directory so we need an empty variable
FILE=""
#Specify the directory the device was mounted to.
DIR="/mnt/MTPdevice"
# look for empty MTP mount directory
if [ "$(ls -A $DIR)" ]; then
    MOUNT_STATUS="MTP Device is still mounted. Please unmount the device before removing it."
else
    MOUNT_STATUS="MTP device unmounted successfully. It is now safe to remove your MTP device"
fi
# echo the MOUNT_STATUS variable in case the script is being run from the terminal
echo $MOUNT_STATUS
# Use GTK Dialog in case the script is being run from outside the terminal
export MAIN_DIALOG='
 <vbox>
  <text>
    <label>'$MOUNT_STATUS'</label>
  </text>
 </vbox>'
notify-send -t 6000 -i usbpendrive_unmount "$MOUNT_STATUS"

Thanks again to Tempestuous, for compiling go-mtpfs and turning me onto it.
Back to top
View user's profile Send private message Visit poster's website 
Sylvander

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

PostPosted: Fri 24 Jan 2014, 06:16    Post subject:  

I use xfe and ROX...
Plus...
I'm no Puppy/Linux expert.
Any chance of a PET file [to do the above] for me?
Back to top
View user's profile Send private message 
gcmartin

Joined: 14 Oct 2005
Posts: 6730
Location: Earth

PostPosted: Fri 24 Jan 2014, 13:06    Post subject:  

Or should this somehow land in WOOF-CE for system building?
_________________
Get ACTIVE Create Circles; Do those good things which benefit people's needs!
We are all related ... Its time to show that we know this!
3 Different Puppy Search Engines or use DogPile
Back to top
View user's profile Send private message 
can8v

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

PostPosted: Fri 24 Jan 2014, 14:17    Post subject:  

@gcmartin I think it should.
Back to top
View user's profile Send private message Visit poster's website 
01micko


Joined: 11 Oct 2008
Posts: 8680
Location: qld

PostPosted: Sat 25 Jan 2014, 08:08    Post subject:  

Some interesting results with my wife's gear.. (mine's pretty cool too can8v Wink )
    Samsung Galaxy Note (1st version, jellybean)
    Samsung Galaxy Tab 3 (recent model, jellybean)


Here is my udev rules file (ref), including my Galaxy W (GT-I8150 - which lsusb id's as Galaxy S2!) and the Nexus 7:
Code:
# MTP mode under ICS 4.0+ : automatic mount & umount when plugged (USB debug on & off)
ENV{ID_MODEL}=="Nexus_7", ENV{ID_MODEL_ID}=="4e41", ACTION=="add", RUN+="/usr/sbin/pupautodetect android-device"
ENV{ID_MODEL}=="GT-I8150", ENV{ID_MODEL_ID}=="6860", ACTION=="add", RUN+="/usr/sbin/pupautodetect android-device"
ENV{ID_MODEL}=="SAMSUNG_Android", ENV{ID_MODEL_ID}=="6860", ACTION=="add", RUN+="/usr/sbin/pupautodetect android-device"


Yes, yes, I hacked /usr/sbin/pupautodetect to run a different proggy (my script) when detected, which works nicely; more later on that.

Note that the Note and the Tab mount under the same rule.. sadly pupcamera pops up with those too, so there is possibly something in the Samsung ROM causing that (or perhaps its a jellybean thing). Neither my Nexus 7 (2012 - kit-kat 4.4.2) or my Galaxy W (CyanogenMod 9 [= ICS, 4.04], basically stock Android) pop up pupcamera.

dmesg output (you can see the same device ID but different serial number for Note [1st] and Tab) :
Code:
[   29.281515] usb 2-3: new high-speed USB device number 2 using ehci-pci
[   29.407007] usb 2-3: New USB device found, idVendor=04e8, idProduct=6860
[   29.407021] usb 2-3: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[   29.407030] usb 2-3: Product: SAMSUNG_Android
[   29.407037] usb 2-3: Manufacturer: SAMSUNG
[   29.407042] usb 2-3: SerialNumber: 0019783c0e622f
[   77.219213] usb 2-3: USB disconnect, device number 2
[  134.629481] usb 2-3: new high-speed USB device number 3 using ehci-pci
[  134.755762] usb 2-3: New USB device found, idVendor=04e8, idProduct=6860
[  134.755776] usb 2-3: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[  134.755785] usb 2-3: Product: SAMSUNG_Android
[  134.755792] usb 2-3: Manufacturer: SAMSUNG
[  134.755798] usb 2-3: SerialNumber: 520004e442e9a000
[  137.731896] usb 2-3: USB disconnect, device number 3
[  137.987887] usb 2-3: new high-speed USB device number 4 using ehci-pci
[  138.113197] usb 2-3: New USB device found, idVendor=04e8, idProduct=6860
[  138.113210] usb 2-3: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[  138.113218] usb 2-3: Product: SAMSUNG_Android
[  138.113225] usb 2-3: Manufacturer: SAMSUNG
[  138.113231] usb 2-3: SerialNumber: 520004e442e9a000
[  236.163979] usb 2-3: USB disconnect, device number 4


Still mount and unmount fine. Phone says "phone" in /mnt/MTPdevice, tablet says "tablet".. well "duh..!"

Now I just have to con the son into letting me test his Nexus 5 (Chrissy pressy).

Rolling Eyes

_________________
Puppy Linux Blog - contact me for access
Back to top
View user's profile Send private message Visit poster's website 
gcmartin

Joined: 14 Oct 2005
Posts: 6730
Location: Earth

PostPosted: Sat 25 Jan 2014, 20:07    Post subject:  

Reprinted above
Last edited by gcmartin on Sat 25 Jan 2014, 20:15; edited 2 times in total
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 8680
Location: qld

PostPosted: Sat 25 Jan 2014, 20:11    Post subject:  

gcmartin wrote:
@01Micko: Did you test from Slacko64 or Slacko?
Both

gcmartin wrote:
Another question for anyone
    Has this advanced far enough along to be a PET?
Thanks in advance
Not yet.
_________________
Puppy Linux Blog - contact me for access
Back to top
View user's profile Send private message Visit poster's website 
gcmartin

Joined: 14 Oct 2005
Posts: 6730
Location: Earth

PostPosted: Sat 25 Jan 2014, 20:16    Post subject:  

Questions for @01Micko
  • Is your MTP generalized for any MTP device?
    ---->OR<----
  • Would it help if everyone who has a MTP device forward their IDs somewhere so that mounting could occur by deviceID?
  • Wondering too, what would happen at mount times when you mount, say, both of your wife's devices (namely the Note and the Tab), simultaneously?
I can't help as I have a NOTE as well. But rest of the community can forward deviceID, I'm sure.

_________________
Get ACTIVE Create Circles; Do those good things which benefit people's needs!
We are all related ... Its time to show that we know this!
3 Different Puppy Search Engines or use DogPile

Last edited by gcmartin on Sat 25 Jan 2014, 20:35; edited 2 times in total
Back to top
View user's profile Send private message 
gcmartin

Joined: 14 Oct 2005
Posts: 6730
Location: Earth

PostPosted: Sat 25 Jan 2014, 20:30    Post subject:  

Wondering
Would this addition mount older cell phones, say, Motorola RaZr, etc?

If so, this would eliminate the need for specialize Windows programs to transfer information.

Hummm???

_________________
Get ACTIVE Create Circles; Do those good things which benefit people's needs!
We are all related ... Its time to show that we know this!
3 Different Puppy Search Engines or use DogPile
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 8680
Location: qld

PostPosted: Sat 25 Jan 2014, 20:53    Post subject:  

Should be able to auto generate specific rules for a device as it is plugged. So no need of stats.

It should work with most mtp based phones I guess, I don't know if its android specific. Maybe not.

Many older phones mount as mass storage anyway. Before I had GingerBread on the old sammy and it just appeared on the desktop as a usb device. Mounted easily.

_________________
Puppy Linux Blog - contact me for access
Back to top
View user's profile Send private message Visit poster's website 
smokey01


Joined: 30 Dec 2006
Posts: 2770
Location: South Australia :-(

PostPosted: Sat 25 Jan 2014, 22:37    Post subject:  

Thanks for this.

It works great on Slacko64.

I tried it in FatDog-611, not so good although it did work. A rule had to be created each time. It did not automatically detect the device. It didn't identify my Samsung Galaxy S4 but allowed me to transfer, play and view files nevertheless.

A much needed piece of software.

_________________
Software <-> Distros <-> Tips <-> Newsletters
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 3 of 17 [250 Posts]   Goto page: Previous 1, 2, 3, 4, 5, ..., 15, 16, 17 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
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.0763s ][ Queries: 14 (0.0138s) ][ GZIP on ]