Re: [OpenWrt-Devel] Support for USB LTE modems Samsung GT-B3730 / GT-B3710 / GT-B3740

2014-02-08 Thread Matti Laakso
 On Fri, Jan 24, 2014 at 9:57 AM, Matti Laakso malaakso at elisanet.fi 
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel 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?

I just sent one.

 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?

Most LTE modems and many 3G modems use the WWAN subsystem, but instead
of AT-commands require the use of some binary protocol, e.g. qmi.
There's some work done regarding that, but it's unfinished:
http://nbd.name/gitweb.cgi?p=uqmi.git;a=summary

 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?

Go ahead, people with that modem are certainly grateful!

 - 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.

I suppose the best way is to add a new protocol, something like WWAN
with AT-commands and integrate it to netifd, which would then handle
reading the configuration and sending the AT-commands without extra scripts.

Matti Laakso
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Support for USB LTE modems Samsung GT-B3730 / GT-B3710 / GT-B3740

2014-01-31 Thread Michael Berlin
Hi,

On Fri, Jan 24, 2014 at 2:27 PM, Stefan Monnier monn...@iro.umontreal.cawrote:

  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 malaa...@elisanet.fi 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=UTF8ASIN=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 

Re: [OpenWrt-Devel] Support for USB LTE modems Samsung GT-B3730 / GT-B3710 / GT-B3740

2014-01-24 Thread Matti Laakso
 Hi there!

 I'd like to use a Samsung GT-B3740 USB LTE modem together with OpenWRT.

 I assume that the modem isn't supported yet by OpenWRT because it requires
 the kalmia kernel module which I couldn't find in the OpenWRT sources.

 The kalmia driver can be found here:
 https://github.com/mkotsbak/Samsung-GT-B3730-linux-driver
 It was written based on reverse engineering efforts of the Samsung driver
 for Windows.

 It looks like the kalmia driver is part of the Linux kernel since version
 3.0. It uses the WWAN subsystem to establish a connection.

 If you think the modem should already be supported, how should I test this
 / which OpenWRT version should I use? I have a TP-Link TL-WR1043ND
 available to get the modem up and running.

 If it isn't supported yet: Can you please help me to add support for it to
 OpenWRT?

 Please tell me if this isn't the right mailing list to discuss such things.

 Thank you!
 Michael

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))

Then you probably need to send some AT commands to the modem through a
/dev/ttyUSB-node and use dhcp as protocol for the interface.

--
Matti Laakso
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Support for USB LTE modems Samsung GT-B3730 / GT-B3710 / GT-B3740

2014-01-24 Thread Stefan Monnier
 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


-- Stefan
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Support for USB LTE modems Samsung GT-B3730 / GT-B3710 / GT-B3740

2014-01-23 Thread Michael Berlin
Hi there!

I'd like to use a Samsung GT-B3740 USB LTE modem together with OpenWRT.

I assume that the modem isn't supported yet by OpenWRT because it requires
the kalmia kernel module which I couldn't find in the OpenWRT sources.

The kalmia driver can be found here:
https://github.com/mkotsbak/Samsung-GT-B3730-linux-driver
It was written based on reverse engineering efforts of the Samsung driver
for Windows.

It looks like the kalmia driver is part of the Linux kernel since version
3.0. It uses the WWAN subsystem to establish a connection.

If you think the modem should already be supported, how should I test this
/ which OpenWRT version should I use? I have a TP-Link TL-WR1043ND
available to get the modem up and running.

If it isn't supported yet: Can you please help me to add support for it to
OpenWRT?

Please tell me if this isn't the right mailing list to discuss such things.

Thank you!
Michael
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel