Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bugzilla DB migration completed. Please report issues to Infra team via email via infra@gentoo.org or IRC
Bug 544434 - net-misc/modemmanager-1.4.4: improve einfo message
Summary: net-misc/modemmanager-1.4.4: improve einfo message
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords: NeedPatch
Depends on:
Blocks:
 
Reported: 2015-03-25 09:16 UTC by Martin Mokrejš
Modified: 2018-10-08 10:12 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
another attempt to improve the einfo message (modemmanager-1.8.2.ebuild.patch,1.34 KB, patch)
2018-10-08 09:49 UTC, Martin Mokrejš
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Mokrejš 2015-03-25 09:16:00 UTC
* Messages for package net-misc/modemmanager-1.4.4:

 * If your USB modem shows up as a Flash drive when you plug it in, You
 * should install sys-apps/usb_modeswitch which will automatically
 * switch it over to USB modem mode whenever you plug it in.
 * 
 * (Note: Above message is only printed the first time package is
 * installed. Please look at /usr/share/doc/modemmanager-1.4.4/README.gentoo*
 * for future reference)


I find it unclear what you want to say. From my experience I believe you speak about the USB modem appearing as a CDROM drive instead. For the beginners it would also be helpful if you mentioned one can do 'eject /dev/USB0' to test whether the modem switches to modem state.
Comment 1 Pacho Ramos gentoo-dev 2015-03-27 20:38:09 UTC
It's refers to usb_modeswitch being needed to get NetworkManager to automatically use it for connecting to internet when you connect it
Comment 2 Martin Mokrejš 2015-04-01 15:40:53 UTC
I know but I really wanted the einfo message being improved. I wonder whether you want to say 'Flash drive', I think it is a CD-ROM drive (at least in my experience it always was).

BTW, it is not specific requirement of modemmanager, even "plain pppd needs it". But what it really does it "ejects" the virtual CD-ROM exposed by the USB modem and it then switches into the modem-like mode and starts to liste to AT commands. That is the real reason why the application "needs" to be installed although eject(1) command does the same in effect.
Comment 3 Pacho Ramos gentoo-dev 2015-11-07 12:21:06 UTC
Do you mean that the USB pendrive is shown as a CD-ROM :/
Comment 4 Martin Mokrejš 2015-11-10 23:33:25 UTC
(In reply to Pacho Ramos from comment #3)
> Do you mean that the USB pendrive is shown as a CD-ROM :/

I don't know what you mean. The device is a modem but upon plugin it exposes a CD-ROM -like interface.

Maybe you mean that Network or ModemManager show an icon like a 'flash drive'? I use XFCE, it also shows up some icons here and there. so, just make the einfo message clearer, you know what I mean. ;-) Thank you.
Comment 5 Pacho Ramos gentoo-dev 2015-11-11 07:34:48 UTC
I don't what do you mean because in my case when I connected the pendrive it showed up as a pendrive :| (well, nautilus window showed some drivers that are present on it for Windows but I remember it wasn't detected as a CDrom and it didn't try to handle it with a CD player or similar :/)
Comment 6 Martin Mokrejš 2016-07-04 11:12:20 UTC
I will hand-write a change I wanted to happen:

- * Messages for package net-misc/modemmanager-1.4.4:
- 
-  * If your USB modem shows up as a Flash drive when you plug it in, You
-  * should install sys-apps/usb_modeswitch which will automatically
-  * switch it over to USB modem mode whenever you plug it in.
+ * Messages for package net-misc/modemmanager-1.4.4:
+ 
+  * If your USB 3G/LTE modem shows up as a CD-ROM drive when you plug it in, You
+  * should install sys-apps/usb_modeswitch which will automatically
+  * switch it over to USB modem mode and expose its SD card whenever you plug
+  * it in. You may manually also run 'eject /dev/ttyUSB0' to see if this
+  * approach is going to work. See 'dmesg' output for more info about your
+  * modem and about its runtime changes triggered by eject or usb_modeswitch.
Comment 7 Pacho Ramos gentoo-dev 2016-07-09 12:13:24 UTC
But the message is not about using your pendrive as an sd card or similar. This package, and its message, is needed for USB modems for being used as USB modems, instead of only recognizing them as storage pendrives

Also, what does eject do here? (apart of probably the device name changing from one setup to another)
Comment 8 Martin Mokrejš 2016-07-09 15:38:27 UTC
(In reply to Pacho Ramos from comment #7)
> But the message is not about using your pendrive as an sd card or similar.

But it is about about the need to switch it to the modem state. And IMHO by default the SD card interface is not acessible, it only becomes accessible after the CD-ROM interface is gone and when the modem interface is made available. And that is why I thought the einfo is wrong in the beginning (#c0).
it does not work as a flash drive by default (unless 'flipped').

> This package, and its message, is needed for USB modems for being used as
> USB modems, instead of only recognizing them as storage pendrives

But the modems do not expose by default their modem interface but only the emulated CD-ROM interface with mostly Windows drivers. So you need to either eject the /dev/srX or use usb_modeswitch if somebody already registered the pair of USB IDs and you have recent enough /usr/share/misc/usb.ids from sys-apps/hwids.

# grep DESCR /usr/portage/sys-apps/usb_modeswitch/usb_modeswitch-2.3.0.ebuild 
DESCRIPTION="A tool for controlling 'flip flop' (multiple devices) USB gear like UMTS sticks"
#


> 
> Also, what does eject do here? (apart of probably the device name changing
> from one setup to another)

It does the 'flip flop' task, handled also by the usb_modeswitch based on the recognized USB ID value.
Comment 9 Pacho Ramos gentoo-dev 2016-12-05 13:28:36 UTC
What about simply this?

* If your USB 3G/LTE modem shows up as a storage drive when you plug it in, please install sys-apps/usb_modeswitch which will automatically
 * switch it over to USB modem mode.

Also, I don't think we should suggest people to run "eject" on a random device (the numbering is likely to change depending on the setup) to see "if it happens to work after that", supposedly it should work when usb_modeswitch is present and that is the pathway people should follow
Comment 10 Martin Mokrejš 2017-01-08 17:17:26 UTC
(In reply to Pacho Ramos from comment #9)
> What about simply this?
> 
> * If your USB 3G/LTE modem shows up as a storage drive when you plug it in,
> please install sys-apps/usb_modeswitch which will automatically
>  * switch it over to USB modem mode.
> 
> Also, I don't think we should suggest people to run "eject" on a random
> device (the numbering is likely to change depending on the setup) to see "if
> it happens to work after that", supposedly it should work when
> usb_modeswitch is present and that is the pathway people should follow

As you wish. It turned out on one of my devices I have to issue the command multiple times to get the modem switched:

usb_modeswitch -J -v 0x12d1 -p 0x15ca


How about:

* If your USB 3G/LTE modem shows up as a storage drive when you plug it in,
* please install sys-apps/usb_modeswitch which will automatically
* switch it over to USB modem modeupon plugin. That can be seen in syslog
* records. 
* Sometimes it does not switch away from the storage-like mode with broken
* firmware of the device so you may need to retry manually running
* usb_modeswitch again. Check 'dmesg' or lsusb for your device ID.
*
* For example, Huawei E3131 must switch from 12d1:15ca to 12d1:1506 to
* expose its three /dev/ttyUSB* and one /dev/sr* interfaces. The command is:
* usb_modeswitch -J -v 0x12d1 -p 0x15ca
Comment 11 Pacho Ramos gentoo-dev 2017-01-08 23:06:32 UTC
(In reply to Martin Mokrejš from comment #10)

> As you wish. It turned out on one of my devices I have to issue the command
> multiple times to get the modem switched:
> 
> usb_modeswitch -J -v 0x12d1 -p 0x15ca
> 

This looks to me like a bug, I would report it to upstream to try to see if they are able to handle it in a way that doesn't require manual intervention
Comment 12 Mart Raudsepp gentoo-dev 2018-10-07 15:12:49 UTC
I'm going to tweak the message a bit with the 1.8.2 bump. Feel free to look it over and tell what else might be tweaked there. I don't think we want to go into complicated specifics, like trying with eject and so on.
Comment 13 Larry the Git Cow gentoo-dev 2018-10-07 15:45:08 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4faf9513f4d7b0ad6044696f9ba0a37d184adab9

commit 4faf9513f4d7b0ad6044696f9ba0a37d184adab9
Author:     Mart Raudsepp <leio@gentoo.org>
AuthorDate: 2018-10-07 15:44:31 +0000
Commit:     Mart Raudsepp <leio@gentoo.org>
CommitDate: 2018-10-07 15:44:54 +0000

    net-misc/modemmanager: bump to 1.8.2
    
    Also tweak the usb_modeswitch message a bit
    
    Closes: https://bugs.gentoo.org/544434
    Closes: https://bugs.gentoo.org/666538
    Closes: https://bugs.gentoo.org/664144
    Signed-off-by: Mart Raudsepp <leio@gentoo.org>
    Package-Manager: Portage-2.3.49, Repoman-2.3.11

 net-misc/modemmanager/Manifest                  |   1 +
 net-misc/modemmanager/modemmanager-1.8.2.ebuild | 118 ++++++++++++++++++++++++
 2 files changed, 119 insertions(+)
Comment 14 Martin Mokrejš 2018-10-08 09:49:12 UTC
Created attachment 549770 [details, diff]
another attempt to improve the einfo message

Thank you for you efforts but how about this change?
Comment 15 Mart Raudsepp gentoo-dev 2018-10-08 09:55:45 UTC
That goes into complicated details I said I don't think we want to go in. If it shows up only as storage device, basically the user should just add usb_modeswitch and everything should just work. If not, then that's a bug to report upstream or somewhere. No need to go testing with some command line utilities, including having instructions on using usb_modeswitch, when the instruction is all about basic information about when it might be necessary to install usb_modeswitch - if it's already installed (so the example works), then there's nothing to inform about here.
For ModemManager the idea is that things just work, that you don't need to go ejecting and running commands - so it's only telling that you might need an additional package at runtime for everything to work seamlessly. It's just an alternative to always simply pulling in usb_modeswitch. I'd rather do that, if the instructions otherwise get a page long.
Comment 16 Martin Mokrejš 2018-10-08 10:03:44 UTC
Few more comments.

The USB dongles are too cheap and often with broken firmwares here and there. Sometimes you need to use eject command manually even if you have usbmodeswitch installed and it supposedly already issued the eject command (the firware sometimes ignores the command).

Second, people are not advised to 'eject' randomly a /dev/sr* device, the device name is logged in dmesg, as well as USB ID of the CDROM-like virtual device.

My point is to record where to look for basic info and summarize basic commands to check the device state. The change is minimal.

You would not believe but of the 3 USB dongles I have bought none of them had the USB ID registered in teh USB ID databses, used by usbmodeswitch. So, the commands are handy to learn the USB ID of all the interfaces, thjen a user is supposed to report the to http://www.linux-usb.org/usb-ids.html and then to http://www.draisberghof.de/usb_modeswitch/#contrib .

I am sorry but getting a new and "ordinary" USB LTE dongle to work under "Gentoo" always took me the above effort.


> Also, what does eject do here? (apart of probably the device name changing from one setup to another)

Just causes dongle's firmware to switch into modem-like state while withdrawing the CDROM-like interface with MS Win drivers and exposing all the /dev/USB* interfaces and the /dev/sd* interface of the SDcard slot (if present).
Comment 17 Mart Raudsepp gentoo-dev 2018-10-08 10:09:14 UTC
Sounds like information that might want to be in usb_modeswitch then, not modemmanager
Comment 18 Martin Mokrejš 2018-10-08 10:12:19 UTC
And I forgot to mention that GSM providers in different countries change the firmwares of the dongles and change the USB IDs. That is arguably the main reason physically same dongles have a range of USB IDs. And that is why in almost every country they have different IDs and the IDs even change if you 'flash' the device. And upgrading the firmware is a real pain, requiring unlock, etc.

Ah, true, some of this could be better placed in usbmodeswitch ebuild messages.