User avatar
DougieLawson
Posts: 34114
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Pi 3 as wiireless client and wireless AP?

Sun Sep 17, 2017 6:50 pm

SurferTim wrote:
Sun Sep 17, 2017 6:19 pm
Good deal. Have you done upgrade, update, and rpi-update? If not, do so.

Code: Select all

sudo apt-get update
sudo apt-get upgrade
sudo rpi-update
Stop that. Stop suggesting folks use rpi-update, it can break things. rpi-update should only be run when you're working with the RPF folks to fix a firmware/kernel bug. It should only be run by folks who can resurrect a dead RPi in twenty minutes or less (because they know what they're doing and know what rpi-update does to their system).
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

SurferTim
Posts: 1764
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Pi 3 as wiireless client and wireless AP?

Sun Sep 17, 2017 7:05 pm

@DougieLawson: What does it break?

raspiquax
Posts: 20
Joined: Fri Sep 15, 2017 7:17 pm

Re: Pi 3 as wiireless client and wireless AP?

Sun Sep 17, 2017 7:10 pm

:(

Code: Select all

I have in
 /etc/wpa_supplicant/wpa_supplicant.conf 
the ssid and passphrase 
once!
and in the

Code: Select all

  /etc/dhcpcd.conf
 the ssid and passphrase .
twice??! :?

User avatar
DougieLawson
Posts: 34114
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Pi 3 as wiireless client and wireless AP?

Sun Sep 17, 2017 7:13 pm

SurferTim wrote:
Sun Sep 17, 2017 7:05 pm
@DougieLawson: What does it break?
I've had it leave a Zero as a completely dead system (until I rebuild /boot and /lib/modules on another machine). I've had it leave others of my 14 raspberries with the network not working.

Don't run it, it's not needed. The stable firmware/kernel comes down the wire with the raspberrypi-kernel and raspberrypi-bootloader packages that you'll get with apt -y upgrade or apt -y dist-upgrade. If you want to run rpi-update, you need a good reliable backup of your SDCard.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

raspiquax
Posts: 20
Joined: Fri Sep 15, 2017 7:17 pm

Re: Pi 3 as wiireless client and wireless AP?

Sun Sep 17, 2017 7:18 pm

hello DougieLawson,
thanks for your additional hint,
maybe my raspberrypi3 is out of titan metall,
....still alive and working.. :)

SurferTim
Posts: 1764
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Pi 3 as wiireless client and wireless AP?

Sun Sep 17, 2017 7:21 pm

@DougieLawson: I tried the apt upgrade. Didn't work froze my RPi3. A reboot and apt-get upgrade fixed it.

If you think it isn't necessary, I will quit recommending it.

@raspiquax: No ssid/passphrase in /etc/dhcpcd.conf. That should just be the static ip assignment for your AP interface.

raspiquax
Posts: 20
Joined: Fri Sep 15, 2017 7:17 pm

Re: Pi 3 as wiireless client and wireless AP?

Sun Sep 17, 2017 7:41 pm

Since I deleted the ssid and passphrase from the dhcpcd.conf,
I can't reach my raspberrypi via putty anymore,
----> no route to host!

I am going to undelete and try it again, just for test!

SurferTim
Posts: 1764
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Pi 3 as wiireless client and wireless AP?

Sun Sep 17, 2017 7:52 pm

Is there something about your setup in dhcpcd.conf that assigns a static ip to a ssid?

raspiquax
Posts: 20
Joined: Fri Sep 15, 2017 7:17 pm

Re: Pi 3 as wiireless client and wireless AP?

Sun Sep 17, 2017 8:00 pm

:( :(
I cannot manage starting my raspberrypi3 anymore.
With my pi password I cannot start a session with keyboard and mouse
directly on my raspi anymore.

Just let us finish our session today, its late and my dog is waiting for me for chasing some cats... :lol:
Maybe tomorrow I will ask again.
THx

CU
harry

raspiquax
Posts: 20
Joined: Fri Sep 15, 2017 7:17 pm

Re: Pi 3 as wiireless client and wireless AP?

Tue Sep 19, 2017 9:03 am

hi surferTim,

back on track!
I had to start from the scratch!

Tried again to install everything, but
again with pr!oblems!

I couldn't examine the leafpad command!?
I guess this is the problem that I can't see any AP SSID.
one more question:
I find out, that the client IP changed therefore I couldn't deal with putty yesterday!
I cannot find the "place," where that IP is stored?!
I would like to define my own IP's!!
Any Idea?
anyway many thx for assistance
greetings

SurferTim
Posts: 1764
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Pi 3 as wiireless client and wireless AP?

Tue Sep 19, 2017 11:37 am

Static IPs are assigned in /etc/dhcpcd.conf.

Leafpad is a GUI text editor. If you are using Lite or logging in with ssh, use nano instead.

raspiquax
Posts: 20
Joined: Fri Sep 15, 2017 7:17 pm

Re: Pi 3 as wiireless client and wireless AP?

Tue Sep 19, 2017 3:32 pm

OK !!
I could manage this problem, because I "#" the Static IP's for my client use in the dhcpcd.conf.

So, if I understand it right, there are two static address blocks in the dhcpcd.conf!?

One block for the client use
and
one block for the AP use!?
Am I right?

For my AP- use I cannot see any SSID at my mobile/tab at the moment :-(

Do you have any further idea?
THX anyway surferTim!

SurferTim
Posts: 1764
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Pi 3 as wiireless client and wireless AP?

Tue Sep 19, 2017 3:45 pm

Yes, one for the client if you require that, and certainly one for the AP interface.

raspiquax
Posts: 20
Joined: Fri Sep 15, 2017 7:17 pm

Re: Pi 3 as wiireless client and wireless AP?

Tue Sep 19, 2017 6:10 pm

Do you have any idea, because of having no AP-SSID?
Could it be a edimax driver problem?
:(

alex1237424
Posts: 1
Joined: Thu Sep 21, 2017 3:27 pm

Re: Pi 3 as wiireless client and wireless AP?

Thu Sep 21, 2017 3:40 pm

Hi guys.

I just received my rpi zero W and I'm trying to setup it to be as wifi client and access point without external dongles. I dont need high speeds and I can't use external dongles. I tried setups as on first page and here: http://imti.co/post/145442415333/raspbe ... station-ap

So when I run hostapd /etc/hostapd/hostapd.conf, it starts a hotspot normally and I can connect to it. But old wlan0 stops to work, it disconnects from wifi and there are kernel errors in logs:

Sep 21 14:28:35 raspberrypi kernel: [ 84.911871] nf_conntrack version 0.5.0 (7168 buckets, 28672 max)
Sep 21 14:28:38 raspberrypi kernel: [ 88.048554] IPv6: ADDRCONF(NETDEV_UP): uap0: link is not ready
Sep 21 14:28:38 raspberrypi systemd[1]: Reloading OpenBSD Secure Shell server.
Sep 21 14:28:38 raspberrypi systemd[1]: Reloaded OpenBSD Secure Shell server.
Sep 21 14:28:42 raspberrypi kernel: [ 92.184686] brcmfmac: brcmf_link_down: WLC_DISASSOC failed (-11)
Sep 21 14:28:42 raspberrypi wpa_supplicant[340]: wlan0: CTRL-EVENT-DISCONNECTED bssid=00:0a:eb:13:7b:00 reason=0 locally_generated=1
Sep 21 14:28:42 raspberrypi kernel: [ 92.234693] IPv6: ADDRCONF(NETDEV_CHANGE): uap0: link becomes ready
Sep 21 14:28:42 raspberrypi wpa_supplicant[340]: p2p-dev-wlan0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
Sep 21 14:28:42 raspberrypi wpa_supplicant[340]: p2p-dev-wlan0: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=UA
Sep 21 14:28:43 raspberrypi wpa_supplicant[340]: wlan0: Trying to associate with 00:0a:eb:13:7b:00 (SSID='myssid' freq=2412 MHz)
Sep 21 14:28:43 raspberrypi kernel: [ 93.189611] brcmfmac: brcmf_c_set_joinpref_default: Set join_pref error (-1)
Sep 21 14:28:43 raspberrypi wpa_supplicant[340]: wlan0: Association request to the driver failed
Sep 21 14:28:43 raspberrypi kernel: [ 93.193315] brcmfmac: brcmf_cfg80211_connect: BRCMF_C_SET_SSID failed (-1)
Sep 21 14:28:44 raspberrypi wpa_supplicant[340]: wlan0: Trying to associate with 00:0a:eb:13:7b:00 (SSID='myssid' freq=2412 MHz)
Sep 21 14:28:44 raspberrypi wpa_supplicant[340]: wlan0: Association request to the driver failed
Sep 21 14:28:44 raspberrypi kernel: [ 94.526368] brcmfmac: brcmf_c_set_joinpref_default: Set join_pref error (-1)
Sep 21 14:28:44 raspberrypi kernel: [ 94.528090] brcmfmac: brcmf_cfg80211_connect: BRCMF_C_SET_SSID failed (-1)
Sep 21 14:28:46 raspberrypi wpa_supplicant[340]: wlan0: Trying to associate with 00:0a:eb:13:7b:00 (SSID='myssid' freq=2412 MHz)
Sep 21 14:28:46 raspberrypi wpa_supplicant[340]: wlan0: Association request to the driver failed
Sep 21 14:28:46 raspberrypi kernel: [ 96.367492] brcmfmac: brcmf_c_set_joinpref_default: Set join_pref error (-1)
Sep 21 14:28:46 raspberrypi kernel: [ 96.369188] brcmfmac: brcmf_cfg80211_connect: BRCMF_C_SET_SSID failed (-1)
Sep 21 14:28:52 raspberrypi wpa_supplicant[340]: wlan0: Trying to associate with 00:0a:eb:13:7b:00 (SSID='myssid' freq=2412 MHz)

and dmesg:
[ 18.970779] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 196.551412] nf_conntrack version 0.5.0 (7168 buckets, 28672 max)
[ 199.266545] IPv6: ADDRCONF(NETDEV_UP): uap0: link is not ready
[ 209.889399] brcmfmac: brcmf_link_down: WLC_DISASSOC failed (-11)
[ 209.941059] IPv6: ADDRCONF(NETDEV_CHANGE): uap0: link becomes ready
[ 210.734937] brcmfmac: brcmf_c_set_joinpref_default: Set join_pref error (-1)
[ 210.736662] brcmfmac: brcmf_cfg80211_connect: BRCMF_C_SET_SSID failed (-1)
[ 212.073182] brcmfmac: brcmf_c_set_joinpref_default: Set join_pref error (-1)
[ 212.074913] brcmfmac: brcmf_cfg80211_connect: BRCMF_C_SET_SSID failed (-1)
[ 213.913700] brcmfmac: brcmf_c_set_joinpref_default: Set join_pref error (-1)
[ 213.915417] brcmfmac: brcmf_cfg80211_connect: BRCMF_C_SET_SSID failed (-1)
[ 219.771419] brcmfmac: brcmf_c_set_joinpref_default: Set join_pref error (-1)
[ 219.773130] brcmfmac: brcmf_cfg80211_connect: BRCMF_C_SET_SSID failed (-1)
[ 230.608818] brcmfmac: brcmf_c_set_joinpref_default: Set join_pref error (-1)
[ 230.612470] brcmfmac: brcmf_cfg80211_connect: BRCMF_C_SET_SSID failed (-1)
[ 241.454233] brcmfmac: brcmf_c_set_joinpref_default: Set join_pref error (-1)
[ 241.456024] brcmfmac: brcmf_cfg80211_connect: BRCMF_C_SET_SSID failed (-1)

I'm using:
Linux raspberrypi 4.9.50+ #1035 Wed Sep 13 22:53:09 BST 2017 armv6l GNU/Linux
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
raspberry pi zero W v1.1
raspbian lite

Update:
I found that if I restart wlan0 it connects normally and everything works, and starting uap0 and hostapd when wlan0 is down doesnt give any errors at all. So I changed the hostapdstart script:
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
iw dev wlan0 interface add uap0 type __ap
service dnsmasq restart
sysctl net.ipv4.ip_forward=1
iptables -t nat -A POSTROUTING -s 192.168.50.0/24 ! -d 192.168.50.0/24 -j MASQUERADE
ifdown wlan0
ifup uap0
hostapd /etc/hostapd/hostapd.conf &
ifup wlan0
Now my pi zero W works as wifi client and access point without issues.

raspiquax
Posts: 20
Joined: Fri Sep 15, 2017 7:17 pm

Re: Pi 3 as wiireless client and wireless AP?

Thu Sep 21, 2017 9:45 pm

In the meantime I found the problem maybe:
[ Configuration file: /etc/hostapd.conf
Line 2: invalid/unknown driver 'rtl871xdrv'
1 errors found in configuration file '/etc/hostapd.conf'
Failed to set up interface with /etc/hostapd.conf
Failed to initialize interface
/quote]
Does this mean that my edimax driver is not
proper installed? :?

raspiquax
Posts: 20
Joined: Fri Sep 15, 2017 7:17 pm

Re: Pi 3 as wiireless client and wireless AP?

Sat Sep 23, 2017 3:24 pm

Hi,
in the next meantime,
yes..... I had the wrong driver installed!
The right one is the nl80211!!
I swung back to the old wlan0/wlan1/ethl0 expressions and voilà I got the SSID for AP
but with the remark, no Internet in my mobile!!!

I guess I am quite near to the solution!
Any idea from anybody here?

Thx

aqpeeb
Posts: 4
Joined: Wed Nov 15, 2017 8:18 pm

Re: Pi 3 as wiireless client and wireless AP?

Wed Nov 15, 2017 8:21 pm

I think this is a better solution. Involving udev. No script needed, no reboot needed, no change to rc.local.
https://github.com/peebles/rpi3-wifi-station-ap

biasha
Posts: 10
Joined: Thu Sep 07, 2017 9:54 am

Re: Pi 3 as wiireless client and wireless AP?

Thu Nov 16, 2017 2:43 am

aqpeeb wrote:
Wed Nov 15, 2017 8:21 pm
I think this is a better solution. Involving udev. No script needed, no reboot needed, no change to rc.local.
https://github.com/peebles/rpi3-wifi-station-ap
But it does not work for Stretch, does it?
Today's installations of Raspbian become unreachable via network as soon as you touch /etc/network/interfaces

aqpeeb
Posts: 4
Joined: Wed Nov 15, 2017 8:18 pm

Re: Pi 3 as wiireless client and wireless AP?

Thu Nov 16, 2017 4:38 am

Hm. I've been using PiBakery to build my SD card. I guess I thought PiBakery was keeping up to date with latest Rasbian images, but maybe its not. How can I tell if I am using "stretch"?

# uname -a
Linux mybox 4.9.28-v7+ #998 SMP Mon May 15 16:55:39 BST 2017 armv7l GNU/Linux

Sounds like I should stay away from it, if ya can't touch /etc/network/interfaces !!

Honestly I was not following the whole thread. When I hit the original solution with a script in /usr/local/bin called by rc.local, I started looking at using udev rules in an attempt at a "cleaner" alternative.

SurferTim
Posts: 1764
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Pi 3 as wiireless client and wireless AP?

Thu Nov 16, 2017 11:30 am

@aqpeeb: The main question is: Does it work?

To determine OS version

Code: Select all

cat /etc/os-release
cat /etc/rpi-issue

aqpeeb
Posts: 4
Joined: Wed Nov 15, 2017 8:18 pm

Re: Pi 3 as wiireless client and wireless AP?

Sat Nov 18, 2017 7:36 pm

$ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

$ cat /etc/rpi-issue
Raspberry Pi reference 2017-06-21
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, d2b8d634b9b79d34b4aec10ce75f3503c439f6eb, stage2

Looks like its older. I'll give it a try on stretch.

SurferTim
Posts: 1764
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Pi 3 as wiireless client and wireless AP?

Sat Nov 18, 2017 9:23 pm

It is a late version of Jessie. I've migrated to Stretch 2017-09-07. So far, so good.

I have 8 uSD cards that I test with. It allows me to play and have a little fun.

aqpeeb
Posts: 4
Joined: Wed Nov 15, 2017 8:18 pm

Re: Pi 3 as wiireless client and wireless AP?

Sun Nov 19, 2017 1:20 am

One issue is that dhcpcd is launching wpa_supplicant on every phy0 interface that comes up. This is done via /lib/dhcpcd/dhcpcd-hooks/10-wpa_supplicant. I tried working with this in various ways, including adding a "wpa_supplicant-uap0.conf" file that looks like (http://blog.hoxnox.com/gentoo/wifi-hotspot.html), and NOT using hostapd, but that didn't work. I finally just removed /lib/dhcpcd/dhcpcd-hooks/10-wpa_supplicant and worked with wpa_supplicant manually (via /etc/network/interfaces).

Another issue seems to be https://unix.stackexchange.com/question ... tion-not-p, some sort of race condition when creating interfaces at or near the same time (!?!). The "solution" to this is to re-jingle the station interface in /etc/rc.local after a small delay.

With these changes, I have something that works in stretch, although I am not pleased with it. See https://github.com/peebles/rpi3-wifi-station-ap-stretch for detailed instructions.

We should keep working on this. I think maybe the key is dhcpcd. I do not like the /etc/rc.local requirement either.

sora03
Posts: 188
Joined: Mon Dec 29, 2014 4:11 pm
Contact: Website

Re: Pi 3 as wiireless client and wireless AP?

Fri Nov 24, 2017 10:38 am

can anyone test if this works on Pi 3: https://github.com/oblique/create_ap
I have a broadcom laptop and creating wifi client to wifi AP does not work but when i bought a atheros chipset based wifi card I can use wifi client and wifi ap at the same time. sadly Pi has a broadcom so wifi client and wireless ap at the same time may not work.
FLOSS enthusiast, Debian user (linux-libre)

Return to “Networking and servers”