# [PC-BSD] Huawei e1752 mobile broadband - configure?



## paulie (Jul 1, 2011)

Hi all,

I am new to FreeBSD and I have a dual boot machine with a Huawei e1752 broadband modem. I have experience with Linux and Windows, so I am not *completely* clueless. However, I am struggling to cope with the FreeBSD Zeitgeist.

When I boot into FreeBSD (PC BSD version), the taskbar displaying the USB icon offers me three possibilities for my USB modem - two of which treat it as a digital camera and the other offers me the possibility to explore it using the file manager, which is no good since all the files are Windows exe's. The modem works fine under Linux.

I have Googled and the first step I have taken is to put the line 
	
	



```
u3g_load="YES"
```
 in /boot/loader.conf, and then I rebooted. Nothing seems to have changed.

What's my next step after adding that line? Is this even the right thing to do? At this stage, please keep explanations *very, very* simple.

TIA and rgs,


Paul.


----------



## SirDice (Jul 1, 2011)

It's possible the u3g(4) driver doesn't recognize your card. In that case there's nothing you can do.

Perhaps there's another way though, how is the card detected on Linux?


----------



## wblock@ (Jul 1, 2011)

u3g(4) needs some patching for it:
http://lists.freebsd.org/pipermail/freebsd-usb/2010-February/008294.html
http://lists.freebsd.org/pipermail/freebsd-usb/2010-February/008295.html


----------



## paulie (Jul 1, 2011)

Hi, thanks for your interest.



			
				SirDice said:
			
		

> It's possible the u3g(4) driver doesn't recognize your card. In that case there's nothing you can do.



I know that the Huawei e1752 does work with FreeBSD, see
http://forums.freebsd.org/showthread.php?t=15952&highlight=huawei+e1752



> Perhaps there's another way though, how is the card detected on Linux?



I have no idea how it works under Linux. There's a widget that appears in the taskbar and it just works (which is exactly what should happen under PCBSD IMHO). Having said that, what would I need to do to get the appropriate Linux code to work under FreeBSD?

Thanks again for your post.

Rgs,


Paul...


----------



## paulie (Jul 1, 2011)

Hi,

Thanks for your post.



			
				wblock said:
			
		

> u3g(4) needs some patching for it:



That may have been true 2 1/2 years ago, but I don't believe that this is the case now - see my reply to
the other post.



> http://lists.freebsd.org/pipermail/freebsd-usb/2010-February/008294.html
> http://lists.freebsd.org/pipermail/freebsd-usb/2010-February/008295.html



Thanks again, but this is just Greek to me. Is there a file that I can download, that you (or someone else) can tell me - put file x in directory y, the reboot and that's it? I think though, that it should work "out of the box".

Any further ideas, suggestions, URLs, anything appreciated.

TIA and rgs,
Paul...


----------



## richardpl (Jul 1, 2011)

Nothing seems to have changed? Please you do not need to reboot when you edit loader.conf, you can just load the u3g kernel module directly.

After the u3g module is loaded something should be new in dmesg output.

You need to look for cua* type of device under /dev/.


----------



## wblock@ (Jul 1, 2011)

Yes, the E1752 is supported now in the u3g(4) driver.



			
				paulie said:
			
		

> Thanks again, but this is just Greek to me. Is there a file that I can download, that you (or someone else) can tell me - put file x in directory y, the reboot and that's it? I think though, that it should work "out of the box".



`# kldload u3g`

Then you should have /dev/cuaU0, which is a serial port to the modem.  After that, it's PPP setup.


----------



## paulie (Jul 1, 2011)

wblock said:
			
		

> `# kldload u3g`
> Then you should have /dev/cuaU0, which is a serial port to the modem.  After that, it's PPP setup.



This is marvellous - *exactly* what I want - not only do you tell me what to do, but how I should go about doing it. Before I checked out the forum, I was Googling "load u3g.ko on boot", so I suppose I was making some progress... 

What's a real PITB is that since I have no internet on the machine when I boot into FreeBSD, I have to boot back and forth between the Windows OS and FreeBSD to check and/or Google.

This PPP setup is not exactly a bed of roses either - I again turned to your pal and mine, Mr. Google and came up with http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/userppp.html. Can't say as I've understood all of it, but after doing the load stuff, I'll try and setup my PPP &c. and will probably be back to you! Whatever happened to the concept of USB being Plug 'n Play?  :e

Thanks again for your help and rgs,


Paul...


----------



## paulie (Jul 2, 2011)

You said


			
				wblock said:
			
		

> # kldload u3g


So, I tried


```
[pol@pol-bsd] /dev# kldload u3g
kldload: can't load u3g: File exists
[pol@pol-bsd] /dev#
```

Then you said


> Then you should have /dev/cuaU0, which is a serial port to the modem. After that, it's PPP setup.


So, I tried

```
[pol@pol-bsd] /dev# ls -lis cuaU*
119 0 crw-rw----  1 uucp  dialer    0, 119 Jul  2 00:32 cuaU0.0
120 0 crw-rw----  1 uucp  dialer    0, 120 Jul  2 00:32 cuaU0.0.init
121 0 crw-rw----  1 uucp  dialer    0, 121 Jul  2 00:32 cuaU0.0.lock
125 0 crw-rw----  1 uucp  dialer    0, 125 Jul  2 00:32 cuaU0.1
126 0 crw-rw----  1 uucp  dialer    0, 126 Jul  2 00:32 cuaU0.1.init
127 0 crw-rw----  1 uucp  dialer    0, 127 Jul  2 00:32 cuaU0.1.lock
131 0 crw-rw----  1 uucp  dialer    0, 131 Jul  2 00:32 cuaU0.2
132 0 crw-rw----  1 uucp  dialer    0, 132 Jul  2 00:32 cuaU0.2.init
133 0 crw-rw----  1 uucp  dialer    0, 133 Jul  2 00:32 cuaU0.2.lock
137 0 crw-rw----  1 uucp  dialer    0, 137 Jul  2 00:32 cuaU0.3
138 0 crw-rw----  1 uucp  dialer    0, 138 Jul  2 00:32 cuaU0.3.init
139 0 crw-rw----  1 uucp  dialer    0, 139 Jul  2 00:32 cuaU0.3.lock
[pol@pol-bsd] /dev#
```

From here and here I got stuff like this:


```
umodem_load = "YES"
```
 to /boot/loader.conf

Which I did and now, what I decided to try was


```
# ppp
ppp> set device /dev/cuaU0.0
ppp> set speed 115200
ppp> enable dns
ppp> set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.255 0.0.0.0
ppp> add default HISADDR
ppp> term
AT+CFUN=1                    /* Enable RF - this will only work if you disable WLAN by pressing e.g. FN+F9 (Dell) */
AT+CGDCONT=1,"IP","open.internet" /* This is an ISP-specific Access Point Name (APN) - Google is your friend */
AT+CPIN="1810"		     /* my SIM's PIN
ATD*99#                      /* Dial */
```
and here is the result

```
# ppp
Working in interactive mode
Using interface: tun0
ppp ON pol-bsd> set device /dev/cuaU0.0
ppp ON pol-bsd> set speed 115200
ppp ON pol-bsd> enable dns
ppp ON pol-bsd> enable dns
ppp ON pol-bsd> set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.255 0.0.0.0
ppp ON pol-bsd> add default HISADDR
ppp ON pol-bsd> term
deflink: Entering terminal mode on /dev/cuaU0.0
Type `~?' for help
============== Keyboard completely freezes - ^Z,D,C no good - kill process ======
```

Any pointers as to what I'm doing wrong (or any other ideas)? Thanks and regards (and goodnight - it's 02:43 - I'm off to bed!)

Paul...

P.S. might give somebody a clue - note USB modem.


```
[pol@pol-bsd] /usr/home/pol# usbconfig 
ugen0.1: <UHCI root HUB Intel> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
ugen1.1: <UHCI root HUB Intel> at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
ugen2.1: <UHCI root HUB Intel> at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
ugen3.1: <UHCI root HUB Intel> at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
ugen4.1: <EHCI root HUB Intel> at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE
ugen4.2: <USB2.0 Web Camera Vimicro Corp.> at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON
ugen0.2: <USB Hub 2.0 ALCOR> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
ugen0.4: <Comfort Curve Keyboard 2000 Microsoft> at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON
ugen0.5: <USB Optical Mouse Logitech> at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON
ugen4.3: <HUAWEI Mobile HUAWEI Technology> at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON
```


----------



## richardpl (Jul 2, 2011)

Well, it should write OK shortly after some time. Try 0.1, 0.2 and 0.3 devices.


----------



## gpw928 (Jul 28, 2011)

Hi Paulie,

The E1752 looks similar to my E1762 which uses the u3g driver.  I run it with a generic kernel (straight off the release media):


```
[ding.136] uname -a
FreeBSD ding.internode.on.net 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:55:53 UTC 2010     root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
```

and don't need any specific drivers loaded (i.e. nothing in /boot/loader.conf).

The custom work required relates to the setup for ppp:


```
[ding.137] cd /etc/ppp
[ding.138] ls -la 
total 16
drwxr-xr-x   2 root  wheel   512 Jun 17 09:52 .
drwxr-xr-x  20 root  wheel  2560 Jul 27 17:32 ..
-rw-------   1 root  wheel   973 Jun 17 09:50 ppp.conf
-rw-------   1 root  wheel  1153 Jul 19  2010 ppp.conf.dist
-rw-r--r--   1 root  wheel   206 Mar  6 06:55 ppp.linkdown
-rw-r--r--   1 root  wheel   136 Mar  6 06:55 ppp.linkup
```


```
[ding#258] cat ppp.conf
# Run this as root (if you want linkup and linkdown route changes to work)
#
#   /usr/sbin/ppp -ddial internerd
#
default:
 allow users *
 #set log Phase Chat Connect hdlc LCP IPCP IPV6CP CCP tun
 set log Phase Chat Connect 
internerd: 
 set device /dev/cuaU0.0 
 set timeout 0 
 set authname my_login_name_at_my_isp
 set authkey my_password_at_my_isp
 set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \
        \"\" \
        AT OK-AT-OK \
        AT+CFUN=1 OK-AT-OK \
        AT+CMEE=2 OK-AT-OK \
        AT+CSQ OK \
        AT+CGDCONT=1,\\\"IP\\\",\\\"internode\\\" OK \
        AT+CGACT? OK-AT-OK \
        AT+CGATT? OK \
        AT+CGCLASS? OK \
        AT+COPS? OK \
        \\dATD*99# TIMEOUT 40 CONNECT"
 set crtscts on 
 disable vjcomp 
 disable acfcomp 
 disable deflate 
 disable deflate24 
 disable pred1 
 disable protocomp 
 disable mppe 
 disable ipv6cp 
 disable lqr 
 disable echo 
 nat enable yes 
 #disable dns 
 resolv writable 
 #set dns 208.67.220.220 208.67.222.222
 set ifaddr 10.1.0.2/0 10.1.0.1/0 255.255.255.255 0.0.0.0
 #add default HISADDR
```


```
[ding#260] cat ppp.linkdown
# These commands executed with uid of ppp invoker!
default:
 shell logger "LABEL down (up UPTIME): OCTETSIN received, OCTETSOUT sent"
internerd:
 shell route delete default
 shell route add default billion
```


```
[ding#261] cat ppp.linkup
# These commands executed with uid of ppp invoker!
internerd:
 shell route delete default
 shell route add default -interface INTERFACE
```

A few comments:


the "internetd" component identifies the script for a particular ISP (internode in this case);

you need to run the "/usr/sbin/ppp -ddial internerd" command as root you have the required privilege for the route changes can happen;

the "set log" can be manipulated for detailed tracing of what's happening;

the user name and password in ppp.conf must be the ones you have for your ISP;

I use linkup and linkdown scripts to change the default route;

"billion" is a host name in /etc/hosts, and is the default route when the ppp link is down; and

look in /var/log/ppp.log for the trace.

HTH

-- 
Phil


----------

