Setting WiFi with Encore N300

Hello, I have a problem with my WiFi, I am using a USB Encore N300 adapter.

My /etc/rc.conf:
Code:
wlans_urtw0="re0"
ifconfig_re0="WPA SYNCDHCP"

The driver is already enabled in /boot/default/loader.conf:
Code:
if_urtw_load="YES"

My /etc/wpa_supplicant.conf:
Code:
network={
	     ssid = "home"
	     key_mgmt = WPA-PSK
	     psk = "very secret passphrase"
             piority = 5
        }

When the computer boots it says something like
Code:
re0: link state changed to down

I cannot connect to the Internet of course. Any idea? Thanks.
 
Don't use re0, which is usually a Realtek wired Ethernet interface. Just use wlan0:
Code:
wlans_urtw0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"
 
wblock@ said:
Don't use re0, which is usually a Realtek wired Ethernet interface. Just use wlan0:
Code:
wlans_urtw0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"

Hello @wblock@, it was like you said at first but did not work so I changed it.
 
Last edited by a moderator:
Okay, but using a different interface name, particularly one that probably already exists as a wired interface, is almost certainly not going to help. How did it not work? What happened? Were there error messages?
 
wblock@ said:
Okay, but using a different interface name, particularly one that probably already exists as a wired interface, is almost certainly not going to help. How did it not work? What happened? Were there error messages?

Well it just does not work, I do not why. I do not have any error messages or is there any log that I can check?
 
Code:
# ifconfig wlan0 create wlandev urtw0
# ifconfig wlan0 up list scan

The second command may have to be re-run a couple of times. Does it show a list of local access points?
 
wblock@ said:
Code:
# ifconfig wlan0 create wlandev urtw0
# ifconfig wlan0 up list scan

The second command may have to be re-run a couple of times. Does it show a list of local access points?

Ok, I set /etc/rc.conf back to:
Code:
wlans_urtw0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"

So now I did:
Code:
# ifconfig wlan0 create wlandev urtw0
ifconfig: SIOCIFCREATE2: Device not configured

# ifconfig wlan0 up list scan
ifconfig: Interface wlan0 does not exist

If I run ifconfig I only see re0 and lo0.
 
I hate to ask the obvious, but you did restart your machine after making said change, correct?

Also, some output from dmesg might help as well.

break19
 
break19 said:
I hate to ask the obvious, but you did restart your machine after making said change, correct?

Also, some output from dmesg might help as well.

break19

Yes I did restart :)

I will try to put the output from dmesg.
 
Here the output of dmesg:
Code:
FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs
FreeBSD/SMP: 1 package(s) x 8 core(s)
 cpu0 (BSP): APIC ID: 16
 cpu1 (AP): APIC ID: 17
 cpu2 (AP): APIC ID: 18
 cpu3 (AP): APIC ID: 19
 cpu4 (AP): APIC ID: 20
 cpu5 (AP): APIC ID: 21
 cpu6 (AP): APIC ID: 22
 cpu7 (AP): APIC ID: 23
ACPI Warning: FADT (revision 5) is longer than ACPI 2.0 version, truncating length 268 to 244 (20110527/tbfadt-320)
ACPI Warning: Optional field Pm2ControlBlock has zero address or length: 0x0000000000000000/0x1 (20110527/tbfadt-586)
ioapic0 <Version 2.1> irqs 0-23 on motherboard
ioapic1 <Version 2.1> irqs 24-55 on motherboard
kbd1 at kbdmux0
ctl: CAM Target Layer loaded
acpi0: <ALASKA A M I> on motherboard
ACPI Error: [RAMB] Namespace lookup failure, AE_NOT_FOUND (20110527/psargs-392)
ACPI Exception: AE_NOT_FOUND, Could not execute arguments for [RAMW] (Region) (20110527/nsinit-380)
acpi0: Power Button (fixed)
cpu0: <ACPI CPU> on acpi0
cpu1: <ACPI CPU> on acpi0
cpu2: <ACPI CPU> on acpi0
cpu3: <ACPI CPU> on acpi0
cpu4: <ACPI CPU> on acpi0
cpu5: <ACPI CPU> on acpi0
cpu6: <ACPI CPU> on acpi0
cpu7: <ACPI CPU> on acpi0
attimer0: <AT timer> port 0x40-0x43 irq 0 on acpi0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
atrtc0: <AT realtime clock> port 0x70-0x71 irq 8 on acpi0
Event timer "RTC" frequency 32768 Hz quality 0
hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on acpi0
Timecounter "HPET" frequency 14318180 Hz quality 950
Event timer "HPET" frequency 14318180 Hz quality 450
Event timer "HPET1" frequency 14318180 Hz quality 450
Event timer "HPET2" frequency 14318180 Hz quality 450
Timecounter "ACPI-safe" frequency 3579545 Hz quality 850
acpi_timer0: <32-bit timer at 3.579545MHz> port 0x808-0x80b on acpi0
acpi_ec0: <Embedded Controller: GPE 0xa> port 0x62,0x66 on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
pcib1: <ACPI PCI-PCI bridge> irq 52 at device 2.0 on pci0
pci1: <ACPI PCI bus> on pcib1
vgapci0: <VGA-compatible display> port 0xe000-0xe0ff mem 0xc0000000-0xcfffffff,0xfea00000-0xfea3ffff irq 24 at device 0.0 on pci1
hdac0: <ATI (0xaab0) HDA Controller> mem 0xfea60000-0xfea63fff irq 25 at device 0.1 on pci1
hdac0: hdac_get_capabilities: Invalid corb size (0)
device_attach: hdac0 attach returned 6
pcib2: <ACPI PCI-PCI bridge> irq 52 at device 4.0 on pci0
pci2: <ACPI PCI bus> on pcib2
re0: <RealTek 8168/8111 B/C/CP/D/DP/E/F PCIe Gigabit Ethernet> port 0xd000-0xd0ff mem 0xd0004000-0xd0004fff,0xd0000000-0xd0003fff irq 44 at device 0.0 on pci2
re0: Using 1 MSI-X message
re0: Chip rev. 0x48000000
re0: MAC rev. 0x00000000
miibus0: <MII bus> on re0
rgephy0: <RTL8169S/8110S/8211 1000BASE-T media interface> PHY 1 on miibus0
rgephy0:  none, 10baseT, 10baseT-FDX, 10baseT-FDX-flow, 100baseTX, 100baseTX-FDX, 100baseTX-FDX-flow, 1000baseT-FDX, 1000baseT-FDX-master, 1000baseT-FDX-flow, 1000baseT-FDX-flow-master, auto, auto-flow
re0: Ethernet address: 74:d0:2b:31:d2:ee
pcib3: <ACPI PCI-PCI bridge> irq 53 at device 7.0 on pci0
pci3: <ACPI PCI bus> on pcib3
xhci0: <ASMedia ASM1042 USB 3.0 controller> mem 0xfe900000-0xfe907fff irq 50 at device 0.0 on pci3
xhci0: 32 byte context size.
usbus0 on xhci0
ahci0: <ATI IXP700 AHCI SATA controller> port 0xf040-0xf047,0xf030-0xf033,0xf020-0xf027,0xf010-0xf013,0xf000-0xf00f mem 0xfeb0b000-0xfeb0b3ff irq 19 at device 17.0 on pci0
ahci0: AHCI v1.20 with 3 6Gbps ports, Port Multiplier supported
ahcich0: <AHCI channel> at channel 0 on ahci0
ahcich1: <AHCI channel> at channel 1 on ahci0
ahcich2: <AHCI channel> at channel 2 on ahci0
ohci0: <AMD SB7x0/SB8x0/SB9x0 USB controller> mem 0xfeb0a000-0xfeb0afff irq 18 at device 18.0 on pci0
usbus1 on ohci0
ehci0: <AMD SB7x0/SB8x0/SB9x0 USB 2.0 controller> mem 0xfeb09000-0xfeb090ff irq 17 at device 18.2 on pci0
usbus2: EHCI version 1.0
usbus2 on ehci0
ohci1: <AMD SB7x0/SB8x0/SB9x0 USB controller> mem 0xfeb08000-0xfeb08fff irq 20 at device 19.0 on pci0
usbus3 on ohci1
ehci1: <AMD SB7x0/SB8x0/SB9x0 USB 2.0 controller> mem 0xfeb07000-0xfeb070ff irq 21 at device 19.2 on pci0
usbus4: EHCI version 1.0
usbus4 on ehci1
pci0: <serial bus, SMBus> at device 20.0 (no driver attached)
hdac0: <ATI SB600 HDA Controller> mem 0xfeb00000-0xfeb03fff irq 16 at device 20.2 on pci0
isab0: <PCI-ISA bridge> at device 20.3 on pci0
isa0: <ISA bus> on isab0
pcib4: <ACPI PCI-PCI bridge> at device 20.4 on pci0
pci4: <ACPI PCI bus> on pcib4
ohci2: <AMD SB7x0/SB8x0/SB9x0 USB controller> mem 0xfeb06000-0xfeb06fff irq 18 at device 20.5 on pci0
usbus5 on ohci2
ohci3: <AMD SB7x0/SB8x0/SB9x0 USB controller> mem 0xfeb05000-0xfeb05fff irq 22 at device 22.0 on pci0
usbus6 on ohci3
ehci2: <AMD SB7x0/SB8x0/SB9x0 USB 2.0 controller> mem 0xfeb04000-0xfeb040ff irq 23 at device 22.2 on pci0
usbus7: EHCI version 1.0
usbus7 on ehci2
acpi_button0: <Power Button> on acpi0
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
orm0: <ISA Option ROM> at iomem 0xc0000-0xcffff on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
ppc0: cannot reserve I/O port range
acpi_throttle0: <ACPI CPU Throttling> on cpu0
hwpstate0: <Cool`n'Quiet 2.0> on cpu0
acpi_throttle1: <ACPI CPU Throttling> on cpu1
acpi_throttle1: failed to attach P_CNT
device_attach: acpi_throttle1 attach returned 6
acpi_throttle2: <ACPI CPU Throttling> on cpu2
acpi_throttle2: failed to attach P_CNT
device_attach: acpi_throttle2 attach returned 6
acpi_throttle3: <ACPI CPU Throttling> on cpu3
acpi_throttle3: failed to attach P_CNT
device_attach: acpi_throttle3 attach returned 6
acpi_throttle4: <ACPI CPU Throttling> on cpu4
acpi_throttle4: failed to attach P_CNT
device_attach: acpi_throttle4 attach returned 6
acpi_throttle5: <ACPI CPU Throttling> on cpu5
acpi_throttle5: failed to attach P_CNT
device_attach: acpi_throttle5 attach returned 6
acpi_throttle6: <ACPI CPU Throttling> on cpu6
acpi_throttle6: failed to attach P_CNT
device_attach: acpi_throttle6 attach returned 6
acpi_throttle7: <ACPI CPU Throttling> on cpu7
acpi_throttle7: failed to attach P_CNT
device_attach: acpi_throttle7 attach returned 6
Timecounters tick every 1.000 msec
hdacc0: <Realtek ALC887 HDA CODEC> at cad 0 on hdac0
hdaa0: <Realtek ALC887 Audio Function Group> at nid 1 on hdacc0
pcm0: <Realtek ALC887 (Rear Analog)> at nid 20 and 24,26 on hdaa0
pcm1: <Realtek ALC887 (Front Analog)> at nid 27 and 25 on hdaa0
pcm2: <Realtek ALC887 (Onboard Digital)> at nid 17 on hdaa0
usbus0: 5.0Gbps Super Speed USB v3.0
usbus1: 12Mbps Full Speed USB v1.0
usbus2: 480Mbps High Speed USB v2.0
usbus3: 12Mbps Full Speed USB v1.0
usbus4: 480Mbps High Speed USB v2.0
usbus5: 12Mbps Full Speed USB v1.0
usbus6: 12Mbps Full Speed USB v1.0
usbus7: 480Mbps High Speed USB v2.0
ugen0.1: <0x1b21> at usbus0
uhub0: <0x1b21 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0
ugen1.1: <ATI> at usbus1
uhub1: <ATI OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus1
ugen2.1: <ATI> at usbus2
uhub2: <ATI EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus2
ugen3.1: <ATI> at usbus3
uhub3: <ATI OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus3
ugen4.1: <ATI> at usbus4
uhub4: <ATI EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus4
ugen5.1: <ATI> at usbus5
uhub5: <ATI OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus5
ugen6.1: <ATI> at usbus6
uhub6: <ATI OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus6
ugen7.1: <ATI> at usbus7
uhub7: <ATI EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus7
ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
ada0: <TOSHIBA DT01ACA100 MS2OA750> ATA-8 SATA 3.x device
ada0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes)
ada0: Command Queueing enabled
ada0: 953869MB (1953525168 512 byte sectors: 16H 63S/T 16383C)
ada0: Previously was known as ad4
ada1 at ahcich2 bus 0 scbus2 target 0 lun 0
cd0 at ahcich1 bus 0 scbus1 target 0 lun 0
cd0: <SONY DVD RW AD-7280S 1.60> Removable CD-ROM SCSI-0 device 
cd0: 150.000MB/s transfers (SATA 1.x, UDMA5, ATAPI 12bytes, PIO 8192bytes)
cd0: Attempt to query device size failed: NOT READY, Medium not present - tray closed
ada1: <WDC WD3200AAJS-60Z0A0 03.03E03> ATA-8 SATA 2.x device
ada1: 300.000MB/s transfers (SATA 2.x, UDMA5, PIO 8192bytes)
ada1: Command Queueing enabled
ada1: 305245MB (625142448 512 byte sectors: 16H 63S/T 16383C)
ada1: Previously was known as ad8
SMP: AP CPU #1 Launched!
SMP: AP CPU #7 Launched!
SMP: AP CPU #6 Launched!
SMP: AP CPU #5 Launched!
SMP: AP CPU #2 Launched!
SMP: AP CPU #4 Launched!
SMP: AP CPU #3 Launched!
Timecounter "TSC-low" frequency 1806099290 Hz quality 1000
uhub5: 2 ports with 2 removable, self powered
uhub6: 4 ports with 4 removable, self powered
uhub1: 5 ports with 5 removable, self powered
uhub3: 5 ports with 5 removable, self powered
uhub0: 4 ports with 4 removable, self powered
Root mount waiting for: usbus7 usbus4 usbus2
Root mount waiting for: usbus7 usbus4 usbus2
uhub7: 4 ports with 4 removable, self powered
uhub2: 5 ports with 5 removable, self powered
uhub4: 5 ports with 5 removable, self powered
Root mount waiting for: usbus4 usbus2
ugen1.2: <Razer> at usbus1
ugen3.2: <Razer> at usbus3
ukbd1: <Razer Razer BlackWidow 2013, class 0/0, rev 2.00/2.00, addr 2> on usbus3
kbd2 at ukbd1
ukbd2: <Razer Razer BlackWidow 2013, class 0/0, rev 2.00/2.00, addr 2> on usbus3
ugen2.2: <vendor 0x0bda> at usbus2
kbd3 at ukbd2
ums1: <Razer Razer Naga, class 0/0, rev 2.00/2.00, addr 2> on usbus1
ums0: <Razer Razer BlackWidow 2013, class 0/0, rev 2.00/2.00, addr 2> on usbus3
ums0: 3 buttons and [XYZ] coordinates ID=0
ums1: 7 buttons and [XYZ] coordinates ID=0
ukbd0: <Razer Razer Naga, class 0/0, rev 2.00/2.00, addr 2> on usbus1
kbd4 at ukbd0
Root mount waiting for: usbus2
Trying to mount root from ufs:/dev/label/rootfs0 [rw,noatime]...
ugen1.3: <Elite Silicon> at usbus1
uaudio0: <Elite Silicon USB Audio Device, class 0/0, rev 1.10/1.10, addr 3> on usbus1
uaudio0: Play: 48000 Hz, 2 ch, 16-bit S-LE PCM format, 2x8ms buffer.
uaudio0: No recording.
uaudio0: No MIDI sequencer.
pcm3: <USB audio> on uaudio0
uaudio0: HID volume keys found.
hdac1: <ATI (0xaab0) HDA Controller> mem 0xfea60000-0xfea63fff irq 25 at device 0.1 on pci1
hdac1: hdac_get_capabilities: Invalid corb size (0)
device_attach: hdac1 attach returned 6
hwpstate0: set freq failed, err 6
ugen7.2: <Kingston> at usbus7
umass0: <Kingston DataTraveler 2.0, class 0/0, rev 2.00/1.00, addr 2> on usbus7
umass0:  SCSI over Bulk-Only; quirks = 0x4100
umass0:4:0:-1: Attached to scbus4
da0 at umass-sim0 bus 0 scbus4 target 0 lun 0
da0: <Kingston DataTraveler 2.0 PMAP> Removable Direct Access SCSI-4 device 
da0: 40.000MB/s transfers
da0: 14992MB (30704064 512 byte sectors: 255H 63S/T 1911C)
da0: quirks=0x3<NO_SYNC_CACHE,NO_6_BYTE>
hwpstate0: set freq failed, err 6
hwpstate0: set freq failed, err 6
hwpstate0: set freq failed, err 6
hwpstate0: set freq failed, err 6
 
It's not necessary to restart for this.

What is the output of usbconfig? There doesn't seem to be anything about a urtw(4) device in the output.
 
wblock@ said:
It's not necessary to restart for this.

What is the output of usbconfig? There doesn't seem to be anything about a urtw(4) device in the output.

This is it:

Code:
# usbconfig 
ugen0.1: <XHCI root HUB 0x1b21> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA) 
ugen1.1: <OHCI root HUB ATI> at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA) 
ugen2.1: <EHCI root HUB ATI> at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA) 
ugen3.1: <OHCI root HUB ATI> at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA) 
ugen4.1: <EHCI root HUB ATI> at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA) 
ugen5.1: <OHCI root HUB ATI> at usbus5, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA) 
ugen6.1: <OHCI root HUB ATI> at usbus6, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA) 
ugen7.1: <EHCI root HUB ATI> at usbus7, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA) 
ugen1.2: <Razer > at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA) 
ugen3.2: <Razer r> at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA) 
ugen2.2: <product 0x8178 vendor 0x0bda> at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA) 
ugen1.3: <USB Audio Device Elite Silicon> at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (500mA)
 
The urtw(4) driver is not part of the GENERIC kernel as far as I know. It has to be loaded with kldload if_urtw and you can put this is /boot/loader.conf to have it loaded automatically at boot:

Code:
if_urtw_load="YES"

Your device may however need the urtwn(4) driver instead if it doesn't work with urtw(4) and you need FreeBSD 10 for that.
 
kpa said:
The urtw(4) driver is not part of the GENERIC kernel as far as I know. It has to be loaded with kldload if_urtw and you can put this is /boot/loader.conf to have it loaded automatically at boot:

Code:
if_urtw_load="YES"

Your device may however need the urtwn(4) driver instead if it doesn't work with urtw(4) and you need FreeBSD 10 for that.


I already set
Code:
if_urtw_load="YES"
in /boot/default/loader.conf . I do not have a file called loader.conf inside /boot directory.
 
This is my /boot/loader.conf now:
Code:
if_urtw_load="YES"
wlan_scan_ap_load="YES"
wlan_scan_sta_load="YES"
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
 
Hi!
I have successfully setup the USB WiFi card ASUS USB-N13, which is based on the same chipset:

dmesg | grep urtwn
Code:
urtwn0: <vendor 0x0b05 product 0x17ab, class 0/0, rev 2.00/2.00, addr 1> on usbus0
urtwn0: MAC/BB RTL8192CU, RF 6052 2T2R

uname -a
Code:
FreeBSD MYBSD 10.0-PRERELEASE FreeBSD 10.0-PRERELEASE #0: Sat Jan  4 22:20:51 MSK 2014     user@MYBSD:/usr/obj/usr/src/sys/MYBSD  amd64

And that's what I do to get it to work:

  • It needs to accept license. Driver tells that in /var/log/messages
    Code:
    Jan 12 23:36:10 MYBSD kernel: urtwn-rtl8192cfwT: If you agree with the license, set legal.realtek.license_ack=1 in /boot/loader.conf.
  • Parameters in /etc/rc.conf
    Code:
    wlans_urtwn0="wlan0"
    ifconfig_wlan0="WPA DHCP"
  • Settings in /etc/wpa_supplicant.conf
    Code:
    ctrl_interface=/var/run/wpa_supplicant
    ctrl_interface_group=wheel
    
    network={
            priority=1
            ssid="My-SSID"
            psk="MyWiFiPassword"
    }

And that results in:
ifconfig wlan0 urtwn0
Code:
urtwn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
        ether 50:46:5d:af:f5:5e
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
        status: associated
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 50:46:5d:af:f5:5e
        inet 172.16.254.34 netmask 0xffffff00 broadcast 172.16.254.255 
        media: IEEE 802.11 Wireless Ethernet OFDM/54Mbps mode 11g
        status: associated
        ssid My-SSID channel 6 (2437 MHz 11g) bssid 00:14:d1:9a:ca:50
        country US authmode WPA2/802.11i privacy ON deftxkey UNDEF
        AES-CCM 2:128-bit txpower 0 bmiss 7 scanvalid 60 bgscan
        bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS
        roaming MANUAL
 
Back
Top