Closed gotiniens closed 3 years ago
So from what I can see the following is happening:
wkz_mount.service
mount-device
At least the first three steps are successful. The system recognizes the connected device, which is a good thing.
Unfortunately I don't have a 920XT laying around π so I'm not able to reproduce this. But one thing that directly pops to my mind is that I'm able to configure the "USB Mode" of my watch. When navigating to Settings > System > USB Mode
I am able to select either "MTB (Media Transfer)" or "Garmin". Setting this to "MTP (Media Transfer)" allows workoutizer to successfully mount the device. Could you have a look if there is a similar option on your device?
Yes only the last part is failing, I used the API call during debugging to initiate the mount, because the raspberry was not near me.
I understand you don't own every Garmin device available, We can not all be DCRainmaker. I do also have an 910xt which is a future project, because it uses only ANT for fit file transfer. But i'm willing to help the project as much as I can, so I can troubleshoot/research this issue.
Unfortunately my device does not have the "USB Mode" setting
Can you send the output of the following commands, when your device is connected?:
gio mount --list --detail
gio mount -d /dev/bus/usb/{BUS}/{DEV}
udevadm info --name=/dev/bus/usb/{BUS}/{DEV} --query=property
cat /proc/partitions
Sure, find the output of the commands when my device is connected below.
Have you tried connecting your watch to your ubuntu machine? I learned that ubuntu does a great job in terms of auto-mounting my device. Could be helpful to compare the two setups and settings.
Having connected my FR645 on my RPI 3B:
$ gio mount --list --detail
Drive(0): SC16G
Type: GProxyDrive (GProxyVolumeMonitorUDisks2)
ids:
unix-device: '/dev/mmcblk0'
themed icons: [drive-removable-media-flash-sd] [drive-removable-media-flash] [drive-removable-media] [drive-removable] [drive] [drive-removable-media-flash-sd-symbolic]
[drive-removable-media-flash-symbolic] [drive-removable-media-symbolic] [drive-removable-symbolic] [drive-symbolic]
symbolic themed icons: [drive-removable-media-symbolic] [drive-removable-symbolic] [drive-symbolic] [drive-removable-media] [drive-removable] [drive]
is_removable=1
is_media_removable=1
has_media=1
is_media_check_automatic=1
can_poll_for_media=0
can_eject=0
can_start=0
can_stop=0
start_stop_type=shutdown
sort_key=00coldplug/12removable/mmcblk0
Volume(0): 091e 4b48
Type: GProxyVolume (GProxyVolumeMonitorMTP)
ids:
unix-device: '/dev/bus/usb/001/006'
activation_root=mtp://091e_4b48_0000c4fa0516/
themed icons: [phone]
symbolic themed icons: [phone-symbolic] [phone]
can_mount=1
can_eject=0
should_automount=1
$ gio mount -d /dev/bus/usb/{BUS}/{DEV}
Mounted /dev/bus/usb/001/006 at /run/user/1000/gvfs/mtp:host=091e_4b48_0000c4fa0516
$ udevadm info --name=/dev/bus/usb/001/006 --query=property
DEVPATH=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4
DEVNAME=/dev/bus/usb/001/006
DEVTYPE=usb_device
DRIVER=usb
PRODUCT=91e/4b48/1
TYPE=0/0/0
BUSNUM=001
DEVNUM=006
MAJOR=189
MINOR=5
SUBSYSTEM=usb
USEC_INITIALIZED=39924319957
ID_VENDOR=091e
ID_VENDOR_ENC=091e
ID_VENDOR_ID=091e
ID_MODEL=4b48
ID_MODEL_ENC=4b48
ID_MODEL_ID=4b48
ID_REVISION=0001
ID_SERIAL=091e_4b48_0000c4fa0516
ID_SERIAL_SHORT=0000c4fa0516
ID_BUS=usb
ID_USB_INTERFACES=:ffff00:
ID_VENDOR_FROM_DATABASE=Garmin International
GPHOTO2_DRIVER=PTP
ID_GPHOTO2=1
ID_MEDIA_PLAYER=1
ID_MTP_DEVICE=1
ID_PATH=platform-3f980000.usb-usb-0:1.4
ID_PATH_TAG=platform-3f980000_usb-usb-0_1_4
ID_FOR_SEAT=usb-platform-3f980000_usb-usb-0_1_4
DEVLINKS=/dev/libmtp-1-1.4
TAGS=:seat:uaccess:
$ cat /proc/partitions
major minor #blocks name
1 0 4096 ram0
1 1 4096 ram1
1 2 4096 ram2
1 3 4096 ram3
1 4 4096 ram4
1 5 4096 ram5
1 6 4096 ram6
1 7 4096 ram7
1 8 4096 ram8
1 9 4096 ram9
1 10 4096 ram10
1 11 4096 ram11
1 12 4096 ram12
1 13 4096 ram13
1 14 4096 ram14
1 15 4096 ram15
179 0 15558144 mmcblk0
179 1 262144 mmcblk0p1
179 2 15291904 mmcblk0p2
Let me know if there is anything else I can support you with while debugging this! If you should find another possibility of how to mount your device we could of course think about implementing a mechanism to automate this. I assume it would be likely that also other users would benefit from this.
PS. DCRainmaker would have to file a load of issues for all his devices π
There are clearly some differences, all taken from gio mount --list --detail
:
GProxyVolumeMonitorMTP
, mine from the type: GProxyVolumeMonitorUDisks2
should_automount=1
mine should_automount=0
activation_root
valueids.unix-device
valueI don't really know the significance of these differences, but I think that the ids.unix-device
is used to match on the /dev/bus/usb/001/006
parameter give in the gio mount
command. Maybe it is possible to add this value to the device?
Yes my Ubuntu machine auto-mounts my device on the path: /media/tim/GARMIN
. Trying to replicate the behaviour manually I found the following:
ids.unix-device
seems to be right
gio mount -d /dev/bus/usb/001/012
gio: /dev/bus/usb/001/012: No volume for given ID
udisksctl mount -b /dev/sda
command (No output, having some problems right now)But I was also able to use the udiskctl
command on the raspberry, but it needed user interaction:
pi@raspberrypi:~ $ udisksctl mount -b /dev/sda
==== AUTHENTICATING FOR org.freedesktop.udisks2.filesystem-mount-other-seat ===
Authentication is required to mount Garmin FR920 FLASH (/dev/sda)
Authenticating as: ,,, (pi)
Password:
==== AUTHENTICATION COMPLETE ===
Mounted /dev/sda at /media/pi/GARMIN.
Luckily there is an --no-user-interaction
option, too bad it does not work:
pi@raspberrypi:~ $ udisksctl mount -b /dev/sda --no-user-interaction
Error mounting /dev/sda: GDBus.Error:org.freedesktop.UDisks2.Error.NotAuthorizedCanObtain: Not authorized to perform operation
ids.unix-device
value for devices not exposing them.udiskctl
route is the way to go, but we have to solve the needed user-interaction.udiskctl
for your device seems to not be possible (no block device), so some sort of detection of the two methodes seems to be neededI also found pmount /dev/sda garmin
which mounts the device under /media/garmin.
I have a feeling it uses udisks API calles. but I have to check that
I also found
pmount /dev/sda garmin
which mounts the device under /media/garmin.
I assume it mounts your device at your ubuntu machine, right? Because once you are able to mount your device at the Raspberry Pi we can get started with automating it.
As long as we manage to get the workoutizer API endpoint mount-device
triggered (via e.g. udev
), we should be able to parse the output of one of the above commands (e.g. gio mount --list --detail
) and from that output we should also be able to distinguish which device was connected and thus decide on the different mount options.
For the initial break through I would leave the "Path to Garmin Device" option as is and maybe enhance the RPI setup readme in a way so that people will get to know the mount path of their device and subsequently can enter this via the settings page of workoutizer.
In a next step we could also try to get rid of the "Path to Garmin Device" option entirely, since we could figure it out automatically during the different mount options. But that is nothing to worry about currently, I would say.
Sorry I was unclear, the pmount
command works on the RaspberryPi after installing the package.
I will try to write implementation.
Great! Let me know if you need help π
With #174 Merged this issue is resolved
Describe the bug Garmin Device 920xt is not mounted automatically after following Readme.md. Failing with an gio error To Reproduce Steps to reproduce the behavior:
Additional context I found a mention of the same problem in issue #90 , But I can not find the solution. I have the feeling it is because your device is mounted as an MTP device, and mine should be mounted as an block device.
Following the https://github.com/fgebhart/workoutizer/blob/main/setup/other/debugging.md I found the following info:
My own debugging also resulted in some info: