[SOLVED :)] Wifi card on RPi2

Yes... I assumed that you used a prebuild image... You could also build from master and include the mentioned packages with make menuconfig...

If you build from a stable tagged version you have to build with the same kernel config, else you will also see the dependency error because of kernel config hash mismatch.

1 Like

I've now installed 17.01.04 - There was no reference to it from https://wiki.openwrt.org/toh/raspberry_pi_foundation/raspberry_pi
so didn't know where to find a newer version initially.
After installing kmod-rt2800-usb, a wireless file appears. I set 'disabled' to 0 and reload the network but see no wireless interface when running ifconfig, even after a reboot.

What have I missed out?

Are you seeing two sections in wireless config?

Please post the initial wireless config and the output of iw list.

wireless:-

config wifi-device 'radio0'
	option type 'mac80211'
	option channel '11'
	option hwmode '11g'
	option path 'platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0'
	option htmode 'HT20'
	option disabled '0'

config wifi-iface 'default_radio0'
	option device 'radio0'
	option network 'lan'
	option mode 'ap'
	option ssid 'LEDE'
	option encryption 'none'

iw list:-

Wiphy phy0
	max # scan SSIDs: 4
	max scan IEs length: 2257 bytes
	max # sched scan SSIDs: 0
	max # match sets: 0
	max # scan plans: 1
	max scan plan interval: -1
	max scan plan iterations: 0
	Retry short long limit: 2
	Coverage class: 0 (up to 0m)
	Available Antennas: TX 0 RX 0
	Supported interface modes:
		 * IBSS
		 * managed
		 * AP
		 * AP/VLAN
		 * monitor
		 * mesh point
	Band 1:
		Capabilities: 0x17e
			HT20/HT40
			SM Power Save disabled
			RX Greenfield
			RX HT20 SGI
			RX HT40 SGI
			RX STBC 1-stream
			Max AMSDU length: 3839 bytes
			No DSSS/CCK HT40
		Maximum RX AMPDU length 32767 bytes (exponent: 0x002)
		Minimum RX AMPDU time spacing: 2 usec (0x04)
		HT TX/RX MCS rate indexes supported: 0-7, 32
		Frequencies:
			* 2412 MHz [1] (20.0 dBm)
			* 2417 MHz [2] (20.0 dBm)
			* 2422 MHz [3] (20.0 dBm)
			* 2427 MHz [4] (20.0 dBm)
			* 2432 MHz [5] (20.0 dBm)
			* 2437 MHz [6] (20.0 dBm)
			* 2442 MHz [7] (20.0 dBm)
			* 2447 MHz [8] (20.0 dBm)
			* 2452 MHz [9] (20.0 dBm)
			* 2457 MHz [10] (20.0 dBm)
			* 2462 MHz [11] (20.0 dBm)
			* 2467 MHz [12] (20.0 dBm) (no IR)
			* 2472 MHz [13] (20.0 dBm) (no IR)
			* 2484 MHz [14] (20.0 dBm) (no IR)
	valid interface combinations:
		 * #{ managed, AP, mesh point } <= 8,
		   total <= 8, #channels <= 1
	HT Capability overrides:
		 * MCS: ff ff ff ff ff ff ff ff ff ff
		 * maximum A-MSDU length
		 * supported channel width
		 * short GI for 40 MHz
		 * max A-MPDU length exponent
		 * min MPDU start spacing

Looks good...
Do you see any output with logread if you execute wifi down or wifi up?
And if you do wifi up, is the file /tmp/run/hostapd-phy0.conf created?

Looking through logread I see:-

daemon.notice netifd: radio0 (396): command failed: Not supported (-95)
daemon.notice netifd: radio0 (396): ./mac80211.sh: eval: line 1: /usr/sbin/hostapd: not found

/tmp/run/hostapd-phy0.conf contains:-

driver=nl80211
logger_syslog=127
logger_syslog_level=2
logger_stdout=127
logger_stdout_level=2
hw_mode=g
beacon_int=100
channel=11

ieee80211n=1
ht_coex=0
ht_capab=[SHORT-GI-20][SHORT-GI-40][RX-STBC1]

interface=wlan0
ctrl_interface=/var/run/hostapd
disassoc_low_ack=1
preamble=1
wmm_enabled=1
ignore_broadcast_ssid=0
uapsd_advertisement_enabled=1
auth_algs=1
wpa=0
ssid=RPi
bssid=00:0f:13:38:1b:10

My Android Wifi Analyzer does not see the SSID RPi. and ifconfig does not show wlan0

install hostapd with opkg install hostapd
Thought this was installed with wpad.

1 Like

It looks like you still lack the hostapd program itself. Generally wpad or wpad-mini is installed to supply /usr/sbin/hostapd. Wpad is a dual purpose binary that can be run as an AP (hostapd) or a client (wpa-supplicant).

Note that hostapd-common is just the script that creates the hostapd config. It isn't hostapd itself.

root@OpenWrt:~# opkg files wpad-mini
Package wpad-mini (2018-04-09-fa617ee6-5) is installed on root and has the following files:
/usr/sbin/wpad
/usr/sbin/hostapd
/usr/sbin/wpa_supplicant

hostapd and wpa_supplicant are links to wpad. I'm not sure what the purpose of the various "hostapd" packages are. wpad contains the full hostapd functionality.

1 Like

Is that better? :grinning:

Just tried installing wpad and hostapd - get unknown package...

After running opkg update (although it has already been run today) I was able to install hostapd and after running wifi up, ifconfig now shows wlan0! So must be getting close now.

The opkg list of packages (downloaded by opkg update) is stored on the RAM disk, it will be erased by a reboot.

1 Like

Thanks for that. I didn't know.

Thanks to all the help I've received here I know Wifi card active, I see wlan0 and the associated SSID, but I can't connect to it.. Not sure if I have ommitted anything or got the configuration wrong. My RPi is not running DHCP, it gets its IP address from pfSense which is the internet gateway.

What else do I need to do to get Internet access on my phone or tablet via my OpenWrt RPi?

Is your lan and wlan in the same network bridge?
You hostapd config files does not have something like bridge=br-lan but your initial wifi config does define option network lan. Does lan exist?

I don't see a hostapd.conf. Is this something I need to create myself? What goes into it?

Or do you mean /var/run/hostapd-phy0.conf ?

Yes this one... Is generated through s script from your wireless config file...

In /etc/config/network you should have or something similar:

config interface 'lan'
	option type 'bridge'
	option ifname 'eth0'
	option proto 'dhcp'

And your wireless config should have:

config wifi-iface
	...
	option network 'lan'

This means your wifi ap and your eth interface are in the same bridge for your lan (br-lan)...

Many thanks for this, it's working now!

I commented out the 'bridge' before because I didn't understand it. OpenWrt is such a good learning tool for networks. i may even try setting up a VLAN next. :grinning:

1 Like

@balanga look here also if you wanted to setup a mesh with 2 or more Raspberry Pi's

That wireless dongle of yours support mesh (you need 1 for each Raspberry Pi)

The LibreMesh runs a wizzard at first boot to create AP and Mesh
https://downloads.libremesh.org/dayboot_rely/17.06/targets/brcm2708/bcm2709/Default/lime_default/lede-17.01.2-lime-default-brcm2708-bcm2709-rpi-2-ext4-sdcard.img.gz

take note of the download location above for correct image for your pi version board
bcm2708 pi1
bcm2709 pi2
bcm2710 pi3


This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.