I am doing the same thing. But in my case I want to use the onboard wifi as WIFI access point and I want to use an Edimax EW-7811UTC AC600 as wireless client. I used to run this configuration on my RPI3B successfully.
For installing the EDIMAX I followed: https://edimax.freshdesk.com/support/solutions/articles/14000032146-how-to-install-ew-7811-ac600-series-and-ew-7822uac-adapters-on-raspberry-pi
This was a very good description, only mistake in there is that at several places they used: rtl8812Au where it should have been rtl8812au. For the rest this worked as a charm.
Further I have adapted the following files.
- /etc/dhcpcd.conf
- /etc/dnsmasq.conf
- /etc/rc.local
- /etc/default/hostapd
- /etc/hostapd/hostapd.conf
- /etc/init.d/hostapd
- /etc/network/interfaces
- /etc/network/interfaces.d/native_wifi.cfg
- /etc/systemd/network/99-default.link
- /etc/wpa_supplicant/wpa_supplicant.conf
Current status is that my WIFI access point is working well, but the WIFI client is still not working.
For getting predictable interfaces I have added the file: /etc/systemd/network/99-default.link
The out of the box installation has a link there like:
99-default.link -> /dev/null.
This I renamed to 99-default.old and added in a new file. This file looks like:
[Link]
NamePolicy=kernel database onboard slot path mac
MACAddressPolicy=persistent
This ensures you will have the predictable interfaces. In my case they are called:
wlxb827ebceb73c which is the RPI3B+ onboard WIFI
and
enx74da38c6f9fc which is the Edimax EW-7811UTC AC600.
In /etc/hostapd/hostapd.conf the SSID and PASSWORD for the WIFI access point are defined.
In the file /etc/wpa_supplicant/wpa_supplicant.conf the SSID and PASSWORD of the internet modem to which the WIFI client should connect are defined.
What I think to be rather strange is the following:
For the RPI3B the Edimax WIFI interfaces always got a predictable interface name starting with wlx*
Now on the RPI3B+ the Edimax WIFI name starts with en*, the same as the fixed Ethernet connection.
/etc/dhcpcd.conf:
hostname
clientid
persistent
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option ntp_servers
require dhcp_server_identifier
slaac private
nohook lookup-hostname
denyinterfaces wlxb827ebceb73c
/etc/dnsmasq.conf:
interface=wlxb827ebceb73c
dhcp-range=10.0.0.100,10.0.0.200,255.255.255.0,12h
/etc/rc.local:
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
sleep 10
sudo iw enx74da38c6f9fc set power_save off
exit 0
/etc/default/hostapd:
DAEMON_CONF="/etc/hostapd/hostapd.conf"
/etc/hostapd/hostapd.conf:
driver=nl80211
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
beacon_int=100
auth_algs=1
wpa_key_mgmt=WPA-PSK
ssid=MEITH
channel=1
hw_mode=b
wpa_passphrase=ChangeMe
interface=wlxb827ebceb73c
wpa=1
wpa_pairwise=TKIP
country_code=NL
/etc/init.d/hostapd:
#!/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON_SBIN=/usr/sbin/hostapd
DAEMON_DEFS=/etc/default/hostapd
DAEMON_CONF=/etc/hostapd/hostapd.conf
NAME=hostapd
DESC="advanced IEEE 802.11 management"
PIDFILE=/run/hostapd.pid
[ -x "$DAEMON_SBIN" ] || exit 0
[ -s "$DAEMON_DEFS" ] && . /etc/default/hostapd
[ -n "$DAEMON_CONF" ] || exit 0
DAEMON_OPTS="-B -P $PIDFILE $DAEMON_OPTS $DAEMON_CONF"
. /lib/lsb/init-functions
case "$1" in
start)
log_daemon_msg "Starting $DESC" "$NAME"
start-stop-daemon --start --oknodo --quiet --exec "$DAEMON_SBIN" \
--pidfile "$PIDFILE" -- $DAEMON_OPTS >/dev/null
log_end_msg "$?"
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
start-stop-daemon --stop --oknodo --quiet --exec "$DAEMON_SBIN" \
--pidfile "$PIDFILE"
log_end_msg "$?"
;;
reload)
log_daemon_msg "Reloading $DESC" "$NAME"
start-stop-daemon --stop --signal HUP --exec "$DAEMON_SBIN" \
--pidfile "$PIDFILE"
log_end_msg "$?"
;;
restart|force-reload)
$0 stop
sleep 8
$0 start
;;
status)
status_of_proc "$DAEMON_SBIN" "$NAME"
exit $?
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload|reload|status}" >&2
exit 1
;;
esac
exit 0
/etc/network/interfaces:
source /etc/network/interfaces.d/*.cfg
/etc/network/interfaces.d/native_wifi.cfg:
allow-hotplug enx74da38c6f9fc
iface enx74da38c6f9fc inet dhcp
allow-hotplug wlxb827ebceb73c
iface wlxb827ebceb73c inet static
address 10.0.0.1
netmask 255.255.255.0
network 10.0.0.0
broadcast 10.0.0.255
wireless-power off
/etc/systemd/network/99-default.link:
[Link]
NamePolicy=kernel database onboard slot path mac
MACAddressPolicy=persistent
/etc/wpa_supplicant/wpa_supplicant.conf:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=NL
network={
ssid="YOUR_SSID"
psk="YOUR PASSWORD"
key_mgmt=WPA-PSK
}
Please note I have left out all commented out remarks.
One strange thing is if I did not do the predictable interfaces and if I started out with the Edimax unplugged, and did not set the SSID and PASSWORD for the modem, then plugged in the Edimax it all works.
Cheers,
Paul