rpi-wifi icon indicating copy to clipboard operation
rpi-wifi copied to clipboard

Support for Raspberry Pi 3

Open MkLHX opened this issue 5 years ago • 17 comments

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.

MkLHX avatar Jan 06 '20 17:01 MkLHX

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.

lukicdarkoo avatar May 11 '20 21:05 lukicdarkoo

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

MkLHX avatar May 11 '20 21:05 MkLHX

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 avatar May 11 '20 21:05 lukicdarkoo

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

lukicdarkoo avatar May 11 '20 22:05 lukicdarkoo

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

moinologics avatar Oct 25 '20 14:10 moinologics

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.

MkLHX avatar Oct 25 '20 14:10 MkLHX

ok, I will reply after testing it.

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

moinologics avatar Oct 25 '20 15:10 moinologics

@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.

MkLHX avatar Oct 25 '20 15:10 MkLHX

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

moinologics avatar Oct 25 '20 16:10 moinologics

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.

MkLHX avatar Oct 26 '20 15:10 MkLHX

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 !

FunkyKwak avatar Jan 20 '21 18:01 FunkyKwak

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

MkLHX avatar Jan 20 '21 18:01 MkLHX

@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?

ImanolGo avatar Mar 04 '21 11:03 ImanolGo

@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?

MkLHX avatar Mar 16 '21 22:03 MkLHX

@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.

ImanolGo avatar Mar 18 '21 13:03 ImanolGo

@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 avatar Mar 27 '21 10:03 MkLHX

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

MkLHX avatar May 19 '21 14:05 MkLHX