# sierra 320u



## bsdnub (Aug 30, 2012)

Hello Forum,

I have installed FreeBSD on my DELL Latitude D531 and trying to get my sierra 320U wireless 4G working. 

I have read how to setup a network connection but am lost. Is there a way to get it setup to connect to the net?

bsdnub.


----------



## SirDice (Aug 30, 2012)

What chipset does the card have? Look for a big black chip, see what's written on it.


----------



## bsdnub (Aug 30, 2012)

SirDice, 

 If you mean the sierra 320U 4G chipset, it does not have one I don`t think. But when I setup the same wireless under Linux I used this driver below but not sure how to set it up in FreeBSD.

http://www.sierrawireless.com/resources/support/drivers/linux/v3.2_1740_kernel-2.6.38.directIP.tar


----------



## SirDice (Aug 30, 2012)

Ah, it's a 4G card, I missed that. Thought it was a wifi card.

As far as I know the only driver that comes near it is u3g(4) but that's for USB devices.


----------



## bsdnub (Aug 30, 2012)

I should of said that it is a USB connection. So would it work with u3g(4)?


----------



## bsdnub (Aug 30, 2012)

This is what my 320U 4G is: http://www.telstra.com.au/business-enterprise/business-products/internet-data/devices/usb-4g/


----------



## SirDice (Aug 30, 2012)

bsdnub said:
			
		

> I should of said that it is a USB connection. So would it work with u3g(4)?



I really don't know, just try it. kldload(8) u3g(4) and plug it in. Look for new messages in /var/log/messages to see if it's detected at all.


----------



## bsdnub (Aug 30, 2012)

Thanks i will try kldload(8) u3g(4) and see if it is detected.


----------



## bsdnub (Aug 30, 2012)

SirDice,

Sorry I`m using PC-BSD not FreeBSD. 

In /var/log/messages I can see this: 

```
Aug 30 18:30:34 pcbsd-6427 kernel: ugecho -e AT\041SCAT=1, 2/r > /usbus5en5.2: <Sierra Wireless, Incorporated> at usbus5
Aug 30 18:30:38 pcbsd-6427 kernel: ugen5.2: <Sierra Wireless, Incorporated> at usbus5 (disconnected)
Aug 30 18:30:40 pcbsd-6427 kernel: ugen5.2: <Sierra Wireless, Incorporated> at usbus5
Aug 30 18:30:40 pcbsd-6427 kernel: umass0: <Sierra Wireless, Incorporated Aircard 320U, class 0/0, rev 2.00/0.06, addr 2> on usbus5
```


----------



## SirDice (Aug 30, 2012)

Something is detected, so that's a plus 

Looks like you need to fiddle with it a bit, can't really help there.

```
In some of these devices a mass storage device supported by the umass(4)
     driver is present which contains Windows and Mac OS X drivers.  The
     device starts up in disk mode (TruInstall, ZeroCD, etc.) and requires
     additional commands to switch it to modem mode. If your device is not
     switching automatically, please try to add quirks. See usbconfig(8) and
     usb_quirk(4).
```
 From u3g(4).


----------



## bsdnub (Aug 31, 2012)

SirDice,

 I tried a few things. I loaded ug3_load="YES" and usb_quirk_load="YES" into the loader.conf  but still not working. 

It can`t be far of if it detects the sierra 320U at start up.

Complete beginner at this kind of stuff.


----------



## bsdnub (Sep 5, 2012)

I found the site http://technotation.com/category/freebsd-and-mobile-broadband/

which i followed exactly what they said to do until i get to edit /usr/src/sys/dev/usb/serial/u3g.c.

Now i have to add U3GINIT_SIERRA in the sierra section which i put U3G_DEV(SIERRA,AirPrime, Inc., U3GINIT_SIERRA), and saved it.

Then recompiled the kernel and it gets to a part where it stops and says:


```
/usr/src/sys/dev/usb/serial/u3g.c:430: error: `U3G_DEV` undeclared here(not in a function) ***Error code 1

Stop in /usr/obj/usr/src/sys/MYKERNEL. *** Error code 1

Stop in /usr/src ***Error code 1
```

Have i done something wrong, does anyone know ?


----------



## humand (Sep 5, 2012)

bsdnub,

add the following line to u3g.c:


```
U3G_DEV(SIERRA, 320U, 0),
```

and the following line to usbdevs:


```
product SIERRA 320U                0x????  AirCard 320U
```

where 0x???? is your idProduct and you can find it as per http://technotation.com
(the line you added to u3g.c is wrong, follow the format from the site)


----------



## wblock@ (Sep 5, 2012)

bsdnub, please stop using colors as SirDice mentioned before.  Use  tags for filenames and paths, and 
	
	



```
tags for source and error messages.
```


----------



## bsdnub (Sep 6, 2012)

humand,

 I followed what you said and the compile kernel worked, as did the install kernel.

When i rebooted my pc with the Sierra 320U 4G plugged in, went into the terminal and typed: 

`% dmesg | grep u3g`
- comes up empty

Strange thing is i type:


```
% dmesg | grep ugen

ugen 0.1: <ATI> at usb0
ugen 1.1: <ATI> at usb1
ugen 2.1: <ATI> at usb2
ugen 3.1: <ATI> at usb3
ugen 4.1: <ATI> at usb4
ugen 5.1: <ATI> at usb5
ugen 5.2: <Sierra Wireless, Incorporated> at usb5
ugen 5.2: <Sierra Wireless, Incorporated> at usb5 ( disconnected )
```

wblock@, yep sorry about that, wasn`t sure how to post my problem.


----------



## humand (Sep 6, 2012)

bsdnub,

please try with the following instead:
u3g.c

```
U3G_DEV(SIERRA, AC320U, 0),
```
usbdevs:

```
product SIERRA AC320U                0x????  AirCard 320U
```
where 0x???? is the idProduct. btw, what is idProduct in your case?
recompile and check if u3g picks up anything.
also, while running unplug and plug your device back, wait a couple of seconds and post the output of: 
tail /var/log/messages


----------



## bsdnub (Sep 7, 2012)

humand, I tried that and the same result blank, nothing there.


```
tail /var/log/messages:

Sep 7 15:26:30 pcbsd 8543 kernel da0: <SWI SD Card 2.31> Removable Direct Access SCSI-2 device

sep 7 15:26:30 pcbsd 8543 kernel dao: 40.000MB/S transfers
sep 7 15:26:30 pcbsd 8543 kernel dao: Attempt to query device size failed: NOT READY, MEDIUM Not Present.
sep 7 15:26:30 pcbsd 8543 root: Unknown USB Device: vendor 0x0f3d product 0x68aa bus uhub5
sep 7 15:26:41 pcbsd 8543 kernel ugen5.2: <Sierra Wireless, Incorporated> at usbus5 ( disconnected )
sep 7 15:26:41 pcbsd 8543 kernel: umass0: at uhub5, port 1, addr 2 ( disconnected )
sep 7 15:26:41 pcbsd 8543 kernel: (dao: umass-sim0:0:0:0): lost device - 0 outstanding
sep 7 15:26:41 pcbsd 8543 kernel: (dao: umass-sim0:0:0:0): removing device entry
sep 7 15:26:49 pcbsd 8543 kernel: ugen5.2: <Sierra Wireless, Incorporated> at usbus5
sep 7 15:26:53 pcbsd 8543 kernel: ugen5.2: < Sierra Wireless, Incorporated> at usbus5 (disconnected)
```


----------



## humand (Sep 7, 2012)

bsdnub,
you still haven't provided your idProduct.
note that dump_device_desc outputs both iProduct and idProduct, just want to make sure you're actually adding the value of idProduct to your usbdevs file.


----------



## bsdnub (Sep 8, 2012)

humand, My idProduct is 0x0f3d. 

this is what i have done:


```
usbdevs:

product SIERRA AC320U      0x0f3d AirCard 320U
```


```
u3g.c:

U3G_DEV(SIERRA, AC320U, 0),
```


----------



## humand (Sep 8, 2012)

bsdnub, something does not seem right, i was expecting something like 0x68??.
i have an 313U and the idProduct is 0x68aa. 
we could be defining it wrong, so please post the full output of usbconfig -u ? -a ? dump_device_desc


----------



## PseudoCylon (Sep 8, 2012)

bsdnub said:
			
		

> humand, I tried that and the same result blank, nothing there.
> 
> 
> ```
> ...


Based on the log, the code should be

udevs

```
product AIRPRIME AC320U      0x68aa AirCard 320U
```
u3g.c

```
U3G_DEV(AIRPRIME, AC320U, 0),
```
Besides, both 313U and 320U (ones with product ID of 0x68aa) might also work with usie(4).


----------



## bsdnub (Sep 8, 2012)

pseudocylon,

 I did what you said and it worked, this is what comes up:


```
dmesg | grep u3g

u3g0: <Sierra Wireless, Incorporated AirCard 320U, class 0/0, rev 2.00/0.06, addr 2> on usbus5
u3g0: Found 5 ports
u3g0: at uhub5, port 1, addr 2 ( disconnected )
```


```
ls /dev/cuaU*
/dev/cuaU0.0        /dev/cuaU0.1       /dev/cuaU0.2        /dev/cuaU0.3        /dev/cuaU0.4
/dev/cuaU0.0.init   /dev/cuaU0.1.init  /dev/cuaU0.2.init   /dev/cuaU0.3.init   /dev/cuaU0.4.init
/dev/cuaU0.0.lock   /dev/cuaU0.1.lock  /dev/cuaU0.2.lock   /dev/cuaU0.3.lock   /dev/cuaU0.4.lock
```


----------



## bsdnub (Sep 8, 2012)

Then i followed the PPP Configuration setup from http://technotation.com/ and rebooted my pc but it didn`t connect.

Not sure what to do now.


----------



## humand (Sep 8, 2012)

bsdnub,

the ppp.conf from technotation.com is aimed mini-pcie modules and the example is for a specific provider. for 4g USB modems and for your own provider you need to make some modifications. you need to change /dev/cuaU0.0 to /dev/cuaU0.3 and you need to change the APN information under the AT+CGDCONT line to reflect your provider. from what i understood, you're with telstra so i crafter a ppp.conf for you.
try this:

```
default:
 set log Phase Chat LCP IPCP CCP tun command
 set device /dev/cuaU0.3
 set timeout 180

provider:
 set speed 921600
 set timeout 0
 set authname wapuser1
 set authkey wap
 set dial "ABORT BUSY TIMEOUT 3 \
        \"\" \
        AT OK-AT-OK \
        AT+CFUN=1 OK-AT-OK \
        AT+CMEE=2 OK-AT-OK \
        AT+CSQ OK \
        AT+CGDCONT=1,\\\"IP\\\",\\\"telstra.internet\\\" OK \
        ATD*99# CONNECT"
 enable dns
 resolv writable
 set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.255 0.0.0.0
 add default HISADDR
```


----------



## bsdnub (Sep 8, 2012)

humand,

 My internet connection is with bigpond. Is it the same settings with telstra ?


----------



## humand (Sep 8, 2012)

bsdnub,
for bigpond you need to replace telstra.internet with telstra.bigpond under the AT+CGDCONT line in ppp.conf
also, be prepared to replace the following with your login username/pass (if you were provided these by your provider) under set authname and set authkey in ppp.conf.


----------



## bsdnub (Sep 8, 2012)

humand,

 I did change telstra.internet with telstra.bigpond. also i put in my username in the box and same with password.

But under PPoE Device i click the down arrow and select cuaU0.3 and save it, then close the connection box and reopen it bge0 is selected.

How do i make cuaU0..3 kept as the PPoE Device selection ?


----------



## humand (Sep 8, 2012)

bsdnub,

in the connection manager or the GUI you're trying to set up the connection from, you need to configure a ppp not ppoe connection. although similar, ppoe uses an ethernet card, which you dont want.

what happens if you just save the new ppp.conf (back up the existing first) under /etc/ppp/ppp.conf and run ppp -ddial provider (where provider is the alias associated with your provider settings from ppp.conf)


----------



## bsdnub (Sep 9, 2012)

humand,

 I have edited ppp.conf and typed in what you said,


```
default:
 set log Phase Chat LCP IPCP CCP tun command
 set device /dev/cuaU0.3
 set timeout 180

provider:
 set speed 921600
 set timeout 0
 set authname wapuser1
 set authkey wap
 set dial "ABORT BUSY TIMEOUT 3 \
        \"\" \
        AT OK-AT-OK \
        AT+CFUN=1 OK-AT-OK \
        AT+CMEE=2 OK-AT-OK \
        AT+CSQ OK \
        AT+CGDCONT=1,\\\"IP\\\",\\\"telstra.internet\\\" OK \
        ATD*99# CONNECT"
 enable dns
 resolv writable
 set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.255 0.0.0.0
 add default HISADDR
```

 but not sure how to use ppp -ddial provider.

Do i do that in the terminal ?


----------



## humand (Sep 9, 2012)

bsdnub,

forget about the connection manager, it has some odd behaviour when it comes to 3g ppp. uncheck the "always on connection" and reboot
just save the ppp.conf file that i gave you in the last post to /etc/ppp/ppp.conf 
make sure you change set authname and set authkey to reflect your login information.
in a terminal, run the following: ppp -ddial provider
check with ifconfig if tun0 comes up (hopefully with an IP address)
let me know the result


----------



## bsdnub (Sep 9, 2012)

To change my set authname and set authkey what do i put there ? i`m a dumbo at this stuff.


```
ppp -ddial provider:

Working in ddial mode
Using interface tun2
```


```
ifconfig:

tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1500
        options=8000<LINKSTATE>
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
        Opened by PID 6280
tun1: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1500
        options=8000<LINKSTATE>
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
        Opened by PID 6393
tun2: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1500
      options=8000<LINKSTATE>
      nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
      Opened by PID 6530
```


----------



## humand (Sep 9, 2012)

it should be something like:


```
set authname bsdnub@bigpond.com
set authkey yourpassword
```

replace "bsdnub@bigpond.com" and "yourpassword" with whatever your wireless provider gave you to use. (you should also be able to give them a call to find them out.)
only run the "ppp -ddial provider" command once, i see you ran it 3 times since you have tun0, tun1, tun2.
first edit authname and authkey, then reboot so your previous tun interfaces will go away, then run the ppp -ddial provider command once, wait a few seconds and run ifconfig to check the status of the tun interface


----------



## bsdnub (Sep 9, 2012)

ok i edited ppp.conf and added my username and password like you said and rebooted my pc. 

 Then i ran pp -ddial provider and waited a few seconds then typed


```
ifconfig:

  flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1500
    options=8000<LINKSTATE>
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
    Opened by PID 3051
```


----------



## bsdnub (Sep 9, 2012)

Sorry i should of said it only  came up once when i typed ifconfig.


----------



## humand (Sep 9, 2012)

post the last screen of your /var/log/ppp.log


----------



## bsdnub (Sep 9, 2012)

/var/log/ppp.log is empty. Did i do something wrong ?


----------



## humand (Sep 9, 2012)

reboot so your tun device will go away 
overwrite your /etc/ppp/ppp.conf with the one i gave you and modify the authname and authkey with your provider info (the reason i'm asking you to do this again is because the connection manager might overwrite it on reboot)
in terminal type ppp -ddial provider
wait a few seconds and do an ipconfig to check the tun interface
if it does not have an ip, see if theres anything written in /var/log/ppp.log and if yes post the last screen

i think you're close at this point


----------



## bsdnub (Sep 9, 2012)

I did reboot and overwrite the /etc/ppp/ppp.conf and modified the authname and authkey with my provider info.

Typed ppp -ddd provider and then ifconfig and it has no ip address. Also /var/log/ppp.log is still empty.

Should i have the 320U plugged in when i do ppp -ddd provider and then ifconfig ?


----------



## humand (Sep 9, 2012)

of course you have to have it plugged in.........


----------



## bsdnub (Sep 9, 2012)

humand,

 I plugged the Sierra 320U in and rebooted my pc, once pcbsd finished loading up i  was connected to the net.

So i am now connected but loading my home page or trying to download firefox is really slow. Any way to make my speed quicker ?

What i did do was edit /etc/resolv.conf and removed nameserver 61.9.194.49 and 61.9.195.193 and added Dnsadvantage 156.154.70.1 and 156.154.71.1 but nameserver keeps coming back.

Tried to make a script named dhclient-enter-hooks, to stop nameserver keep loading on every reboot, but don`t know hot to make a script.

I searched how to do it but still not sure how to do it.


----------



## humand (Sep 9, 2012)

do not edit /etc/resolv.conf as it's being updated by the ppp script when you successfully connect with your aircard.

add this line to your ppp.conf, under enable dns:

```
set dns 156.154.70.1
```

do not change the word "nameserver" from your /etc/resolv.conf file, as it's a keyword.
how do your speeds look like when connected with the aircard?


----------



## bsdnub (Sep 10, 2012)

I added set dns 156.154.70.1 to ppp.conf under enable dns.

 My downloads and web pages load alot quicker now.

humand & PseudoCylon thanks for all your help connecting me to the net.

How do i mark this post as SOLVED ?


----------



## wblock@ (Sep 10, 2012)

Edit the first post and use the drop-down menu to set it to Solved.


----------



## bsdnub (Sep 10, 2012)

ok Thanks wblock@.


----------

