Ubuntu – How to solve the problem of the installation huawei modem e303c in ubuntu 13.04

huaweiinstallationmobile-broadbandusb-modem

I am trying to install huawei modem software. But it is not being installed. It is showing like this:

bhaskar@bhaskar:~$ cd Desktop/driver
bhaskar@bhaskar:~/Desktop/driver$ sudo ./install
old path =/usr/local/Mobile_Partner/driver
FATAL: Module option is in use.
DRIVER COPY START
STA_PATH_FLAG=.
STA_PATH_FULL=/home/bhaskar/Desktop/driver/install
START_PATH_DRIVER=/home/bhaskar/Desktop/driver
CURRENT install from ./install
INSTALL_PATH is not set ,auto install
INSTALL_PATH=/usr/local/Mobile_Partner
INSTALL_PATH is another path
rm /usr/local/Mobile_Partner/driver
DRIVER COPY END
ls: cannot access /etc/usb_modeswitch.d/: No such file or directory
/usr/local/Mobile_Partner/driver/ndis_driver
Error: missing module or filename.
libkmod: ERROR ../libkmod/libkmod-module.c:753 kmod_module_remove_module: could not remove 'cdc_ether': No such file or directory
Error: could not remove module cdc_ether: No such file or directory
libkmod: ERROR ../libkmod/libkmod-module.c:753 kmod_module_remove_module: could not remove 'usbnet': Resource temporarily unavailable
Error: could not remove module usbnet: Resource temporarily unavailable
libkmod: ERROR ../libkmod/libkmod-module.c:753 kmod_module_remove_module: could not remove 'hw_cdc_driver': No such file or directory
Error: could not remove module hw_cdc_driver: No such file or directory
make -C src/ clean
make[1]: Entering directory `/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src'
rm -rf *.o *.ko *~ core* .dep* .*.d .*.cmd *.mod.c *.a *.s .*.flags .tmp_versions Module.symvers Modules.symvers *.order
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/add_header.sh  "clean" "/lib/modules/3.8.0-19-generic/build/include/linux/usb"
rmmod -f hw_cdc_driver
libkmod: ERROR ../libkmod/libkmod-module.c:753 kmod_module_remove_module: could not remove 'hw_cdc_driver': No such file or directory
Error: could not remove module hw_cdc_driver: No such file or directory
make[1]: *** [clean] Error 1
make[1]: Leaving directory `/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src'
make: *** [clean] Error 2
make -C src/ modules
make[1]: Entering directory `/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src'
#/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/add_header.sh  "modules" "/lib/modules/3.8.0-19-generic/build/include/linux/usb"
make -C /lib/modules/3.8.0-19-generic/build SUBDIRS=/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src modules
make[2]: Entering directory `/usr/src/linux-headers-3.8.0-19-generic'
  CC [M]  /usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.o
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c: In function ‘__check_ncm_prefer_32’:
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c:113:1: warning: return from incompatible pointer type [enabled by default]
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c: In function ‘__check_ncm_prefer_crc’:
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c:116:1: warning: return from incompatible pointer type [enabled by default]
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c: In function ‘__check_rt_debug’:
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c:128:1: warning: return from incompatible pointer type [enabled by default]
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c: In function ‘hw_change_mtu’:
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c:899:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ [-Wformat]
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c: In function ‘rx_tlp_parse’:
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c:1085:7: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c: In function ‘tx_complete’:
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c:1663:5: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ [-Wformat]
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c: In function ‘cdc_ncm_config’:
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c:2036:24: warning: comparison of distinct pointer types lacks a cast [enabled by default]
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c:2037:3: warning: comparison of distinct pointer types lacks a cast [enabled by default]
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c:2037:3: warning: comparison of distinct pointer types lacks a cast [enabled by default]
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c:2041:21: warning: comparison of distinct pointer types lacks a cast [enabled by default]
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c:2057:3: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ [-Wformat]
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c: In function ‘hw_cdc_probe’:
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c:2589:3: error: implicit declaration of function ‘dbg’ [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[3]: *** [/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.o] Error 1
make[2]: *** [_module_/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src] Error 2
make[2]: Leaving directory `/usr/src/linux-headers-3.8.0-19-generic'
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src'
make: *** [modules] Error 2
make -C src/ install
make[1]: Entering directory `/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src'
#install -m 744 -c hw_cdc_driver.o /lib/modules/3.8.0-19-generic/kernel/drivers/usb/net
#depmod -a
#modprobe hw_cdc_driver
/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/add_header.sh  "install"
modprobe hw_cdc_driver
FATAL: Module hw_cdc_driver not found.
make[1]: *** [install] Error 1
make[1]: Leaving directory `/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src'
make: *** [install] Error 2

Install NDIS driver failed.
The compiling environment is not all ready.
Please check gcc, make and kernel buid(/lib/modules/3.8.0-19-generic/build) to be all installed?
Now please enter any key to finish other installations.
lNDIS is disabled, and only Modem can be used.
TARGET_PATH = 
TARGET_PATH = 
have usb_modeswitch rules to HUAWEI DataCard: COUNT=0
ADDRUNLEVEL=/etc/rc4.d
‘/etc/rc4.d/S99runhwactivator’ -> ‘/etc/init.d/runhwactivator’
‘/etc/rc4.d/K10runhwactivator’ -> ‘/etc/init.d/runhwactivator’
ADDRUNLEVEL=/etc/rc5.d
‘/etc/rc5.d/S99runhwactivator’ -> ‘/etc/init.d/runhwactivator’
‘/etc/rc5.d/K10runhwactivator’ -> ‘/etc/init.d/runhwactivator’
ADDRUNLEVEL=/etc/rc2.d
‘/etc/rc2.d/S99runhwactivator’ -> ‘/etc/init.d/runhwactivator’
‘/etc/rc2.d/K10runhwactivator’ -> ‘/etc/init.d/runhwactivator’
ADDRUNLEVEL=/etc/rc3.d
‘/etc/rc3.d/S99runhwactivator’ -> ‘/etc/init.d/runhwactivator’
‘/etc/rc3.d/K10runhwactivator’ -> ‘/etc/init.d/runhwactivator’
bhaskar@bhaskar:~/Desktop/driver$ 

Please tell me how I can solve this problem. I have tried with Mobile Partner software other versions.. The problem is the same for all.

With thanks,
Bhaskar

Best Answer

The problem is here:

/usr/local/Mobile_Partner/driver/ndis_driver/ndis_src/src/hw_cdc_driver.c:2589:3: error: implicit declaration of function ‘dbg’ [-Werror=implicit-function-declaration]

I had a similar problem with another Huawei modem driver, and I fixed the source code.

First, let's find out where the hw_cdc_driver.c file is. Run the file command on all the files in the ~/Desktop/driver directory:

file *

You'll see some of them are "7-zip archive data" files. Run 7z l on each of them, to see the contents:

7z l data.bin

Maybe there are too many files, so you can just grep for the one you are looking for:

7z l data.bin | grep hw_cdc_driver.c

If you find it, then you need to extract the archive.

mkdir data_bin
mv data.bin data_bin
cd data_bin
7z x data.bin
rm data.bin

Now you have the contents of the archive in the data_bin directory. Search for the hw_cdc_driver.c file, open it, and go to line 2589 (the one from the error). You can just comment that line containing dbg (add a // in front of it) and save then close the file.

To pack the archive with the modified file, use 7z again:

cd data_bin
7z a data.bin data_bin
mv data.bin ..

Now you have replaced data.bin with the fixed file. Try to install again.