lukicdarkoo / rpi-wifi

Configures simultaneous AP and Managed Mode Wifi on Raspberry Pi
GNU General Public License v3.0
532 stars 120 forks source link

Support for Raspberry Pi 3 #11

Open MkLHX opened 4 years ago

MkLHX commented 4 years ago

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!](https://www.bountysource.com/issues/86508221-support-for-raspberry-pi-3?utm_campaign=plugin&utm_content=tracker%2F97445956&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F97445956&utm_medium=issues&utm_source=github).
lukicdarkoo commented 4 years ago

This script works only for Raspberry Pi Zero W. I failed to make it work on Raspberry Pi 3, but if you managed to run AP+client mode simultaneously please share the steps with me and I will integrate into the script.

MkLHX commented 4 years ago

Hi @lukicdarkoo

Just see my forked project to make it works on rpi3 b+ and rpi3 a+ https://github.com/MkLHX/AP_STA_RPI_SAME_WIFI_CHIP

lukicdarkoo commented 4 years ago

Cool! You brought it to another level!

I am not sure whether is a good idea to integrate the changes or just to redirect the users. I guess, for now, all users who need support for Raspberry Pi 3 should check your fork.

lukicdarkoo commented 4 years ago

I renamed and pinned the issue, so users can find it more easily.

moinologics commented 3 years ago

@lukicdarkoo is there any script for raspberry pi 4B???

MkLHX commented 3 years ago

hi @ProgrammingPlanet did try this on RPI4B ? => https://github.com/MkLHX/AP_STA_RPI_SAME_WIFI_CHIP

I don't have any RPI4 to test it. If you can it will be great to know if it's work on it.

moinologics commented 3 years ago

ok, I will reply after testing it.

also, I suggest working on this on an exiting project called raspap-webgui if possible

MkLHX commented 3 years ago

@ProgrammingPlanet lol i've tested raspap and this not work well (for me) and i just need shell script for my use case. So you can provide my repo on raspap project to give altenative ;-)

Good test.

moinologics commented 3 years ago

getting this -----------

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Populate /etc/udev/rules.d/70-persistent-net.rules

Populate /etc/dnsmasq.conf

Populate /etc/hostapd/hostapd.conf

Populate /etc/default/hostapd

Populate /etc/wpa_supplicant/wpa_supplicant.conf

Populate /etc/network/interfaces

Populate /bin/manage-ap0-iface.sh

Create hostapd ap0 error monitor crontask no crontab for root

----- no success

MkLHX commented 3 years ago

as you can read at the end. You need cron on your server and we assume you have an existing crontab .

EDIT: @ProgrammingPlanet you can test last 1.1 release i changed dependencies check.

FunkyKwak commented 3 years ago

Hi,

Thanks a lot for your work and for the share !

I am trying to make this work on a fresh RPI3B+ with RPI OS Lite.

I was getting the exact same error as @ProgrammingPlanet. So I simply created a crontab using sudo crontab -e, and added a comment in there. Now I don't have the message no crontab for root anymore, but I still have this one Create hostapd ap0 error monitor crontask.

Thanks a lot for your help !

MkLHX commented 3 years ago

hi @FunkyKwak that not an error, maybe bad english sentence but not an error https://github.com/MkLHX/AP_STA_RPI_SAME_WIFI_CHIP/blob/master/ap_sta_config#L315

ImanolGo commented 3 years ago

@MkLHX I've just tested it on the Raspberry Pi 4B, running the Raspbian GNU/Linux 10 (buster) Lite and it's running smoothly. However, I had the same issue as @FunkyKwak to edit the cron file manually using "sudo crontab -e". For some reason using I cannot use "sudo crontab -l" to add directly a line. Have you encountered the same problem?

MkLHX commented 3 years ago

@ImanolGo Sorry for late answer.

I never get this kind of issue.

What's happened when you edit crontab -e? And then get crontab -l ?

What version of code are you using?

ImanolGo commented 3 years ago

@MkLHX so the main problem is calling the script as super user using "sudo". "crontab -l" complains "no crontab for root". However editing manually with "sudo crontab -e" works.

MkLHX commented 3 years ago

@MkLHX so the main problem is calling the script as super user using "sudo". "crontab -l" complains "no crontab for root". However editing manually with "sudo crontab -e" works.

The script need to be run with sudo rights. So that use the sudo crontab and need the crontab exists.

Maybe there is a solution to automate it. I haven't time to search and test it for now...

MkLHX commented 3 years ago

hi there i've just push a release 1.7 who fix the crontab error and i open issues on the repo, i don't know why they're closed untill today.

https://github.com/MkLHX/AP_STA_RPI_SAME_WIFI_CHIP/releases/tag/1.7.2