MkLHX / AP_STA_RPI_SAME_WIFI_CHIP

Configures simultaneous AP and Managed Mode Wifi on Raspberry Pi with the same wifi chip
https://mklhx.github.io/AP_STA_RPI_SAME_WIFI_CHIP/
GNU General Public License v3.0
38 stars 14 forks source link

update ap_sta_config.sh #3

Closed ipitio closed 2 years ago

ipitio commented 3 years ago
MkLHX commented 3 years ago

Hi @ipitio

Thanks for contribution. Sorry for late reply i was never notified by github about this. Could you please ask a little bit more about what is the goal of it's PR.

I ask for that because this script is used every day in production in our devices and i need to be sure before merge anything.

ipitio commented 3 years ago

Hi, sorry for not elaborating! The changes from rpi-wifi#26 may actually be outdated as per the latest commit. In hostapd.conf, the change to enable 802.11n and wmm may result in better speeds and the change to the wpa parameters fix syntax.

why use systemctl status hostapd instead of service??

service is a wrapper for systemctl so there isn't really a reason to use one over the other.

why add /sbin/ before each command?

If someone doesn't have PATH set in the proper place, the current script will return "Command not found" errors. Prepending the full path (in this case /sbin) to each command will prevent this.

There is a power save mode on Wifi on buster? I never see anything about this. It's turned on by default?

There is a power save mode, though I'm not sure whether it's turned on by default; you can check whether it's enabled for wlan0 with iw wlan0 get power_save. If it is ever enabled for wlan0 or ap0, it may result in an unreliable connection, so it's best to make sure it's off.

MkLHX commented 3 years ago

Thx for reply @ipitio

I need to improve changes on my side. Have you push these modifications on you repo? Can i use it for testing the changes?

ipitio commented 3 years ago

Just pushed the latest changes from #26, didn't test yet. The source given for those changes includes instructions for configuring a bridge between eth0 and ap0, which I can implement later.

MkLHX commented 3 years ago

@ipitio Ok so i can't merge for now i have to test it before but haven't the time for now too sorry.

wohaoa commented 2 years ago

@ipitio I executed your branch, but got the following error: ap_sta_config.sh: line 244:DAEMON_OPTS: unbound variable

akumpf commented 2 years ago

@ipitio I executed your branch, but got the following error: ap_sta_config.sh: line 244:DAEMON_OPTS: unbound variable

This error seems to be caused by a leftover variable declaration from the previous version. I replaced the variables that were causing the error, and it seems to be working well for me so far:

edit: I also made the changes @davidmurdoch suggested (ap0@wlan0 changed to ap@wlan0, which occurs twice).

ipitio commented 2 years ago

Thanks @akumpf! What did you replace the variables with?

@MkLHX @davidmurdoch I've also come across RaspAP and linux-wifi-hotspot, which may interest you.

akumpf commented 2 years ago

@ipitio I updated my previous comment to be more explicit.

@MkLHX -- is there any doc/explanation around the ap_sta_cron.sh script? I see it's commented out of this update. Is that something that just needs to be run/installed once? Or re-run after changes are made to the AP/STA parameters?

MkLHX commented 2 years ago

Thanks @akumpf! What did you replace the variables with?

@MkLHX @davidmurdoch I've also come across RaspAP and linux-wifi-hotspot, which may interest you.

Thank you. I know RasAP but it to more complex for my use case but it's a really good project. I don't know linux-wifi-hotspot i'll go to see that in depth.

MkLHX commented 2 years ago

@ipitio I updated my previous comment to be more explicit.

@MkLHX -- is there any doc/explanation around the ap_sta_cron.sh script? I see it's commented out of this update. Is that something that just needs to be run/installed once? Or re-run after changes are made to the AP/STA parameters?

cron job manager is script launch at the en of ap_sta_config.sh Stange behavior on raspberry pi doesn't allow me to edit crontab using ap_sta_config.sh so i split it i n 2 files and call the last at the end here

MkLHX commented 2 years ago

Also i have to repeat my post on september 2020 here: https://github.com/MkLHX/AP_STA_RPI_SAME_WIFI_CHIP/pull/3#issuecomment-918928508 i can't merge for now, i have to take the time to reveiw every edit from every peoples. Here this master version is used on @greenponik product so it's really touchy for me to merge withtout testing the edits and be sure the feature still work on our products. Also it miss some comments about why edition is submit so it's to hard to say "OK " i merge it.

akumpf commented 2 years ago

@MkLHX @ipitio @davidmurdoch I also spotted a couple other things (like a reference to /bin/rpi-wifi.sh, which this update no longer populates)... but also fixable.

What is super nice about this version:

Best approach might be to keep the existing scripts as-is, and create a new V2.x.x script (named ap_st_config2.sh?) that uses this updated approach -- I'll create a new pull with an updated version as the new file. Then perhaps it can be merged in as a secondary/experimental script until it has more eyes on it.

MkLHX commented 2 years ago

@ipitio i merged https://github.com/MkLHX/AP_STA_RPI_SAME_WIFI_CHIP/pull/12 on master so i think i can close this PR. What do you think?

ipitio commented 2 years ago

Yep!