Re: ModemManager-1.6.2: does not work with Huawei E3372h-153
I forgot to add what I see in Connection information from nm-applet: Interface: GSM (ttyUSB0) Driver: huawei_cdc_ncm, option1 Martin ___ ModemManager-devel mailing list ModemManager-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel
Re: ModemManager-1.6.2: does not work with Huawei E3372h-153
Hi Alexander, thank you for you help. I propose improving mmcli manpage. The EXAMPLES section should start with: 1. how shall one figure out where is any modem seen 2. how to read the status, shown "registered" and later "connected" states. 3. although it seems it is not relevant to mmcli, a hint where to go next to get use of the "connected" modem would be very helpful. Aleksander Morgado wrote: > On Thu, Jan 12, 2017 at 3:49 PM, Martin MOKREJŠwrote: >> # mmcli --connect -m /org/freedesktop/ModemManager1/Modem/0 >> error: no bearer was specified > > --connect is a bearer action, you need to pass a bearer object path, > not a modem object path. I think "mmcli --help" could show some hints in the bearer section, like --create-bearer="apn=internet.t-mobile.xx" > >> # mmcli --list-bearers -m /org/freedesktop/ModemManager1/Modem/0 >> >> No bearers were found > > Ok, so you would first need to create a bearer with > --create-bearer="key=value,..." in one of the modems. > > E.g. > > mmcli -m 0 --create-bearer="apn=internet" Yeah, but I again had to rescan my devices and only then I was able to use a modem. And it appeared at different index pos. Again, the EXAMPLES section could be improved so that a user can use it as a real step-by-step manual to get connected (to have a network device with an IP!). > > See: > https://www.freedesktop.org/software/ModemManager/api/latest/gdbus-org.freedesktop.ModemManager1.Modem.html#gdbus-method-org-freedesktop-ModemManager1-Modem.CreateBearer > >> # mmcli --bearer -m /org/freedesktop/ModemManager1/Modem/0 >> error: invalid path or index string specified: '-m' > > --bearer expects a bearer path or index (help says "--bearer=[PATH|INDEX]") > >> # mmcli --bearer >> error: no actions specified > > Same thing, --bearer expects a bearer path or index (help says > "--bearer=[PATH|INDEX]") > >> # mmcli -b >> error: no actions specified > > Same thing, --bearer expects a bearer path or index (help says > "--bearer=[PATH|INDEX]") > >> # mmcli -b -m /org/freedesktop/ModemManager1/Modem/0 >> error: invalid path or index string specified: '-m' > > Same thing, --bearer expects a bearer path or index (help says > "--bearer=[PATH|INDEX]") How about mmcli being more friendly and output after the error message a list of my modems? # mmcli -L Found 1 modems: /org/freedesktop/ModemManager1/Modem/2 [huawei] E3372 # >From "experience" I now know it is at index 2. Don't expect users are that >smart when doing first steps. ;-) > >> >> >> # mmcli --set-power-state-on -m /org/freedesktop/ModemManager1/Modem/0 >> error: couldn't set new power state in the modem: >> 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.WrongState: Cannot set >> power state: not in disabled state' > > Your modem is already registered, so it is already in "on" power state. If one doesn't know what are all the options, it is hard to find what needs to be done in what order. The help text could say how the power-related options relate to "--enable", "--disable". For example, "not applicable when connected/enabled/whatever". > >> >> The mmcli --help-all are too cryptic to me. I failed to find a way to really >> get the device connected. There should be some typical examples at the end >> of --help-all output. Even figuring out I need to specify "-m >> /org/freedesktop/ModemManager1/Modem/0" took me a long while. Why sometimes >> it is rejected as a wrong argument I do not know (shown above). > > For launching a connection you can use the "manual" way of creating > the bearer object and then --connect; OR, easier, just > "--simple-connect" in the modem object. E.g.: > > mmcli -m 0 --simple-connect="apn=internet" And the "simple" seemed like a provisional solution, probably only a partial "something". So what is "full" connect then? > > See > https://www.freedesktop.org/software/ModemManager/api/latest/gdbus-org.freedesktop.ModemManager1.Modem.Simple.html#gdbus-method-org-freedesktop-ModemManager1-Modem-Simple.Connect So I had: # mmcli --simple-status -m 2 /org/freedesktop/ModemManager1/Modem/2 - Status | state: 'connected' | signal quality: '38' (recent) | bands: 'unknown' |access tech: 'lte' - 3GPP | registration: 'home' | operator code: '23001' | operator name: 'T-Mobile CZ' | subscription: 'unknown' # # nmcli connection show NAME UUID TYPE DEVICE tun0 14534bb3-8213-4a8f-b545-b1ce85475a73 tun tun0 tun1 fd0515be-3f98-4d09-95e3-3fc132370578 tun tun1 HuaweiE3131a6f9b700-5930-4dd9-a0aa-a808acb67c2c gsm -- HuaweiE3372h-153 7834078b-e76e-4825-b987-b460eed422ea gsm -- VPN connection 1 7db7b1fa-7aac-43b5-bbe7-dc3eebd84dc7 vpn -- eduroam
Re: ModemManager-1.6.2: does not work with Huawei E3372h-153
On Thu, Jan 12, 2017 at 3:49 PM, Martin MOKREJŠwrote: > # mmcli --connect -m /org/freedesktop/ModemManager1/Modem/0 > error: no bearer was specified --connect is a bearer action, you need to pass a bearer object path, not a modem object path. > # mmcli --list-bearers -m /org/freedesktop/ModemManager1/Modem/0 > > No bearers were found Ok, so you would first need to create a bearer with --create-bearer="key=value,..." in one of the modems. E.g. mmcli -m 0 --create-bearer="apn=internet" See: https://www.freedesktop.org/software/ModemManager/api/latest/gdbus-org.freedesktop.ModemManager1.Modem.html#gdbus-method-org-freedesktop-ModemManager1-Modem.CreateBearer > # mmcli --bearer -m /org/freedesktop/ModemManager1/Modem/0 > error: invalid path or index string specified: '-m' --bearer expects a bearer path or index (help says "--bearer=[PATH|INDEX]") > # mmcli --bearer > error: no actions specified Same thing, --bearer expects a bearer path or index (help says "--bearer=[PATH|INDEX]") > # mmcli -b > error: no actions specified Same thing, --bearer expects a bearer path or index (help says "--bearer=[PATH|INDEX]") > # mmcli -b -m /org/freedesktop/ModemManager1/Modem/0 > error: invalid path or index string specified: '-m' Same thing, --bearer expects a bearer path or index (help says "--bearer=[PATH|INDEX]") > > > # mmcli --set-power-state-on -m /org/freedesktop/ModemManager1/Modem/0 > error: couldn't set new power state in the modem: > 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.WrongState: Cannot set > power state: not in disabled state' Your modem is already registered, so it is already in "on" power state. > > The mmcli --help-all are too cryptic to me. I failed to find a way to really > get the device connected. There should be some typical examples at the end of > --help-all output. Even figuring out I need to specify "-m > /org/freedesktop/ModemManager1/Modem/0" took me a long while. Why sometimes > it is rejected as a wrong argument I do not know (shown above). For launching a connection you can use the "manual" way of creating the bearer object and then --connect; OR, easier, just "--simple-connect" in the modem object. E.g.: mmcli -m 0 --simple-connect="apn=internet" See https://www.freedesktop.org/software/ModemManager/api/latest/gdbus-org.freedesktop.ModemManager1.Modem.Simple.html#gdbus-method-org-freedesktop-ModemManager1-Modem-Simple.Connect Cheers! -- Aleksander https://aleksander.es ___ ModemManager-devel mailing list ModemManager-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel
Re: [PATCH] telit: use g_assert instead of g_assert_true / g_assert_false
On 12/01/17 07:29, Ben Chan wrote: > `g_assert_true' and `g_assert_false' are defined in glib 2.38 or later. > The minimum glib version currently required by ModemMamanger is 2.36. > While `g_assert_true' and `g_assert_false' may be preferred over the > more generic `g_assert', it seems like overkill to bump the minimum glib > version requirement just for that. When more code in ModemManager later > requires newer versions of glib, we can migrate all existing code to use > `g_assert_true' and `g_assert_false' when appropriate. > --- Thanks, yes, pushed to git master and mm-1-6. > plugins/telit/tests/test-mm-modem-helpers-telit.c | 14 +++--- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/plugins/telit/tests/test-mm-modem-helpers-telit.c > b/plugins/telit/tests/test-mm-modem-helpers-telit.c > index 2da60c11..88a889e6 100644 > --- a/plugins/telit/tests/test-mm-modem-helpers-telit.c > +++ b/plugins/telit/tests/test-mm-modem-helpers-telit.c > @@ -101,9 +101,9 @@ test_mm_bands_contains (void) { > for (i = 0; i < 3; i++) > g_array_append_val (mm_bands, i); > > -g_assert_true (mm_telit_bands_contains (mm_bands, 2)); > -g_assert_true (mm_telit_bands_contains (mm_bands, 2)); > -g_assert_false (mm_telit_bands_contains (mm_bands, 3)); > +g_assert (mm_telit_bands_contains (mm_bands, 2)); > +g_assert (mm_telit_bands_contains (mm_bands, 2)); > +g_assert (!mm_telit_bands_contains (mm_bands, 3)); > > g_array_free (mm_bands, TRUE); > } > @@ -134,7 +134,7 @@ test_parse_band_flag_str (void) { > _flags, > ); > g_assert_no_error (error); > -g_assert_true (res); > +g_assert (res); > > for (j = 0; j < band_flag_test[i].band_flags_len; j++) { > guint ref; > @@ -143,7 +143,7 @@ test_parse_band_flag_str (void) { > ref = band_flag_test[i].band_flags[j]; > cur = g_array_index (band_flags, guint, j); > > -g_assert_true (ref == cur); > +g_assert (ref == cur); > } > > g_array_free (band_flags, TRUE); > @@ -225,7 +225,7 @@ test_parse_supported_bands_response (void) { > , > ); > g_assert_no_error (error); > -g_assert_true (res); > +g_assert (res); > > > for (j = 0; j < supported_band_mapping_tests[i].mm_bands_len; j++) { > @@ -302,7 +302,7 @@ test_parse_current_bands_response (void) { > , > ); > g_assert_no_error (error); > -g_assert_true (res); > +g_assert (res); > > > for (j = 0; j < current_band_mapping_tests[i].mm_bands_len; j++) { > -- Aleksander https://aleksander.es ___ ModemManager-devel mailing list ModemManager-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel