SBC support for 3G usb modem [Solved]

Supporting 2.6 and up
p0ker

SBC support for 3G usb modem [Solved]

Postby p0ker » Mon Jan 18, 2010 3:19 pm

I'm playing around with buildroot right now. Not exactly knowing what I'm doing, but at some point I'll get there. :P

The plan is to get SBC to support 3G USB modem.
I've got a Huawei E1752 USB modem, and the first step is to getting SBC to recognize it as modem, not a mass storage device.

I've just downloaded the source file, and build a image with default settings, and flash the device. This is now working as a charm.

When I plug the 3G unit into SBC, I get the follow statement from /var/log/message

Code: Select all

Jan 18 21:31:29 Pilot user.info kernel: usb 1-1.3: new full speed USB device using s3c2410-ohci and address 5
Jan 18 21:31:29 Pilot user.info kernel: usb 1-1.3: configuration #1 chosen from 1 choice
Jan 18 21:31:29 Pilot user.info kernel: scsi2 : SCSI emulation for USB Mass Storage devices
Jan 18 21:31:29 Pilot user.debug kernel: usb-storage: device found at 5
Jan 18 21:31:29 Pilot user.debug kernel: usb-storage: waiting for device to settle before scanning
Jan 18 21:31:29 Pilot user.info kernel: scsi3 : SCSI emulation for USB Mass Storage devices
Jan 18 21:31:29 Pilot user.debug kernel: usb-storage: device found at 5
Jan 18 21:31:29 Pilot user.debug kernel: usb-storage: waiting for device to settle before scanning
Jan 18 21:31:34 Pilot user.notice kernel: scsi 2:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
Jan 18 21:31:34 Pilot user.notice kernel: scsi 3:0:0:0: Direct-Access     HUAWEI   SD Storage       2.31 PQ: 0 ANSI: 2
Jan 18 21:31:34 Pilot user.debug kernel: usb-storage: device scan complete
Jan 18 21:31:34 Pilot user.debug kernel: usb-storage: device scan complete
Jan 18 21:31:35 Pilot user.notice kernel: sd 3:0:0:0: [sda] Attached SCSI removable disk


In order to get it recognized as a modem, I need to invoke modprobe usbserial with some parameters. But this doesn't work. `usbserial`is not a valid module.

So my first question in many to come is:
Where to active usbserial? Is it kernel, busybox or main menuconfig?

Any pointers in the right direction is appreciated.
Last edited by p0ker on Fri Jan 22, 2010 4:38 pm, edited 1 time in total.

User avatar
Patrick
Lead Developer
Posts: 3165
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: SBC support for 3G usb modem

Postby Patrick » Mon Jan 18, 2010 4:40 pm

usbserial is compiled into the kernel - you'll have to re-configure the kernel to build usbserial as a module in order to send it parameters, because you don't have access to the kernel boot parameters.

You'll also have to make sure whatever serial driver it uses gets compiled in.

We are going to move towards using modules for things like the USB serial drivers, etc. at some point.

-Patrick

p0ker

Re: SBC support for 3G usb modem

Postby p0ker » Tue Jan 19, 2010 2:22 pm

I've recompiled the kernel, with usbserial as module.
But when even I connect the usb dongel it is recognized as mass storage.

lsusb shows the wrong product.

I can invoke modprobe usbserial vendor=0x12d1 product=0x1001
but it doesn't seems to have an effect.

Even if I could get it up and running, I still lack a lot of knowledge around the pppd/chat scenario. And I've been trying to search the web to see if other people has done some like this on a embedded platform.

Is busybox the best place to start? Or straight to buildroot community? Since I don't think this is phidget related.

Any clues? :)

User avatar
Patrick
Lead Developer
Posts: 3165
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: SBC support for 3G usb modem

Postby Patrick » Tue Jan 19, 2010 2:40 pm

probably the buildroot mailing lists are your best bet for the userspace stuff. The kernel stuff will be the same regardless of platform, so any kernel discussions should apply.

-Patrick

p0ker

Re: SBC support for 3G usb modem

Postby p0ker » Tue Jan 19, 2010 3:05 pm

You right about that. Looks like the usb_modeswitch is already committed.
http://lists.busybox.net/pipermail/buil ... 29042.html
Witch bring me one step closer.....

I'll surf away from phidgets as for now, but I'll be back. :)

p0ker

Re: SBC support for 3G usb modem

Postby p0ker » Wed Jan 20, 2010 3:58 pm

Guess how is back! :)

What I've done so fare
Use last build from phidget.com
Add usb_modeswitch (including udev rules for autoswitching)
Tuned kernel to support usb-serial as module,and 3G modems.
Added ppp from packages.

The SBC device now recognizes the modem. PPP is configure correctly with chat script etc. And everything seams to work. But when I connect, it brings up the ppp device, and everything looks normal. I even get a proper ip assign from my ISP. But that's when the fun stops. When ever I try using any network related applications (like ping/wget/ssh) they all goes into segmentation fault.

The fun thing is when I bring down the ppp, the applications works flawless again.

The only hint I found is at uClibc maillist

But it looks like he fixed it by using a static build. I've try flipping the option in the busybox configuration, but didn't work for me.

I've asked around on irc, in the development channels, but not getting any closer to a solution. Any pointers on where to go from here?

User avatar
Patrick
Lead Developer
Posts: 3165
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: SBC support for 3G usb modem

Postby Patrick » Wed Jan 20, 2010 4:56 pm

Looks like the uClibc version of getaddrinfo behaves differently then the glibc version - too bad there is not enough room in PhidgetSBC for glibc (hence our using uClibc). You'll probably have to debug/patch the getaddrinfo function directly. I'm not sure why this would only affect PPPoE, but it shouldn't be too hard to track down...

Edit: here is a thread which should give you some hope: http://lists.busybox.net/pipermail/buil ... 27166.html

-Patrick

p0ker

Re: SBC support for 3G usb modem

Postby p0ker » Thu Jan 21, 2010 1:09 am

That looks promising.
I'm doing a clean compile w/ modifications + this patch. :P

I'll report back when I have some results.

p0ker

Re: SBC support for 3G usb modem

Postby p0ker » Thu Jan 21, 2010 3:44 pm

Hi Patrick,

I've tried patching the getaddrinfo.c, without any luck.

Apparently this patch was made for uClibc-0.9.30.1, and Phidget source uses uClibc-0.9.30.

When I try the patch, I get a complete build, but flashing the SBC it becomes none responding afterwards. (no reply through web/ssh or ping).

I've also tried using the the option "snapshot of uClibc" with `make menuconfig` but then I get a error while building the binary.

I see that the the source provided here on phidgets.com is quite new, is there a reason why it uses the old uClibc? And is there a timeframe on when we can expect a new release with updated uClibc?

User avatar
Patrick
Lead Developer
Posts: 3165
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: SBC support for 3G usb modem

Postby Patrick » Thu Jan 21, 2010 5:07 pm

We're using the older version because it works well, and moving to a newer buildroot always breaks things / requires extensive testing, so we don't do it very often. Also, updating uClibc would break binary compatibility with any user-compiled programs.

I'll try applying this patch myself when I get time, and see what causing the board to not boot properly.

-Patrick


Return to “Linux”

Who is online

Users browsing this forum: No registered users and 2 guests