RealTek RTL8188CE Wii-Fi PCI network hardware setup

Help with setting up network cards, including WiFi cards.
Post Reply
wb7odyfred
Posts: 22
Joined: Sat Nov 12, 2016 5:44 pm
Has thanked: 0
Been thanked: 0

RealTek RTL8188CE Wii-Fi PCI network hardware setup

Post by wb7odyfred » Wed Jan 11, 2017 7:46 am

You need to know your installed networking hardware and installed kernel modules and your version and revision of freebsd.
Uname -a command and look for the revision number like r310386 and the Kernel version FreeBSD 12.0-CURRENT #1
Then check the PCI bus devices and the USB bus devices to see what you have for WiFi hardware in your computer.
Use the pciconf -lv and usbconfig list or usbconfig dump_info commands.
http://wiki.ghostbsd.org/wiki/index.php/FAQ#Network Read this updated Network FAQ
http://www.wonkity.com/~wblock/docs/html/wireless.html This Wireless entry is helpful and even provides a PDF version file.
viewtopic.php?f=64&t=526 Read this forum post I created to help new users, by listing the outputs of commands run.
https://www.freebsd.org/doc/en_US.ISO88 ... eless.html FreeBSD Handbook Network Wireless section


:

Code: Select all

uname -a

FreeBSD 12.0-CURRENT as of December 22 2016
fred@kliktel ~> uname -a
FreeBSD kliktel.ghostbsd-pc.home 12.0-CURRENT FreeBSD 12.0-CURRENT #1 r310386M: Thu Dec 22 19:08:02 PST 2016 fred@kliktel.ghostbsd-pc.home:/usr/obj/usr/src/sys/GENERIC amd64
fred@kliktel ~>
GhostBSD 11.1 Live boot from USB Flash Drive November 2017 version
root@ghostbsd:~ # uname -a
FreeBSD ghostbsd 11.1-RELEASE FreeBSD 11.1-RELEASE #0 r321309: Fri Jul 21 02:08:28 UTC 2017 root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64
root@ghostbsd:~ #
:

Code: Select all

 kldstat
fred@kliktel ~> kldstat
Id Refs Address Size Name
1 68 0xffffffff80200000 1d3f000 kernel
2 2 0xffffffff8222d000 c894 opensolaris.ko
3 1 0xffffffff8223b000 392db1 zfs.ko
4 1 0xffffffff82821000 a7dd linprocfs.ko
5 3 0xffffffff8282c000 7a2b linux_common.ko
6 1 0xffffffff82834000 12a2b geom_mirror.ko
7 1 0xffffffff82847000 fe29 geom_journal.ko
8 1 0xffffffff82857000 1110c geom_eli.ko
9 1 0xffffffff82869000 4042a linux.ko
10 1 0xffffffff828aa000 3afad linux64.ko
11 1 0xffffffff828e5000 1032c iscsi.ko
12 1 0xffffffff828f6000 97f41 i915kms.ko
13 1 0xffffffff8298e000 55088 drm2.ko
14 4 0xffffffff829e4000 273b iicbus.ko
15 1 0xffffffff829e7000 1cf7 iic.ko
16 1 0xffffffff829e9000 1e6b iicbb.ko
17 2 0xffffffff829eb000 1c048 if_rtwn.ko
18 1 0xffffffff82a08000 bf38 if_rtwn_pci.ko
fred@kliktel ~>
:

Code: Select all

 sudo kldload if_rtwn.ko if_rtwn_pci.ko
Manually Load kernel modules into kernel memory for RTL8188CE PCI Device.
:

Code: Select all

 pciconf -lv
List the PCI Bus Devices. The RealTek RTL8188CE is what I am working to make operational and connect to Wi-Fi access point for internet connetivity. As a second example, the Dell computer listed below has the Atheros AR9565 PCI chip.
alc0@pci0:1:0:0: class=0x020000 card=0xff1e1179 chip=0x20621969 rev=0xc1 hdr=0x00
vendor = 'Qualcomm Atheros'
device = 'AR8152 v2.0 Fast Ethernet'
class = network
subclass = ethernet
rtwn0@pci0:2:0:0: class=0x028000 card=0x818110ec chip=0x817610ec rev=0x01 hdr=0x00
vendor = 'Realtek Semiconductor Co., Ltd.'
device = 'RTL8188CE 802.11b/g/n WiFi Adapter'
class = network
fred@kliktel ~>
For a Dell Inspiron 11 series 3000 computer PCI wlan card
ath0@pci0:1:0:0: class=0x028000 card=0x020e1028 chip=0x0036168c rev=0x01 hdr=0x00
vendor = 'Qualcomm Atheros'
device = 'QCA9565 / AR9565 Wireless Network Adapter'
class = network

:

Code: Select all

 usbconfig  list
This listing below does NOT show the Edimax USB controller (It was not plugged in to a USB socket).
ugen0.1: <Intel EHCI root HUB> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen1.1: <Intel EHCI root HUB> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.2: <vendor 0x8087 product 0x0024> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen1.2: <vendor 0x8087 product 0x0024> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.3: <Generic USB2.0-CRW> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)
ugen0.4: <Importek TOSHIBA Web Camera> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)
ugen1.3: <Maxtor OneTouch> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (2mA)
root@kliktel:/usr/home/fred #
:

Code: Select all

 usbconfig  dump_device_desc
Here list out the Edimax EW-7811un nano usb Wi-Fi device
ugen1.3: <vendor 0x0bda product 0x8191> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)

bLength = 0x0012
bDescriptorType = 0x0001
bcdUSB = 0x0200
bDeviceClass = 0x0000 <Probed by interface class>
bDeviceSubClass = 0x0000
bDeviceProtocol = 0x0000
bMaxPacketSize0 = 0x0040
idVendor = 0x0bda
idProduct = 0x8191
bcdDevice = 0x0200
iManufacturer = 0x0001 <Realtek>
iProduct = 0x0002 <802.11n WLAN Adapter>
iSerialNumber = 0x0000 <no string>
bNumConfigurations = 0x0001
These are just the commands to interrogate the computer hardware to understand what WiFi hardware devices are in your system. Verify that FreeBSD supports these Wifi Hardware devices that you see in your computer, or go buy a WiFi nano usb dongle with Realtek RTL8192cu chip like TPLink W725 or Edimax EW-7811un that FreeBSD does support.
List kernel modules already loaded

Code: Select all

kldstat
Unload old kernel module from kernel memory space

Code: Select all

kldunload if_urtwn.ko

Load kernel modules for PCI Wifi RTL8188CE hardware

Code: Select all

kldload if_rtwn if_rtwn_pci 
Verify kernel modules got loaded into kernel memory space.

Code: Select all

kldstat
create rtwn0 device

Code: Select all

ifconfig wlan0 create wlandev rtwn0

Code: Select all

ifconfig -HT wlan0 create wlandev rtwn0
Bringing up the Wi-Fi device, will load the device firmware automatically. Then will scan for local WiFi access points.

Code: Select all

ifconfig wlan0 up scan
Now edit these 3 files /boot/loader.conf, /etc/rc.conf, and /etc/wpa_supplicant.conf

3 Files to add configuration lines inside them. First edit /boot/loader.conf file
/boot/loader.conf file contents for RTL8188CE PCI Wi-Fi WLAN device
# symbol will comment out the following lines, so there are not executed

Code: Select all

boot_verbose="YES"
# verbose_loading="YES"
kld_list="geom_mirror geom_journal geom_eli linux if_rtwn_pci if_rtwn"   #add if_rtwn if_rtwn_pci kernel drivers to kld_list
#if_wlan_load="YES"
if_rtwn_pci_load="YES"
if_rtwn_load="YES"
rtwn-rtl8192cfwE_B_load="YES"
rtwn-rtl8192cfwE_load="YES"
legal.realtek.license_ack=1
#if_rtwn_usb_load="YES"   USB version Edimax 7811un [color=#000080]RTL8192CU[/color] installation lines 
#if_rtwn_load="YES"
#rtwn-rtl8192cfwU_load="YES"
#rtwn-rtl8192cfwU_B_load="YES"
/etc/rc.conf add 2 lines for RTL8188CE

Code: Select all

wlans_rtwn0="wlan0"
ifconfig_wlan0="WPA DHCP"
/etc/wpa_supplicant.conf example file for an Open Network connection to Wireless SSID name "innflux"

Code: Select all

network={
   ssid="innflux"
   key_mgmt=NONE
}
/etc/wpa_supplicant.conf example file for an WPA Network connection to Wireless SSID name "NETGEAR59" This file was modified by utility WifiMgr which added many extra lines. Only the ssid and psk and maybe key_mgmt fields are necessary to achieve an encrypted Wi-Fi connection.
WifiMgr is an older utility application that is being replaced by NetworkMgr
WifiMgr Links http://opal.com/freebsd/ports/net-mgmt/wifimgr/ & http://www.freshports.org/net-mgmt/wifimgr
NetworkMgr Links https://github.com/GhostBSD/networkmgr & http://wiki.ghostbsd.org/wiki/index.php/Networkmgr
If NetworkMgr is not working for you, then you might try WifiMgr to select and connect to a Wi-Fi Access Point. The following wpa_supplicant.conf file entry was created by WifiMgr application. Now I use this same WifiMgr created entry, with the NetworkMgr utility application to automatically make the encrypted Wi-Fi connection to my Access Point for my internet connection.

Code: Select all

network={
	#: my NetGear box
	ssid="NETGEAR59"
	priority=3
	bssid=c4:04:15:7d:53:80
	key_mgmt=WPA-PSK
	proto=RSN
	psk="my_passkey_892"
}
Bare minimum fields necessary for an encrypted Wi-Fi connection using wpa_supplicant command

Code: Select all

network={
	#: my NetGear box
	ssid="NETGEAR59"
	psk="my_passkey_892"
	key_mgmt=WPA-PSK
}
or this Network card configuration by Networkmgr added to /etc/rc.conf file
I needed to set WiFi to channel 6,
Note that WifiMgr application program looks for keyword "WPA" to determine wireless Wi-Fi lan devices in the /etc/wpa_supplicant.conf.

Code: Select all

wlans_rtwn0="wlan0"
ifconfig_wlan0=" WPA channel 6 DHCP"
Manually issue the wpa_supplicant with the background Dameon option and dhclient commands

Code: Select all

wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf 
dhclient wlan0
Use the following line for testing with the Debug and Password debug printout options

Code: Select all

wpa_supplicant -d -K -i wlan0 -c /etc/wpa_supplicant.conf 
dhclient wlan0
Problems running dhclient? Then kill the previously running dhclient.

Code: Select all

killall dhclient
dhclient wlan0
use Netstat commands to list out the new network interface connections
use Sockstat commands to list out the socket connections

Code: Select all

netstat -r
or

Code: Select all

netstat -i
or

Code: Select all

sockstat -4
Check connectivity with ping command to a specific IP address like Google Domain Name service
Ping google Domain Naming Service (DNS) 3 times.

Code: Select all

ping -c 3 8.8.8.8
Ping Open Domain Naming Service (DNS) 3 times.

Code: Select all

ping -c 3 208.67.222.222
Ping Hurricane Electric Internet Service Provider 3 times.

Code: Select all

ping -c 3 he.net
Ping an OpenNic DNS server in Colorado ns4.co.us.dns.opennic.glue https://servers.opennicproject.org/
ping -c 3 63.231.92.27

#Sometimes you might need to restart the network interfaces and the routing services, after editing the /etc/rc.conf file or the /etc/wpa_supplicant.conf file.

Code: Select all

service netif restart  && service routing restart
http://sleepyhead.de/howto/?href=network Various OS including FreeBSD networking commands.

# Several manual pages to read more about wlan device drivers for FreeBSD (GhostBSD)

Code: Select all

man wlan
man rtwn
man rtwn_pci
man rtwn_usb
man rtwnfw
man wlandebug
man sysctl
# Use wlandebug and sysctl -a | grep wlan to explore settings and debug non-working system problems.

Code: Select all

wlandebug --help
sysctl -a | grep wlan
#Use these commands to debug booting up and loading kernel driver modules. Add "verbose_loading" and "boot_verbose" to file /boot/loader.conf

Code: Select all

boot_verbose="YES"
verbose_loading="YES"
This URL answers the question, "Why is my /boot/loader.conf file not working? https://forums.freebsd.org/threads/7677/ Thanks Dutch for your helpful technique to debug /boot/loader.conf
# Check that you do not have a typo errors in files /boot/loader.conf or /boot/device.hints like a missing "#" tag. The typo error will cause the processing of the file to abort, before completing the following lines in the file. So carefully check the boot logs for error messages or missing loading of device driver kernel modules.

Code: Select all

dmesg -a | less
less /var/run/dmesg.boot
You might have to verify the contents of file /etc/resolv.conf are correct for your internet service provider. At a minimum one nameserver must be correct and possibly one search gateway setup.
root@ghostbsd:~ # cat /etc/resolv.conf
# Generated by resolvconf
nameserver 192.168.43.1
search 8.8.8.8
Last edited by wb7odyfred on Mon Dec 18, 2017 9:38 am, edited 11 times in total.

ASX
Posts: 988
Joined: Wed May 06, 2015 12:46 pm
Has thanked: 0
Been thanked: 0

Re: RealTek RTL8188CE Wii-Fi PCI network hardware setup

Post by ASX » Wed Jan 11, 2017 9:54 am

Being a very old thread I guess you will not receive an answer from the OP. So, a thanks from me! :)

Post Reply