Git Product home page Git Product logo

rpi-wifi's Introduction

rpi-wifi's People

Contributors

bezineb5 avatar clach04 avatar condector avatar lukicdarkoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rpi-wifi's Issues

how to set static Ip?

Hi,
Your work is excellent, It worked for me. One thing i am struggling is to set static ip to wlan0 with associated clients. still it should be able to act as both station and access point.
I have tried below things

in /etc/network/interfaces changed

allow-hotplug wlan0
iface wlan0 inet static
address 192.168.0.200
        netmask 255.255.255.0
        gateway 192.168.0.1
    wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

yet no success, in this case ifup wlan0 doesn't work well. I am new to networking kindly help me with the feature.

Access the RPI from the WLAN0 not possible

Hi,
I dont know exactly how this happens but there is a point when it is no longer possible to reach the raspberry thru the WLAN0 ip address when connected to the same WIFI Router.
But it is possible to connect thru the RPI AP and, once inside, its also possible to reach any destination behind the WLAN0 (Internet included).

Its like if there is a firewall blocking incoming connections from the WLAN0.

But it was working before... I manually changed the details of the /etc/wpa_supplicant/wpa_suppliant.conf but don't think that is the issue.. because it is correctly connected to the Router and the RPI can access the network behind the WLAN0.

what could be happening?

Kind regards.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

A Few Changes for the Script to Work with Pi Zero 2W and Bullseye

I made a couple of changes to get the code to work on a Pi Zero 2 W running Debian Bullseye.

  1. Populate /etc/wpa_supplicant/wpa_supplicant.conf section
    I added in the configuration for the AP network and named it AP1, since according to the original article that has to start first (just easier for me to keep the labels organized in my mind). The client is now AP2:
network={
    ssid="${AP_SSID}"
    $([ $AP_PASSPHRASE ] && echo "psk=\"${AP_PASSPHRASE}\"")
    scan_ssid=1
    key_mgmt=WPA-PSK
    id_str="AP1"
}
  1. Populate /etc/network/interfaces section
    Add the line iface AP2 inet dhcp right before the EOF to take into account the change above.

  2. Populate /bin/start_wifi.sh section.
    I was having issues with /var/run/wpa_supplicant/wlan0 hanging around from previous invocations of wpa_supplicant as the Pi booted up, so I added the line sudo rm /var/run/wpa_supplicant/wlan0 right after the sleep(30) line.

  3. I changed line 191 to read sudo crontab -l 2>/dev/null | { cat; echo "@reboot /bin/rpi-wifi.sh"; } | sudo crontab - so the contab reboot entry would run at every reboot as root as suggested in the original article.

I hope these changes saves others some time in getting everything set up.

WLAN0 is not staying connected

Used the script and installed without issue. my AP comes up and can connect and is stable.
issue seems to be wlan0 dropping, it stays up for say 30 seconds then drops then comes back again after period of time

any ideas

ssh and RDP via MyAP

Hello,

I have install your script it works fantasic ! Thanks!

I can connect to MyAP en I receive the correct ip and gateway etc. Now I will connect with ssh or rdp from my laptop. It works good before I install your script. Must I add someware the interface that he will listen on the new interface ?

regards,
Henri Apperloo

WLAN0 not connecting to broader internet

I tried using this script with the updates @mahesh2000 mentioned here on my Raspberry Pi Zero W, however I'm unable to get wlan0 to connect to the broader internet. My AP SSID works and I'm able to connect to my RPi W 0 via ssh, however not able to ping any external website (or run any apt commands). If I run ip addr both wlan0 and ap0 seem to be up and have correct IP addresses. Any ideas?


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

No traffic forwarded to internet

Hi so I thought I had this working correctly but I can seem get internet traffic to pass through the AP to the internet. For example when I ssh into the RaspPi and ping outside my home network:

lombardo@raspberrypi:~ $ ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
64 bytes from 1.1.1.1: icmp_seq=1 ttl=58 time=17.8 ms
64 bytes from 1.1.1.1: icmp_seq=2 ttl=58 time=21.3 ms
64 bytes from 1.1.1.1: icmp_seq=3 ttl=58 time=19.8 ms
64 bytes from 1.1.1.1: icmp_seq=4 ttl=58 time=18.7 ms

Now if I connect my laptop to the RaspPi AP and ping from my laptops terminal:

Fedallahs-MacBook-Pro:~ lombardo$ ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1): 56 data bytes
ping: sendto: No route to host
ping: sendto: No route to host
Request timeout for icmp_seq 0
ping: sendto: No route to host
Request timeout for icmp_seq 1
ping: sendto: No route to host
Request timeout for icmp_seq 2
ping: sendto: No route to host
Request timeout for icmp_seq 3
ping: sendto: No route to host
Request timeout for icmp_seq 4
--- 1.1.1.1 ping statistics ---
6 packets transmitted, 0 packets received, 100.0% packet loss

I ran the script only replacing the the following variables: MyAP myappass WifiSSID wifipass. Do you have an idea why the information is not being forwarded from the RaspPi to my home network?


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Maximum number of clients (STA) that attach to AP?

Do you have any benchmark as to how many clients (STA) can attach to Pi 4B (Buster Raspbian OS) with this method?

Our approach (not this method uses hostapd and wpa_supplicant) shows that only 4 or 5 max before it slows or drops connections.

Some have suggested the CYW43455 on-chip RAM (not DDR) is the limiting factor.

Thanks for posting.

-Mike
Chicago, IL


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

NO_INTERNET flag is undefined

Regarding this line:

$([ "$NO_INTERNET" != "true" ] && echo "sudo sysctl -w net.ipv4.ip_forward=1")

Running the script throws an error when running without defining -n due to NO_INTERNET being unset, causing it to not evaluate, and the && isn't run.

A quick hacky alternative would be:
[ "x${NO_INTERNET}" = "xtrue" ]
As this way, even if NO_INTERNET is unset/undefined, the statement can still evaluate.

Installation Fail on raspbian buster - Pi Zero W

Hi, thx you for your work on this script

i'm trying to install the script but crash on these errors :

...
Fetched 1,099 kB in 2s (527 kB/s)         
Selecting previously unselected package hostapd.
(Reading database ... 37646 files and directories currently installed.)
Preparing to unpack .../hostapd_2%3a2.7+git20190128+0c1e29f-6_armhf.deb ...
Unpacking hostapd (2:2.7+git20190128+0c1e29f-6) ...
Selecting previously unselected package dhcpcd.
Preparing to unpack .../dhcpcd_1%3a3.2.3-11_armhf.deb ...
Unpacking dhcpcd (1:3.2.3-11) ...
Selecting previously unselected package dns-root-data.
Preparing to unpack .../dns-root-data_2019031302_all.deb ...
Unpacking dns-root-data (2019031302) ...
Selecting previously unselected package dnsmasq-base.
Preparing to unpack .../dnsmasq-base_2.80-1+rpt1_armhf.deb ...
Unpacking dnsmasq-base (2.80-1+rpt1) ...
Selecting previously unselected package dnsmasq.
Preparing to unpack .../dnsmasq_2.80-1+rpt1_all.deb ...
Unpacking dnsmasq (2.80-1+rpt1) ...
Setting up dnsmasq-base (2.80-1+rpt1) ...
Setting up dns-root-data (2019031302) ...
Setting up dnsmasq (2.80-1+rpt1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/dnsmasq.service → /lib/systemd/system/dnsmasq.service.
Setting up hostapd (2:2.7+git20190128+0c1e29f-6) ...
Created symlink /etc/systemd/system/multi-user.target.wants/hostapd.service → /lib/systemd/system/hostapd.service.
Job for hostapd.service failed because the control process exited with error code.
See "systemctl status hostapd.service" and "journalctl -xe" for details.
Created symlink /etc/systemd/system/hostapd.service → /dev/null.
Setting up dhcpcd (1:3.2.3-11) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for dbus (1.12.16-1) ...
Processing triggers for systemd (241-7~deb10u1+rpi1) ...
bash: line 162: NO_INTERNET: unbound variable
bash: line 162: NO_INTERNET: unbound variable
bash: line 162: NO_INTERNET: unbound variable
no crontab for pi

I'm working using a Raspberry Pi Zero W, on a fresh install of Raspbian Buster (official)

running the script with :

curl https://raw.githubusercontent.com/lukicdarkoo/rpi-wifi/master/configure | bash -s -- -a Love test -c Mywifi password

I'll Be happy if you can help me to find a solution for this. :)

which settings i need to change, to not rout internet to connected device

Hello There,
It's an amazing and very quick solution.

but i want something like this:
mesh network -1

-->Rpi working on both mode AP+STA simultaneously, it's working with your script nicely.

-->Now esp8266 as a wifi client connects to the Rpi's access point and send sensor data to raspberry pi without internet over TCP communication between them. (here TCP server running on Rpi Static Ip )
and raspberry pi connected to home router in STA mode(in background) sending this data to server or MQTT. (I had Done this whole thing with ESP8266 as a wifi gateway and esp8266 as a client but to handle big network i want to use raspberry pi)

with your script Rpi working in AP+STA But it also rout the internet to connected device or it gives internet facility to each and every connected device, for my application this thing slowing down the internet connection if there is 5-6 devices. your script is making raspberry pi a INTERNET ROUTER"

So which lines i have to change to not rout the internet to connected devices?

Error check passphrase length

This works great on fresh Raspbian Lite install on PiZeroW.

I used a too-short passphrase (<8 len) and hostapd failed, with no obvious error in journalctl until I ran it manually.

Very minor, but we could check the passphrase length.

Thanks again.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

nameserver being set to 127.0.0.1 in /etc/resolv.conf

I installed this to a Raspberry Pi Zero W and nameserver in /etc/resolv.conf is being set to 127.0.0.1 and preventing wlan0 from having access to the internet

To prevent this you have to add DNSMASQ_EXCEPT=lo to the end of /etc/default/dnsmasq
When it is added nameserver is properly set to 8.8.8.8
This may be the solution to #15


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

AP only shows up on wifi list briefly

I have run this script on a RPI 4 using Buster, and my AP only shows up for a few seconds after reboot, and then disappears off my WiFi list almost immediately, and the only way to get it to show back up is seemingly reboot the pi itself.

Turn off power management

Hi,

thanks for this nice script!
It works nice on Raspberry Pi Zero wh. It seems to work better with the power management turned off. If someone wants to do that for ap0 and wlan0, just add following lines to /etc/network/interfaces:

post-up iw ap0 set power_save off
post-up iw wlan0 set power_save off


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

doesn't work

on my fresh installed bullseye lite on the pi4 wifi script doesn't work, 'no crontab for pi' is the last message

Raspberry Pi 4, had to remove ctrl_interface

Thank you for this script! I tried it on a raspberry pi 4 and it works fine, just with some changes.

I had to remove from /etc/hostapd/hostapd.conf

ctrl_interface=/var/run/hostapd
ctrl_interface_group=0

After reboot both ap0 and wlan0 got an IP, but something still feels wrong. Accessing the pi from ssh ( through eth0 ) was jittery. Also checking ip monitor I was getting a lot more logs than usual

ip montor logs

root@raspberrypi:~# ip monitor
10.0.0.2 dev eth0 lladdr b0:7f:b9:9c:42:3c PROBE
10.0.0.2 dev eth0 lladdr b0:7f:b9:9c:42:3c REACHABLE
4: ap0: <BROADCAST,MULTICAST,UP,LOWER_UP>
link/ether
4: ap0: <NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state DORMANT group default
link/ether e4:5f:01:1a:bd:91 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP>
link/ether
Deleted 224.0.0.22 dev ap0 lladdr 01:00:5e:00:00:16 NOARP
Deleted 224.0.0.251 dev ap0 lladdr 01:00:5e:00:00:fb NOARP
Deleted ff02::fb dev ap0 lladdr 33:33:00:00:00:fb NOARP
Deleted ff02::1:ffae:1f69 dev ap0 lladdr 33:33:ff:ae:1f:69 NOARP
Deleted ff02::16 dev ap0 lladdr 33:33:00:00:00:16 NOARP
Deleted ff02::2 dev ap0 lladdr 33:33:00:00:00:02 NOARP
4: ap0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state UP group default
link/ether e4:5f:01:1a:bd:91 brd ff:ff:ff:ff:ff:ff
Deleted 4: ap0 inet6 fe80::1a43:4d05:ecae:1f69/64 scope link
valid_lft forever preferred_lft forever
Deleted local fe80::1a43:4d05:ecae:1f69 dev ap0 table local proto kernel metric 0 pref medium
Deleted fe80::/64 dev ap0 proto kernel metric 256 pref medium
Deleted 224.0.0.251 dev wlan0 lladdr 01:00:5e:00:00:fb NOARP
Deleted 224.0.0.22 dev wlan0 lladdr 01:00:5e:00:00:16 NOARP
Deleted ff02::fb dev wlan0 lladdr 33:33:00:00:00:fb NOARP
Deleted ff02::1:ff6a:e280 dev wlan0 lladdr 33:33:ff:6a:e2:80 NOARP
Deleted ff02::16 dev wlan0 lladdr 33:33:00:00:00:16 NOARP
Deleted ff02::2 dev wlan0 lladdr 33:33:00:00:00:02 NOARP
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default
link/ether e4:5f:01:1a:bd:91 brd ff:ff:ff:ff:ff:ff
4: ap0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default
link/ether e4:5f:01:1a:bd:91 brd ff:ff:ff:ff:ff:ff
4: ap0: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN group default
link/ether e4:5f:01:1a:bd:91 brd ff:ff:ff:ff:ff:ff
Deleted 224.0.0.251 dev ap0 lladdr 01:00:5e:00:00:fb NOARP
Deleted multicast ff00::/8 dev ap0 table local proto kernel metric 256 linkdown pref medium
Deleted ff02::16 dev ap0 lladdr 33:33:00:00:00:16 NOARP
Deleted 4: ap0 inet 169.254.221.64/16 brd 169.254.255.255 scope global noprefixroute ap0
valid_lft forever preferred_lft forever
Deleted local 169.254.221.64 dev ap0 table local proto kernel scope host src 169.254.221.64
4: ap0 inet6 fe80::1a43:4d05:ecae:1f69/64 scope link tentative
valid_lft forever preferred_lft forever
Deleted 3: wlan0 inet6 fe80::c2a3:4298:386a:e280/64 scope link
valid_lft forever preferred_lft forever
Deleted local fe80::c2a3:4298:386a:e280 dev wlan0 table local proto kernel metric 0 pref medium
Deleted fe80::/64 dev wlan0 proto kernel metric 256 linkdown pref medium
Deleted 3: wlan0 inet 10.0.0.10/24 brd 10.0.0.255 scope global dynamic wlan0
valid_lft 3592sec preferred_lft 3142sec
Deleted broadcast 10.0.0.255 dev wlan0 table local proto kernel scope link src 10.0.0.10 linkdown
Deleted local 10.0.0.10 dev wlan0 table local proto kernel scope host src 10.0.0.10
Deleted 224.0.0.251 dev wlan0 lladdr 01:00:5e:00:00:fb NOARP
Deleted 4: ap0 inet6 fe80::1a43:4d05:ecae:1f69/64 scope link tentative
valid_lft forever preferred_lft forever
4: ap0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default
link/ether e4:5f:01:1a:bd:91 brd ff:ff:ff:ff:ff:ff
broadcast 10.1.0.255 dev ap0 table local proto kernel scope link src 10.1.0.231 linkdown
10.1.0.0/24 dev ap0 proto kernel scope link src 10.1.0.231 linkdown
multicast ff00::/8 dev ap0 table local proto kernel metric 256 pref medium
4: ap0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default
link/ether e4:5f:01:1a:bd:91 brd ff:ff:ff:ff:ff:ff
4: ap0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default
link/ether e4:5f:01:1a:bd:91 brd ff:ff:ff:ff:ff:ff
fe80::/64 dev ap0 proto kernel metric 256 pref medium
4: ap0 inet6 fe80::1a43:4d05:ecae:1f69/64 scope link tentative
valid_lft forever preferred_lft forever
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP>
link/ether
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN group default
link/ether e4:5f:01:1a:bd:91 brd ff:ff:ff:ff:ff:ff
Deleted 224.0.0.22 dev wlan0 lladdr 01:00:5e:00:00:16 NOARP
Deleted multicast ff00::/8 dev wlan0 table local proto kernel metric 256 linkdown pref medium
Deleted ff02::16 dev wlan0 lladdr 33:33:00:00:00:16 NOARP
4: ap0 inet6 fe80::1a43:4d05:ecae:1f69/64 scope link
valid_lft forever preferred_lft forever
local fe80::1a43:4d05:ecae:1f69 dev ap0 table local proto kernel metric 0 pref medium
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default
link/ether e4:5f:01:1a:bd:91 brd ff:ff:ff:ff:ff:ff
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP>
link/ether
multicast ff00::/8 dev wlan0 table local proto kernel metric 256 pref medium
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP>
link/ether
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP>
link/ether
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP>
link/ether
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default
link/ether e4:5f:01:1a:bd:91 brd ff:ff:ff:ff:ff:ff
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state DORMANT group default
link/ether e4:5f:01:1a:bd:91 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default
link/ether e4:5f:01:1a:bd:91 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default
link/ether e4:5f:01:1a:bd:91 brd ff:ff:ff:ff:ff:ff
fe80::/64 dev wlan0 proto kernel metric 256 pref medium
3: wlan0 inet6 fe80::c2a3:4298:386a:e280/64 scope link tentative
valid_lft forever preferred_lft forever
Deleted 3: wlan0 inet6 fe80::c2a3:4298:386a:e280/64 scope link tentative
valid_lft forever preferred_lft forever
Deleted fe80::/64 dev wlan0 proto kernel metric 256 pref medium
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default
link/ether e4:5f:01:1a:bd:91 brd ff:ff:ff:ff:ff:ff
fe80::/64 dev wlan0 proto kernel metric 256 pref medium
3: wlan0 inet6 fe80::c2a3:4298:386a:e280/64 scope link tentative
valid_lft forever preferred_lft forever
3: wlan0 inet 10.0.0.10/24 brd 10.0.0.255 scope global dynamic wlan0
valid_lft 3600sec preferred_lft 3600sec
local 10.0.0.10 dev wlan0 table local proto kernel scope host src 10.0.0.10
broadcast 10.0.0.255 dev wlan0 table local proto kernel scope link src 10.0.0.10
10.0.0.0/24 dev wlan0 proto kernel scope link src 10.0.0.10
default via 10.0.0.1 dev wlan0
3: wlan0 inet 10.0.0.10/24 brd 10.0.0.255 scope global dynamic wlan0
valid_lft 3600sec preferred_lft 3150sec
10.0.0.0/24 dev wlan0 proto dhcp scope link src 10.0.0.10 metric 303
Deleted 10.0.0.0/24 dev wlan0 proto kernel scope link src 10.0.0.10
default via 10.0.0.1 dev wlan0 proto dhcp src 10.0.0.10 metric 303
Deleted default via 10.0.0.1 dev wlan0
10.0.0.8 dev wlan0 lladdr f0:2f:4b:10:be:c8 REACHABLE
3: wlan0 inet6 fe80::c2a3:4298:386a:e280/64 scope link
valid_lft forever preferred_lft forever
local fe80::c2a3:4298:386a:e280 dev wlan0 table local proto kernel metric 0 pref medium
4: ap0 inet 169.254.221.64/16 brd 169.254.255.255 scope global noprefixroute ap0
valid_lft forever preferred_lft forever
local 169.254.221.64 dev ap0 table local proto kernel scope host src 169.254.221.64
broadcast 169.254.255.255 dev ap0 table local proto kernel scope link src 169.254.221.64
169.254.0.0/16 dev ap0 scope link src 169.254.221.64 metric 304

I also noticed that on system status hostapd I get the following error:

May 06 15:33:35 raspberrypi systemd[1]: hostapd.service: Scheduled restart job, restart counter is at 1329.
May 06 15:33:35 raspberrypi systemd[1]: Stopped Access point and authentication server for Wi-Fi and Ethernet.
May 06 15:33:35 raspberrypi systemd[1]: Starting Access point and authentication server for Wi-Fi and Ethernet...
May 06 15:33:35 raspberrypi hostapd[44157]: Configuration file: /etc/hostapd/hostapd.conf
May 06 15:33:35 raspberrypi hostapd[44157]: ctrl_iface exists and seems to be in use - cannot override it
May 06 15:33:35 raspberrypi hostapd[44157]: Delete '/var/run/hostapd/ap0' manually if it is not used anymore
May 06 15:33:35 raspberrypi hostapd[44157]: Failed to setup control interface for ap0
May 06 15:33:35 raspberrypi hostapd[44157]: ap0: Unable to setup interface.
May 06 15:33:35 raspberrypi hostapd[44157]: ap0: interface state UNINITIALIZED->DISABLED
May 06 15:33:35 raspberrypi hostapd[44157]: ap0: AP-DISABLED
May 06 15:33:35 raspberrypi hostapd[44157]: ap0: CTRL-EVENT-TERMINATING
May 06 15:33:35 raspberrypi hostapd[44157]: hostapd_free_hapd_data: Interface ap0 wasn't started
May 06 15:33:35 raspberrypi hostapd[44157]: nl80211: deinit ifname=ap0 disabled_11b_rates=0

I then removed ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev from /etc/wpa_supplicant/wpa_supplicant.conf and this seems to have improved the problem. No more jittering and ip monitor log looks more normal. But I also lost the ability to use wpa_cli

I wonder if there's a better solution than this that can allow me to use wpa_cli

Unable to open a new ssh connection after running script

I have been trying to set-up a wireless access-point on my new Raspberry Pi Zero. I stumbled up this script after reading this guide https://blog.thewalr.us/2017/09/26/raspberry-pi-zero-w-simultaneous-ap-and-managed-mode-wifi/ and decided it would be faster to configure my Pi using it. However after running the script and rebooting my Pi, I noticed that while my access point was up and running, I was no longer able to open an SSH connection into the Pi. This has made it impossible to perform further configurations I had been planning to do, so I had to re-flash the micro-sd and start again. Is there a setting I need to change somewhere before running this script to prevent this from happening?


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Ap not started with crontab

I tried the script, it seems that every thing is OK, but the AP is not available, unless I ran rpi--wifi.sh from the console directly and the crontab is not working.

I have the issue with RPi 4.

1. Line 89. 2. Dhcpd vs dhcpd5

I wanted to comment that I got this up and working on a Zero W using a Kali.rp0w.nexmon as the underlying system. It was fairly straightforward, but not easy at all and required many tweaks. Still, what a time-saver! And it ultimately works.

I wanted to point out that the closing quote is missing in line 89. I added it.

apt install dhcpd does not work in Kali, which suggests dhcpd5 instead, which works the same (kali-rolling main non-free contrib / armel).


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Support for Raspberry Pi 3

Hi there!
I forked the repo to make some test with this script.
https://github.com/MkLHX/AP_STA_RPI_SAME_WIFI_CHIP

I have some troubles on RPI3A who run raspbian buster, when i run the configure.sh script with args after reboot i can see the AP ssid and i can use it! But if i reboot the RPI, il loose the AP mode and i can't access on the RPI through ssh.
It's look like in second state....
Then i have to reboot the RPI a second time and the AP reappears.

EDIt: find something

On boot hostapd can't start and give an error. So i chech journalctl -ex and hostapd give:

-- L'unité (unit) hostapd.service a commencé à démarrer.
janv. 07 16:19:32 timelapse hostapd[1340]: Configuration file: /etc/hostapd/hostapd.conf
janv. 07 16:19:32 timelapse hostapd[1340]: ctrl_iface exists and seems to be in use - cannot override it
janv. 07 16:19:32 timelapse hostapd[1340]: Delete '/var/run/hostapd/ap0' manually if it is not used anymore
janv. 07 16:19:32 timelapse hostapd[1340]: Failed to setup control interface for ap0
janv. 07 16:19:32 timelapse hostapd[1340]: ap0: Unable to setup interface.
janv. 07 16:19:32 timelapse hostapd[1340]: ap0: interface state UNINITIALIZED->DISABLED
janv. 07 16:19:32 timelapse hostapd[1340]: ap0: AP-DISABLED
janv. 07 16:19:32 timelapse hostapd[1340]: ap0: CTRL-EVENT-TERMINATING
janv. 07 16:19:32 timelapse hostapd[1340]: hostapd_free_hapd_data: Interface ap0 wasn't started
janv. 07 16:19:32 timelapse hostapd[1340]: nl80211: deinit ifname=ap0 disabled_11b_rates=0
janv. 07 16:19:33 timelapse systemd[1]: hostapd.service: Control process exited, code=exited, status=1/FAILURE

So i'm looking for any explaination about the errors :
"ctrl_iface exists and seems to be in use - cannot override it
Delete '/var/run/hostapd/ap0' manually if it is not used "
So i have to find where put the command: sudo rm -rf /var/run/hostapd/ap0
when interface exist cause when i delete it, the hostapd service start.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Feature Request: Accept a list of clients from file

Thinking about using this for travel, it would be great if I could continue to append to a file and collect clients over time and have the script attempt to connect to them in order so I don't have to configure it as I move it around

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.