Patching u3g for XS Stick (pfSense on FreeBSD8.3) - Solved
-
Hi Volks :)
Im want to use the following 3G USB Modem with pfSense:
idVendor = 0x1c9e (Longcheer )
idProduct = 0x9603 (Mobilcom w14)which is beeing sold in germany as "XS STICK W14"
after digging through the docs i found out that i need to upgrade (or patch)
u3g to a more recent version.The modem is supported with this patch:
http://git.ceid.upatras.gr/fbsd/head/commit/6c768debb361a2eee10c4382744a844a52df6fccIm new to Freebsd and pfSense, so maybe theres an easy way to upgrade u3g in pfsense other then using a custom image ?
Thank you for your help - Tho
–--SnipSnip-----
Meanwhile answered by myself - No - and for good reasons.
So i followed the pfSense Bootstrap Instrutions fromcvs.pfsense.org/~sullrich/pfSenseDevBuilder/pfSense.ova
which will (hopefully) result in a working RELENG_8_3 & pfSense Kombo.
The Article above is really easy to follow and i can fully recommend it, even for average users.
So, im at Stage 4.4 in the World Build Phase, waiting and holding my thumbs :) …..---NextDay----
Finished the Build.
Had some PHP Problems during the iso creation process, but everything is fine now.
(where rc.php.setup wont write the phpextensions)But lbnl - pfsense is booting now on FreeBSD8.3 for me - see attachment :)
going to test the installation now !!

 -
I finished testing the Installation and can report that beside some little problems with clog, the Installation is running stable (but off load) for at least two days now.
off load, because im too stupid to get my modem up and running (again).
U3g works fine, the modem is (after modeswitching) responding to attention commands, but will only dial, when it was initialised too with its Windows App :(Anyway, it runs perfectly with Gnome Net/modemmanager, so i looked at the init Commands there to see what else has to be done. It uses a state machine to establish a connection with over 20 AT commands… im a bit unhappy.
Tried mr Frankenbergers config but had no success.
http://linux.frankenberger.at/Huawei_E220_V1.html
He is using chat scripts with a simple delay to get around the need for case switching when the modem has to choose another Network type.later on then, i tried with the nm at commands which i fetched from the gnome mm.
At least now im getting to the point where some LCP nego is happening. (which stops for no specific reason at some point…)Now i really think about installing the freebsd DBUS and MODEMManager Ports but have security concerns...
- Anyone has an opinion on this....?
hanD, Tho
-
Have you tried using usb_modeswitch (freebsd port) in pfSense 2.0.1?
Seems to have the required switching code:
######################################################## # MobiData MBD-200HU (aka 4G XS Stick W10/W14, aka Micromax MMX 300G, # aka ChinaBird CBCPL68) # # Contributor: Chris DefaultVendor= 0x1c9e DefaultProduct= 0xf000 TargetVendor= 0x1c9e TargetProduct= 0x9603 MessageContent="55534243123456788000000080000606f50402527000000000000000000000"
Though from your data the modem is already in the target mode.
Steve
-
Hi Steve -
thank you for helping - will try modeswitch now, just to be sure having tried all options before i buy a globetrotter.
I think the problem is the modem firmw. which has to be initializised with variable commands like AT+CMER=3,0,0,1 ; AT+CNMI=2,1,2,1,0 and others before it does whats expected. I further recognized that modemmanager is a linuxism because of its udev dependency and there is no freebsd port of it. (yet) :(so, maybe this device is just a bad example of some proprietary crap, i think.
But as usual - it was at least worth the cool experience of seeing pfSense on Freebsd 8.3 :) -
Many of these '4G' modems can be brought up as either a standard modem, that responds to dial-up etc, or as a usb ethernet device, no need to use any AT commands. You might investigate that.
Steve
-
Hi Steve, Ethernet mode would be a great solution but actually the case for this device is that it supports only the more or less hayes compatible modem mode, you described.
But first for our modeswitch topic - its funny - as soon as u3g takes responsibility for the device, it automatically switches itself from mass storage to modem mode, (even when not in a VM env) so no need for manual modeswitchng in this case.
Im quite sure it needs more special init commands with params depending on dynamically acquired information, gathered before by at? commands.
(Modemmanager does this like this.) one can try to emulate this more or less with shell scripts (for easy cases like in mr Frankenbergers Huaway example) and may be succesful, if its known how to respond accurate to the dev.But as usual such Information is not very easy to aquire. Most of the time normal "small" folks like we are dont get such information from the companys that produce such cheap home gadgets.(maybe this is different if you have a big corp behind you)
So, in this case, it may be better trying to port modemmanager to devd or at leas reverse the meaning of the commands in the mm plugin. I have thought and even will look into this one, but it may be beyond my skills to archive that.
So far im diggin through the source of the loncheer plugin and try to reverseeng the meanings of the init commands.
AT+MODODR? for example means
switch (mododr) {
case 1:
mode = MM_MODEM_GSM_ALLOWED_MODE_3G_ONLY;
break;
case 2:
#thorstenK: not documented in plugin source, reasonable meaning from windows client: automatically selected, see pic in attachment.
case 4:
mode = MM_MODEM_GSM_ALLOWED_MODE_3G_PREFERRED;
break;
case 3:
mode = MM_MODEM_GSM_ALLOWED_MODE_2G_ONLY;and so on.
But for me as a networking guy it would be for sure the best solution to just buy a freebsd supported stick and use that.
-
… To be even more off topic now ... I will note the progress of understanding those initcommands here.
so maybe another guy with a problem like this has it a bit easier....General information:
modem-base.c ITU-T Recommendation T.32
AT+GMR Product revision
AT+GMM Product model
AT+GMI Product Manufractor
ATI(x) GeneralInformation (hayes)
ATE Echo 1 0 (command echo hayes)
AT+GSN Product SerialBut those ones were prefered by modemmanager: (same but defined in ITU-T Recommendation V.250)
AT+CGSN Product Ser.
AT+CGMR C-Revision
AT+CGMM C-Model
AT+CGMI C-Manufractor
AT+CRSM=176,28589,0,0,4 Get Administrative Date
AT+CRSM=176,28486,0,0,17 Get Service Provider Name
AT+CIMI IMEI
AT+CIND indicators like smsFULL
AT+CGDCONT=? Get allowed cid Range for APNs
AT+CPIN= Send Pin ,newpin
AT+CSQ Signal quality 2...30 -109... -53 dBm
AT+CGAP Capabilities
Polling and steeringas modem response AT+CREG Network registration information.
AT+CREG?
Note in Source - Some modems send CREGs from themselfs and dont like when polling them manually
This command open and close serial ports on the modem-.
AT+CREG=(1,2) Enable notification for Ports 1/2
AT+COPS Register to Network umts / egprs ...
AT+CMER=3,0,0,1 Enable CMER on secondary port
AT+CPMS=ME SMS Storage location
AT+CNMI=2,1,2,1,0 Enable SMS Notification
AT+CUSD=1 Enable CUSD Notification (unstructured supplementary Service)
AT+CMEE=1 Initialize SIM (sounds good)!
AT+CNUM PhonenumberStop - found a reference to some Standard in the source called
3GPP TS 27.007 (9.1)
woooh... stopping now... and trying to play around abit....PS: These are proprietary:
AT+PSRAT NetworkType (HSDPA...)
AT+MODODR Allowed Technologies (2G,3G,Auto)......SnipSnap......surfing with lynx is quite strange....:=)
-
It wooorks
:-* and i have to rewrite, because i deleted the post wt lynx :(
So - i found out, how to handle it. This is good. The key is to first reset the modem when its already initialized.
i could'nt see that in the logs, because mm had no reason to do so.And maybe its better to not post how i did it, because i did not fully understand exactly why its working yet.
I will search the specs and document the above attentions with information from the specs.If you are curious- they can be found here:
http://www.3gpp.org/ftp/Specs/html-info/27007.htm
NOTE: This might (or should) work for other modems too which wont work by now with standard hayes init methods.
If you are lost and want to play with it -please pm me.
I use etc/ppp/ppp.conf and ppp, so this is a bit "around" normal pfsense methods. -
(Update) Finally - everything runs !
Now, that i know more why its running, i noticed, that i had just to activate the pin request, physically un and replug the modem after switching it to vmware and gone (with just sending the pin) … batsch
It works with this chatscript, because it resets the modem with the first commands too. (Case PIN_Deactivated) gngn... But - anyway - if someone out there ever has to use a proprietary / generic 3/4g modem just with chat scripts, then he can make use of this configuration.....
set dial "ABORT BUSY TIMEOUT 5
""
AT OK-AT-OK
AT+CPIN? READY-AT+CPIN=\"0000\"-OK #Send Pin in PINactivated case
AT OK \ #Sendig Pin takes some Time. Optional but useful when viewing the log
AT+CREG=0 OK-AT-OK \ # reset modem when pin is deactivated (and running under vmware)
AT+CGREG=0 OK-AT-OK
AT+CMER=0 OK-AT-OK
AT+CMEE=1 OK-AT-OK \ # Initialize Modem in case pin deact
AT+IFC=1 OK
AT+CPMS=\"ME\" OK \ # SMS Storage - optional
AT+CREG=2 OK \ # Enable diag port
AT+COPS=3,2;+COPS OK \ # put info on diag port optional
AT+CSCS=\"UCS2\" OK \ # Force UCS2 Net type - optional
AT+PSRAT OK\ # XS proprietary Network information optional
AT+MODODR=2 OK \ # XS proprietary Choose Automatically between HSDPA/HSUPA...
ATD99**1# CONNECT" # connect to apn 1 (web.vodafone in my case)Note: XS Stick answers to pin ready requests (AT+CPIN?) with READY and does not like AT+CPIN=?)
so i adapted pfSenses /var/etc/mpd.script for case Pin_Activatedhttp://forum.pfsense.org/index.php/topic,49392.msg261874.html#msg261874
Anyway - Now, i can use pfSense as a virtualized Firewall for my win7 host :=)
-
Nice. :)
Lots of useful info there.Steve
-
Many of these '4G' modems can be brought up as either a standard modem, that responds to dial-up etc, or as a usb ethernet device, no need to use any AT commands. You might investigate that.
Steve
Any pointers for the usb ethernet device route under FreeBSD?
Thanks
-
You could follow this thread:
http://forum.pfsense.org/index.php/topic,48780.0.html
That involves such a device.Steve