Samsung GI-B3740 support in Modem-manager?

Aleksander Morgado aleksander at aleksander.es
Wed Oct 22 23:36:54 PDT 2014


On Thu, Oct 23, 2014 at 1:01 AM, Oskar Enoksson <enok at lysator.liu.se> wrote:
> Thanks for your answer Marius, and thanks for the kalmia-driver in
> Linux-kernel.
>
> I was planning to use this B3740 stick for my OpenSuse laptop, and if
> that worked I could perhaps try to make it work on my Netgear WNR3500L
> Mips based router running "shibby tomato" Linux 2.6, and possibly a
> Raspberry pi project.
>
> I'm still stuck at getting things working on my laptop though. The
> kalmia driver that came with OpenSuse 13.1 seems to work with B3740.
> Udev also triggers a usb_modeswitch to the same USB vendor:product as
> B3730. So far so good:
>
> #:~/> lsusb
> Bus 002 Device 005: ID 04e8:6889 Samsung Electronics Co., Ltd GT-B3730
> Composite LTE device (Commercial)
> Bus 007 Device 002: ID 0b97:7761 O2 Micro, Inc. Oz776 1.1 Hub
> Bus 007 Device 003: ID 0483:2016 STMicroelectronics Fingerprint Reader
> Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
> Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
> Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
> Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
> Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
> Bus 007 Device 004: ID 0b97:7772 O2 Micro, Inc. OZ776 CCID Smartcard Reader
>
> #:~/> lsmod | grep 'option\|kalmia'
> option                 42468  0
> usb_wwan               20380  1 option
> usbserial              44667  2 option,usb_wwan
> kalmia                 13464  0
> usbnet                 43621  1 kalmia
>
> For some reason the network interface created by kalmia.ko is not named
> wwan0, but something like wwp0s29f7u4:
>
> #:~/> ifconfig -a
> wwp0s29f7 Link encap:Ethernet  HWaddr 78:47:1D:39:73:AC
>           BROADCAST MULTICAST  MTU:1380  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
>
> ModemManager 1.0.0 (which is used in OpenSuse 13.1) then tries to load
> the "generic" plugin, which fails.
>
> I downloaded the sourcecode for ModemManager 1.4.0 and created a new
> "kalmia"-plugin by looking into the documentation for ModemManager, on a
> chat-script for B3740 I found on the webb, and on the sourcecodes of the
> other existing ModemManager plugins. I didn't derive my plugin from
> Icera, instead I derived it directly from MMPlugin and MMBroadbandModem.
>
> After lots of trial-and-error the plugin now comes pretty far. Problem
> is I'm really not good at AT-commands, nor at how 4G  connection is
> supposed to work. Is a pppd supposed to start on the wwan interface?
> Should I do something in the ModemManager-plugin to make that happen?
> Must I implement any "unsolicited events" handlers, or is that not
> necessary?
>
> Another problem is that this modem locks up if it is left idle for even
> just a few seconds (all communication to ttyUSB? times out after that).
> The only remedy I found is usb_modeswitch -R reset or stick
> removal+reinsert.
>
> Attached is the output from ModemManager 1.4.0 with "kalmia"-plugin.
> Perhaps someone can see what's missing?


That's a good one, you got it pretty far.

As you have a WWAN port, you shouldn't be using an ATD# call to
connect the modem; as that would likely imply you're using PPP on the
serial port. You'll need to:
 * Understand which AT command is needed in your case to get the modem
connected.
 * Create a MMBroadbandBearerKalmia object, implementing the 3GPP
connection sequence including the specific connection/disconnection
commands for the modem.
 * Once the connection launched in the bearer, the bearer should
likely configure 'DHCP' in the connection type property in the bearer,
so that NetworkManager can launch a DHCP client in the WWAN port. Or,
if you know how to query the modem for the IP settings to use, expose
that info in the bearer properties and set STATIC as connection type
for NetworkManager.

I've also seen some additional unsolicited messages that you should
try to process (or explicitly configure them to get ignored
otherwise); e.g. +MODECHANGEIND or +ACTIVERATIND.

The connection command may just be AT+CGATT (e.g. = 1, being 1 the PDP
context that you just configured with your APN), according to this
sequence from Marius:
https://github.com/mkotsbak/Samsung-GT-B3730-linux-driver/blob/master/chatscript.txt


-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list