Compiling Recent USB_ModeSwitch


edgex004

Advanced Member
Joined
Jan 5, 2008
Messages
1,222
I am attempting to compile the most recent USB_ModeSwitch, but am coming accross a few issues.

According to the USB Compatibility List on the wiki, back in January, a user named Honselio successfully compiled the version from (http://www.draisberghof.de/usb_modeswitch/). I was hoping to get some advice on the compile process.

1.) I tried compiling/installing using NAND/opkg

Installed through opkg: make, GCC, GCC symlinks, and libusb1.0-dev. Ran "make install", but am stuck with an error about missing pkg-config. I think I need to try pulling the latest pkg-config GIT and compile before I go back to USB_ModeSwitch, as pkg-config is not available through opkg.

2.) I tried "make install" through the C/C++ Dev Tools PND, but am stuck with the following error:


usb_modeswitch.c: 500: warning: implicit declaration of function 'libusb_error_name'
usb_modeswitch.c: 500: warning: format '%s' expects type 'char *', but argument 3 has type 'int'
/tmp/cczil3M4.o: in function 'main':
usb_modeswitch.c:(.test+0x233c): undefined reference to 'libusb_error_name'

Any help here would be appreciated, especially if Honselio is around to let me know what he did in order to make USB_ModeSwitch compile.

EDIT: is the error in method 2.) maybe because I need to install libusb1.0-dev into the Dev Tools PND?
 
Last edited by a moderator:
Installed through opkg: make, GCC, GCC symlinks, and libusb1.0-dev. Ran "make install", but am stuck with an error about missing pkg-config. I think I need to try pulling the latest pkg-config GIT and compile before I go back to USB_ModeSwitch, as pkg-config is not available through opkg.
There is a package named pkgconfig.

/tmp/cczil3M4.o: in function 'main':


usb_modeswitch.c:(.test+0x233c): undefined reference to 'libusb_error_name'
This is because libusb in the firmware is too old. I can try updating it, maybe some time on the weekend.
 
Last edited by a moderator:
Thanks for the help, Notaz! I still wonder how Honselio managed to compile it. Maybe he is running Slackware or Debian and has more up to date libs.

I will try installing pkgconfig and see if I can get my NAND compile to error at the same point as the Dev Tools compile. I am not yet sure how to install USB_ModeSwitch to NAND after compiling with Dev Tools...
 
So here is what I have after installing pkgconfig to NAND:


$ sudo make install
No installed jimsh or tclsh, building local bootstrap jimsh0
No working C compiler found. Tried cc and gcc.
sed 's_!/usr/bin/tclsh_!'"false"'_' < usb_modeswitch.tcl > usb_modeswitch_dispatcher
cc -o usb_modeswitch usb_modeswitch.c -Wall `pkg-config --libs --cflags libusb-1.0`
cc: error trying to exec 'cc1': execvp: No such file or directory
make: *** [usb_modeswitch] Error 1


And then after installing tcl:


$ sudo make install
sed 's_!/usr/bin/tclsh_!'"/usr/bin/tclsh"'_' < usb_modeswitch.tcl > usb_modeswitch_dispatcher
cc -o usb_modeswitch usb_modeswitch.c -Wall `pkg-config --libs --cflags libusb-1.0`
cc: error trying to exec 'cc1': execvp: No such file or directory
make: *** [usb_modeswitch] Error 1


So I think I have a PATH issue? I need to point cc to cc1? Not sure, but I feel like I am close to getting my NAND to the same point as the Dev Tools.
 
Honselio, thats me lol. I can´t remember if i compiled it on pandebian. Have to power up my pandora....
 

Attachments

  • usbmodeswitch.zip
    2.5 MB · Views: 267
Last edited by a moderator:
Got it! I hope...

Over my lunch break I decided to try C/C++ Dev Tools once more with the build folder you provided, hondo.

The newer version, per notaz's suggestion, of libusb that you had in the folder compiled and installed nicely. Was then able to compile your provided source for USB_ModeSwitch.

Then moved on to the most recent version of USB_ModeSwitch that I've been working on. Built and installed without complaint it looks like. Tried calling it manually after quiting the Dev Tools PND and it seemed to run without complaining about any dependancy problems. Will try with the actual USB stick tonight to see if I can get everything to play nice together.

Thanks for you help, notaz and hondo!
 
I can confirm that it works. Managed to switch both my modems and have them recognized. Unfortunately I can't seem to connect with my Huawei E368. Might have something to do with my choice in network. I'm on Cricket, which uses AT&T towers. The At&T software can connect to Cricket on Mac and Windows, but NetworkManager is having trouble with it. I'm getting flakey 2G just fine with my Huawei E1750 (my fault again due to poor frequency choice), so I at least know the Pandora is working as it should.

Just ordered a cheap Huawei E173, and am hoping it will have the frequencies to at least get me some 3G speeds.
 
Back
Top