Hi,

On Fri, Jan 24, 2014 at 2:27 PM, Stefan Monnier <[email protected]>wrote:

> >> I'd like to use a Samsung GT-B3740 USB LTE modem together with OpenWRT.
> > To get it to build just add a declaration to
>
> Another option is to compile it directly into your kernel, via
>
>    make kernel_menuconfig
>

This didn't work. Search using "/" showed that the driver should be below
"Device Drivers ->  Network device support -> USB Network Adapters", but I
didn't see the "USB Network Adapters" level.

Nonetheless, adding the declaration worked:


On Fri, Jan 24, 2014 at 9:57 AM, Matti Laakso <[email protected]> wrote:

> To get it to build just add a declaration to
>
> trunk/package/kernel/linux/modules/usb.mk
>
> like this:
>
> define KernelPackage/usb-net-kalmia
>   TITLE:=Samsung Kalmia based LTE USB modem
>   KCONFIG:=CONFIG_USB_NET_KALMIA
>   FILES:=$(LINUX_DIR)/drivers/net/usb/kalmia.ko
>   AUTOLOAD:=$(call AutoProbe,kalmia)
>   $(call AddDepends/usb-net)
> endef
>
> define KernelPackage/usb-net-kalmia/description
>  Kernel support for Samsung Kalmia based LTE USB modem
> endef
>
> $(eval $(call KernelPackage,usb-net-kalmia))
>

I must say I'm impressed how easy that was!

Can we please add this package to the code base? Can you do that or should
I send in a patch for that?

Of course, just the package didn't work immediately. Next to the new
"kmod-usb-net-kalmia" package, the modem also required
"kmod-usb-serial-option". I wasn't sure about "usb-modeswitch", so I added
it as well.

Then the hard part came. According to http://armageddon421.de/?p=165,
getting online with the modem involves three steps:

1. Run the chat script and send some AT commands to the modem e.g., to set
the APN

2. Get an IP address via DHCP on the wwan0 interface

3. "monitor the connection to prevent the serial buffer on the modem from
overflowing"

The third step is tricky. The blog post and also the driver website suggest
to run "minicom -o -D /dev/ttyUSB0" to achieve this. However, this was not
enough in my case. If the connection was idle for more than 15 seconds, the
modem froze and only unplugging it did help. A German review of the device
mentioned the "hang after idle" problem as well:
http://www.amazon.de/review/RU75XCNJIWI3U/ref=cm_cr_pr_cmt?ie=UTF8&ASIN=B004FHW9BWThe
reviewer solved it by running a ping every 10 seconds. Not very
elegant.

Luckily, I found a better solution! I wanted to persist the configuration
and therefore I used the LUCI webinterface. To address the first and the
second step of the connect process, I created two interfaces in the GUI:

a) The first interface is for the "wwan0" device. I've set it to "DHCP
client" such that OpenWRT automatically gets the IP address. But before the
interface comes up, we have to run the chat script first.

b) For the chat script, I set up an "UMTS/GPRS/EV-DO" interface
(/dev/ttyUSB0, APN adjusted).

The modem needs a special chat script, so I replaced the content of
/etc/chatscripts/3g.chat with the one from
http://onny.project-insanity.org/files/chatscript_vodafone.txt and
overwrote the APN with the OpenWRT variable.

And then it worked! OpenWRT uses interface b) to send the AT commands to
the modem and eventually interface a) will come up and provide the
connectivity.

The downside of this approach is that interface b) wants to setup a PPP
connection, but it doesn't succeed with that. Therefore, it keeps retrying
all the time and spams the log of the router. On the plus side, thanks to
the constant polling of the modem device step 3 from above ("monitor the
connection" + "prevent hang after idle by ping") is no longer necessary.
The connection is very stable then.

Some questions about that:
- Are you aware of other UMTS/LTE modems which use the WWAN subsystem and
require a chat script for initialization as well?

- Can you think of a better way to run the chat script while it's still
configurable from the webinterface?

- The PPP error messages in the log are a bit annoying and might confuse
novices. Can you think of an elegant way to solve this problem?

For now, I'd like to make my findings available for others and provide them
an easy way to install OpenWRT and set it up. In the long term, I'd like to
add support for the modem to the OpenWRT codebase such that no
modifications like the replacement of the chat script are necessary and can
be set up from the webinterface instead.

This leads to several questions:
- I'd like to distribute my built image with the "kalmia" kernel package
and the replaced chat script. Are you fine with that? Is there anything I
have to take care of?

- What's the best way to add device-specific chat scripts and support them
in the webinterface?
An easy workaround would be to introduce new service types e.g., the user
would have to specify a custom service type "samsung-gt-b3740". Then, the
3g.sh script could be modified to deal with this type and use the
device-specific chat script. The best solution would be if the webinterface
detects the modem type and automatically takes care of the necessary steps
(install kalmia kernel module, set up both interfaces, use device-specific
chat script). Otherwise, the user always depends on a tutorial.

So much for now.

Best,
Michael
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to