huawei 1552 3g Modem

Issues related to configuring your network
pjharper
Posts: 8
Joined: 2010/06/17 08:11:53

huawei 1552 3g Modem

Post by pjharper » 2010/06/17 08:18:29

How can I connect a Huawei 1552 3G Modem with CentOS 5.5?

http://my.opera.com/pualsa/blog/2010/05/06/how-to-install-huawei-e1552

I have tried the above but with no success. The device is staying in Storage Mode instead of Modem mode.

With Debian it works like this:

http://itstuff.the-zabala.net/2009/07/workaround-for-huawei-e1552-and-ubuntu.html

Also I get a message:

run _program;exec of program ' /lib/udev/modem-modeswitch' failed

Any ideas?

Edit More info:

[root@localhost wvdial]# cd usb-modeswitch-1.1.2
[root@localhost usb-modeswitch-1.1.2]# make install
install -d /usr/sbin
install --mode=755 usb_modeswitch /usr/sbin/usb_modeswitch
install --mode=755 usb_modeswitch.tcl /lib/udev/usb_modeswitch
install --mode=644 usb_modeswitch.conf /etc/usb_modeswitch.conf
install --mode=644 usb_modeswitch.1 /usr/share/man/man1/usb_modeswitch.1
[root@localhost usb-modeswitch-1.1.2]# cd ..
[root@localhost wvdial]# cd usb-modeswitch-data-20100418
[root@localhost usb-modeswitch-data-20100418]# ls
40-usb_modeswitch.rules ChangeLog COPYING Makefile README usb_modeswitch.d
[root@localhost usb-modeswitch-data-20100418]# make install
install -d /etc/usb_modeswitch.d
install --mode=644 -t /etc/usb_modeswitch.d ./usb_modeswitch.d/*
install: cannot stat `./usb_modeswitch.d/*': No such file or directory
make: *** [files-install] Error 1
[root@localhost usb-modeswitch-data-20100418]# nano Makefile
[root@localhost usb-modeswitch-data-20100418]# make install
install -d /etc/usb_modeswitch.d
install --mode=644 -t /etc/usb_modeswitch.d /etc/usb_modeswitch.d/*
install: cannot stat `/etc/usb_modeswitch.d/*': No such file or directory
make: *** [files-install] Error 1
[root@localhost usb-modeswitch-data-20100418]# nano Makefile
[root@localhost usb-modeswitch-data-20100418]# cd /etc/usb_modeswitch.d/
[root@localhost usb_modeswitch.d]#

fscalioni
Posts: 4
Joined: 2010/06/17 12:06:30

Re: huawei 1552 3g Modem

Post by fscalioni » 2010/06/17 12:17:06

You can install the usb_modeswitch that is in the repositories ([url=ftp://ftp.pbone.net/mirror/rpms.arrfab.net/centos/testing/i386/usb_modeswitch/usb_modeswitch-0.9.7-1.el5.test.i386.rpm]usb_modeswitch-0.9.7-1.el5.test[/url]), it doesn't have all the automatic options from 1.1.2 but also works quite well.

The major problem with this tutorial you linked is that the author used ATTRS instead of SYSFS in the rules file, but the udev version of CentOS is a little bit old and doesn't recognize ATTRS. If you change it to SYSFS it will work.

I have a "model" rules file for 3G modems, I was developing a module for my company's system, this is for Huawei E1756:

[code]
ACTION!="add", GOTO="Huawei_End"

SUBSYSTEM=="usb", SYSFS{idProduct}=="1446",
SYSFS{idVendor}=="12d1", GOTO="Huawei_ZeroCD"

SUBSYSTEM=="usb", SYSFS{idProduct}=="140c",
SYSFS{idVendor}=="12d1", GOTO="Huawei_Modem"

LABEL="Huawei_ZeroCD"
RUN+="/usr/sbin/usb_modeswitch -d 1 -v 0x12d1 -p 0x1446 -V 0x12d1 -P 0x140c"

LABEL="Huawei_Modem"
RUN+="/sbin/modprobe usbserial vendor=0x12d1 product=0x140c",
MODE="660", GROUP="tty"

LABEL="Huawei_End"
[/code]
Accordingly to the site you sent, your modem has the Product ID 141b, so the rules file for your modem would be like this:

[code]
ACTION!="add", GOTO="Huawei_End"

SUBSYSTEM=="usb", SYSFS{idProduct}=="1446",
SYSFS{idVendor}=="12d1", GOTO="Huawei_ZeroCD"

SUBSYSTEM=="usb", SYSFS{idProduct}=="141b",
SYSFS{idVendor}=="12d1", GOTO="Huawei_Modem"

LABEL="Huawei_ZeroCD"
RUN+="/usr/sbin/usb_modeswitch -d 1 -v 0x12d1 -p 0x1446 -V 0x12d1 -P 0x141b"

LABEL="Huawei_Modem"
RUN+="/sbin/modprobe usbserial vendor=0x12d1 product=0x141bc",
MODE="660", GROUP="tty"

LABEL="Huawei_End"
[/code]
Try it out and let me know if it worked! If it does, I may add it to my module! ;-)

pjharper
Posts: 8
Joined: 2010/06/17 08:11:53

Re: huawei 1552 3g Modem

Post by pjharper » 2010/06/17 16:36:25

Thanks for your help. I tried your file did not work.

I followed this guy and got:

http://www.ahmedsoliman.com/2009/07/12/etisalat-usb-modem-on-fedora-11/

[root@localhost ~]# lsusb
'Bus 004 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 001 Device 003: ID 12d1:1446 Huawei Technologies Co., Ltd.
Bus 001 Device 001: ID 0000:0000
Bus 001 Device 002: ID 0c45:62c0 Microdia Sonix USB 2.0 Camera
Bus 005 Device 001: ID 0000:0000
[root@localhost ~]# usb_modeswitch

* usb_modeswitch: tool for controlling "flip flop" mode USB devices
* Version 0.9.7 (C) Josua Dietze 2009
* Works with libusb 0.1.12 and probably other versions

Looking for default devices ...
Found default devices (1)
Prepare switching, accessing device 003 on bus 001 ...
Looking for active driver ...
OK, driver found ("usb-storage")
OK, driver "usb-storage" detached
Setting up communication with interface 0 ...
Trying to send the message to endpoint 0x01 ...
OK, message successfully sent
-> Run lsusb to note any changes. Bye

[root@localhost ~]# lsusb
Bus 004 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 001 Device 004: ID 12d1:140c Huawei Technologies Co., Ltd.
Bus 001 Device 001: ID 0000:0000
Bus 001 Device 002: ID 0c45:62c0 Microdia Sonix USB 2.0 Camera
Bus 005 Device 001: ID 0000:0000
[root@localhost ~]#



It does not last between boots though. It's late so will try again in the morning.

Thanks.

chuina
Posts: 355
Joined: 2009/12/11 10:25:56

Re: huawei 1552 3g Modem

Post by chuina » 2010/06/17 22:00:08

Welcome to CentOS, both of you.;-)


[quote]pjharper wrote:
.....I followed this guy and got:....[/quote]
You could ask there for using it in CentOS 5.People there seem to work it with fedora.

What shows by these:

[code]grep -i 12d1 /lib/modules/*/modules.alias | grep -i 1446
grep -i 12d1 /lib/modules/*/modules.alias | grep -i 140c[/code]

pjharper
Posts: 8
Joined: 2010/06/17 08:11:53

Re: huawei 1552 3g Modem

Post by pjharper » 2010/06/17 23:56:47

Thanks again for reply.

[root@localhost ~]# grep -i 12d1 /lib/modules/*/modules.alias | grep -i 1446
[root@localhost ~]# grep -i 12d1 /lib/modules/*/modules.alias | grep -i 140c
[root@localhost ~]#

abednegoyulo
Posts: 550
Joined: 2007/12/26 06:24:38
Location: 127.0.0.2 44013

Re: huawei 1552 3g Modem

Post by abednegoyulo » 2010/06/18 03:20:47

[d]I see, thanks to Alan, that the driver for the modem is available in the driver [i]option[/i] of the 2.6.27.9 kernel.[/d]
[d]I would recommend a Request For Enhancement on the current driver [i]option[/i] in the [url=http://elrepo.org/bugs/main_page.php]ElRepo Bug Tracker[/url].[/d]
[d][url=http://elrepo.org/tiki/FAQ]ElRepo's FAQ[/url] may help you in extracting/submitting the right info of your device.[/d]

Edit: Sorry, 12d1:140c is already available in ElRepo's [url=http://elrepo.org/tiki/kmod-option]kmod-option[/url]. The only thing left to do is install the package and find the appropriate wvdial configuration for your device and ISP.

pjharper
Posts: 8
Joined: 2010/06/17 08:11:53

Re: huawei 1552 3g Modem

Post by pjharper » 2010/06/21 09:20:01

For a 64 Bit server which is the best usb_modswitch to use with Centos 5.5.

http://rpm.pbone.net/index.php3/stat/3/srodzaj/1/search/config(usb_modeswitch)

There seems to be only a 32 Bit for CentOS. Would one of the Fedora rpm's work or do we need to compile?

abednegoyulo
Posts: 550
Joined: 2007/12/26 06:24:38
Location: 127.0.0.2 44013

Re: huawei 1552 3g Modem

Post by abednegoyulo » 2010/06/21 10:37:21

[quote]
pjharper wrote:
[root@localhost ~]# lsusb
Bus 004 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 001 Device 004: ID 12d1:140c Huawei Technologies Co., Ltd.
Bus 001 Device 001: ID 0000:0000
Bus 001 Device 002: ID 0c45:62c0 Microdia Sonix USB 2.0 Camera
Bus 005 Device 001: ID 0000:0000
[/quote]

Your usb_modswitch is working fine.

[quote]
pjharper wrote:
It does not last between boots though. It's late so will try again in the morning.
[/quote]

If you want it to be a modem after a reboot, you might want to consider reading http://www.centos.org/docs/5/html/Installation_Guide-en-US/s1-boot-init-shutdown-run-boot.html

What I have is

[code]
$ rpm -q usb_modeswitch
usb_modeswitch-1.0.5-1
[/code]

[code]
$ rpm -ql usb_modeswitch
/etc/usb_modeswitch.conf
/usr/sbin/usb_modeswitch
[/code]
I can give you my spec file but I haven't tested it against the current version. I'll give it a try if it still builds. If it does, I'll give it to you so that you can create your own rpm package.

For now, you must install [url=http://elrepo.org/tiki/kmod-option]kmod-option[/url] so that you can test your device. My experience with my usb modem is that the configuration much more frustrating than all of the other steps in getting it to work.

abednegoyulo
Posts: 550
Joined: 2007/12/26 06:24:38
Location: 127.0.0.2 44013

Re: huawei 1552 3g Modem

Post by abednegoyulo » 2010/06/21 11:17:26

I tested my spec file and it didn't build. I assume that its just because of some naming problem. Since I have liberty of fiddling around, I tried rebuilding the src.rpm package from [url=http://download.fedora.redhat.com/pub/fedora/linux/updates/13/SRPMS/]fc13 repo[/url] but it didn't. I extracted the spec file then tried building it against the bz2 package that is available from [url=http://www.draisberghof.de/usb_modeswitch/]draisberghof[/url] and it builds! Now this really puzzles me, why did the src.rpm package failed and the bz2 succeeded even though they are using the same spec file. You can try out the path that I took.

Before you proceed with the steps below, I suggest you follow [url=http://wiki.centos.org/HowTos/SetupRpmBuildEnvironment]creating the build environment[/url]

1. Download the [url=http://download.fedora.redhat.com/pub/fedora/linux/updates/13/SRPMS/usb_modeswitch-1.1.2-3.fc13.src.rpm]src rpm[/url] from fc13 repo
2. Extract the spec file and put it in rpmbuild/SPECS
3. Download usb-modeswitch-1.1.2.tar.bz2 and put it in rpmbuild/SOURCES
4. In the rpmbuild directory execute (execute this using a non-root user)
[code]
rpmbuild -ba SPECS/usb_modeswitch.spec
[/code]

pjharper
Posts: 8
Joined: 2010/06/17 08:11:53

Re: huawei 1552 3g Modem

Post by pjharper » 2010/06/22 06:51:13

Trying the SpecFile on the 64 Bit Server (Something is Missing.):

[code]
[root@localhost rpmbuild]# rpmbuild -ba /root/rpmbuild/SPECS/usb_modeswitch.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.82041
+ umask 022
+ cd /root/rpmbuild/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /root/rpmbuild/BUILD
+ rm -rf usb-modeswitch-1.1.3
+ /usr/bin/bzip2 -dc /root/rpmbuild/SOURCES/usb-modeswitch-1.1.3.tar.bz2
+ tar -xf -
tar: Read 5632 bytes from -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd usb-modeswitch-1.1.3
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chown -Rhf root .
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chgrp -Rhf root .
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.82041
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd usb-modeswitch-1.1.3
+ LANG=C
+ export LANG
+ unset DISPLAY
+ CFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'
+ make -j4
gcc -o usb_modeswitch usb_modeswitch.c -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wall -l usb
usb_modeswitch.c: In function 'search_devices':
usb_modeswitch.c:1151: warning: 'listcopy' may be used uninitialized in this function
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.85787
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd usb-modeswitch-1.1.3
+ LANG=C
+ export LANG
+ unset DISPLAY
+ rm -rf /var/tmp/usb_modeswitch-1.1.3-3-root-root
+ mkdir -p /var/tmp/usb_modeswitch-1.1.3-3-root-root/lib/udev/rules.d/
+ mkdir -p /var/tmp/usb_modeswitch-1.1.3-3-root-root/usr/sbin
+ mkdir -p /var/tmp/usb_modeswitch-1.1.3-3-root-root/usr/share/man/man1
+ mkdir -p /var/tmp/usb_modeswitch-1.1.3-3-root-root/etc
+ install -p -m 755 usb_modeswitch /var/tmp/usb_modeswitch-1.1.3-3-root-root/usr/sbin/
+ install -p -m 644 usb_modeswitch.conf /var/tmp/usb_modeswitch-1.1.3-3-root-root/etc/
+ install -p -m 644 usb_modeswitch.setup /var/tmp/usb_modeswitch-1.1.3-3-root-root/etc/
install: cannot stat `usb_modeswitch.setup': No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.85787 (%install)


RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.85787 (%install)
[root@localhost rpmbuild]#
[/code]
What next.

Post Reply

Return to “CentOS 5 - Networking Support”