ZTE ax326 4G Modem Drivers For Linux
Hi, there! Today i will talk about how to successfully setup and run WiMAX 4G network (Internet) using ZTE ax326 Modem on Debian GNU/Linux Operating System.
I have used to test it with MEZON (4G Internet provider in Lithuania), Debian Squeeze on iBook G4 (PPC) and of course the same on the x86/64 platforms.
First of all you will need to be logged as ROOT and install usb-modeswitch package:
root@localhost# apt-get install usb-modeswitchSearch for the line called: "BCSM25-250" and if it does not exist add it after line "LABEL="modeswitch_rules_begin""
root@localhost# nano /lib/udev/rules.d/40-usb_modeswitch.rules
ATTRS{idVendor}=="198f", ATTRS{idProduct}=="bccd", RUN+="usb_modeswitch '%b/%k'"Restart udev by running:
root@localhost# /etc/init.d/udev restart
Please Download this: http://www.mediafire.com/?u49qt95e0et45q2 to /usr/src and unpack it:
root@localhost# tar xjvf mezon_ax326-debian-squeeze.tar.bz2Now we need to compare and install the kernel module but first of all you need to have working compile tools and kernel headers:
root@localhost# apt-get install build-essential kernel-headers
Extract, compile and install kernel module with firmware:
root@localhost# cd mezon_ax326-debian-squeeze/kernel-driver/
root@localhost# tar xjvf zte_ax326_kernel_module.tar.bz2
root@localhost# cd zte_ax326_kernel_module
root@localhost# make&& make install
root@localhost# cd ../../lib/firmware/
root@localhost# cp * /lib/firmware/
root@localhost# echo "drxvi314" >> /etc/modules
Now you need to reboot to windows to extract the certificates from proprietary MEZON drivers.
Then "MEZON CM" Starts and connects to the internet, you need to dump a running process of it, you can do it by downloading process explorer
Then dump the process as shown in this picture
Then you need to download Notepad++ and open "cm.dmp" as you saved it.
Copy all text between (including) these lines:
----BEGIN RSA PRIVATE KEY----
----END RSA PRIVATE KEY----
Seen in these pictures
Open cm.dmp again, select from menu View->Show Symbol->Show All Characters
You can see it in this pic
In the file you need to find: "Modem mac address" ZTE Wimax, you can find your mac address from the main application "MEZON CM" under windows.
After find this line, as shown in the pic
Sixth line upper the text must contain with symbols "0,"
As shown in my pic
There was a 296055 line (in your way it can change).
Erase all content before "0," (more than 170000 lines),
There begins the "DEVICE CERTIFICATE", the file at beginning will look like in this picture
Save the file as cm.cer and open it, it the dialog should appear with your correct modem mac address and ZTE Wimax as shown in picture:
Install the certificate by clicking "Install Certificate"
Then "run" certmgr.msc (WinKey+R). Export certificate using "base 64 encoded x.509" as shown in these pictures:
Save it as device.cer and then rename it as device.pem.
Now lets go to do some fun things in the user space configuration ;-)
root@localhost# cd /usr/src/mezon_ax326-debian-squeeze/user-space
root@localhost# tar xjvf USB_350.tar.bz2
root@localhost# cd USB_350/Source/API
root@localhost# chmod +x build.sh
root@localhost# ./build_linux.sh
root@localhost# cp bin_linux/bin/libxvi020.so* /lib/
root@localhost# cd ../CSCM/ && chmod +x build.sh
root@localhost# ./build.sh pc_linux
root@localhost# cp -v bin_pc_linux/bin/wimax* /usr/local/bin/
root@localhost# cp -v bin_pc_linux/bin/libe* /lib/
root@localhost# cd ../../../../etc/
root@localhost# cp wimaxd.conf /etc/
root@localhost# cp -r mezon /etc/mezon
Also copy your device.pem and private.pem certificates to /etc/mezon and don't forget to copy proprietary windows drivers certificate from /media/Windows/Program Files (x86)/MEZON CM/bin/ca.pem to /etc/mezon/
Edit file /etc/wimaxd.conf and change line:
UserIdentity 'YOURMACADDRESS@mezon.lt'
Put your Modem Mac address before @mezon.lt
root@localhost# apt-get install udhcpc
copy wimax from archive init.d/wimax file to /etc/init.d/
and run:
root@localhost# update-rc.d wimax defaults
reboot and enjoy!
NOTE! You can always run wimaxd as foreground application to view connection status by running:
root@localhost# wimaxd -c /etc/wimaxd.conf -D
or you can restart wimax daemon by running /etc/init.d/wimax restart
If it does not work for some reasons you don't get ip address or address is incorrect you can install dhclient using apt-get and use my other script to start WiMAX.
#!/bin/sh
killall dhclient
killall -9 wimaxd
echo "Unloading previous module..."
rmmod -f drxvi314
echo "Loading WiMAX Kernel module..."
modprobe drxvi314
echo "Loading WiMAX User Space client..."
/usr/local/bin/wimaxd -c /etc/wimaxd.conf
echo "Loading DHCP Daemon..."
dhclient eth1
echo "All done.."
I have tested it on Gentoo and Ubuntu also. Software hacks and patches have been made by myself, other software/sources have licensed on their own licenses. This material provided "AS IS" i will not accept any responsibility for any damage...
If you have a problem you can always post a comment with question!
Happy browsing! ;-)
Hi,
ReplyDeleteI tried building it on Raspbian with 3.6.11+ kernel and after running ./build.sh pc_linux I get 3 SUCCESS and a FAILED on building the wimaxd server.
Are there any dependencies or something else is missing?
2.6.x or 3.6.x ? :-)
ReplyDeleteIt's 3.6.x.
ReplyDeleteGot it working after reading through the beginning of the build.sh script. It lists it's prerequisites and although there aren't any with exact names in apt, I just did a few searches and installed the packages that looked the most relevant. After that it works.
The only thing that's bugging me now is the wimax script (update-rc.d wimax defaults). Update-rc refused it and after modifying the script to have "exit 0" and making it executable, at the end it still doesn't load at startup :)
Use apt-file tool for searching files, and yeah, the init scripts i've used are very buggy :-)
ReplyDeletehey, this is too complicated, i get very confused with the terminal
ReplyDeleteok
ReplyDeletewhen I start
wimaxd -D -c /etc/wimaxd.conf
=============== Received Message Start (2014/09/06 21:11:56.790) ===========
u32State = Waiting for PHY sync start
Network entry response received (Type = 2 - Subtype = 2 - Length = 52)
Network Entry Status Received
Link status = WAIT FOR PHY SYNC CMD
=============== Received Message End (type=2 sub-type=2) ===============
but after , I start client
wimaxc -i
and the server crashes
Got connection 1 from 127.0.0.1
Wcm connection handling thread launched successfully
Socket is 00000006
Client socket 00000006 lock Beceem API: SUCCESS (wait = 0 ms)
SOCKET SEND START:
Segmentation fault (core dumped)
This resource tells us that output should look like this:
Client socket 00000006 lock Beceem API: SUCCESS (wait = 0 ms)
Client socket 00000006 unlock Beceem API: Success
But why segmentation fault? Probably wrong user settings?
maybe something wrong with certificates.
What do you think?
Yes, indeed, for further investigation you can also debug it and watch the backtrace of the process
Delete1. Could you provide an example of your wimaxd.conf
Delete2. When, Where the certificate is generated?
3. Is the certificate for mac address, for wimax login, or for both(wimax login + mac)?