Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update ap_sta_config.sh #3

Closed
wants to merge 9 commits into from
Closed

update ap_sta_config.sh #3

wants to merge 9 commits into from

Conversation

ipitio
Copy link

@ipitio ipitio commented Aug 17, 2021

  • Added some changes from a pull request to rpi-wifi: update to buster lukicdarkoo/rpi-wifi#26
  • Added 802.11n support to hostapd.conf
  • Fixed bash variable syntax and a typo in manage-ap0-iface.sh
  • Disabled wifi controller power_save
  • Added path to commands in rpi-wifi.sh

ipitio added 4 commits August 17, 2021 01:28
* Added some changes from a pull request to rpi-wifi: lukicdarkoo#26
* Added 802.11n support to hostapd.conf, as well as restricted it to allowed frequencies
* Fixed bash variable syntax and a typo in manage-ap0-iface.sh
* Added paths to commands to prevent "command not found" errors
* Added set power_save off commands, since the pi wifi controller has power_save on by default, to prevent the pi from becoming randomly inaccessible
@MkLHX
Copy link
Owner

MkLHX commented Sep 9, 2021

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.

Copy link
Owner

@MkLHX MkLHX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why use systemctl status hostapd instead of service??

Copy link
Owner

@MkLHX MkLHX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why add /sbin/ before each command?
There is a power save mode on Wifi on buster? I never see anything about this.
It's turned on by default?

@ipitio
Copy link
Author

ipitio commented Sep 11, 2021

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
Copy link
Owner

MkLHX commented Sep 13, 2021

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
Copy link
Author

ipitio commented Sep 13, 2021

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
Copy link
Owner

MkLHX commented Sep 14, 2021

@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
Copy link

wohaoa commented Sep 17, 2021

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

@akumpf
Copy link

akumpf commented Jan 14, 2022

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

  • Search for $DAEMON_OPTS ${DAEMON_CONF} and replace with /etc/hostapd/hostapd.conf

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

@ipitio
Copy link
Author

ipitio commented Jan 14, 2022

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
Copy link

akumpf commented Jan 14, 2022

@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
Copy link
Owner

MkLHX commented Jan 14, 2022

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
Copy link
Owner

MkLHX commented Jan 14, 2022

@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
Copy link
Owner

MkLHX commented Jan 14, 2022

Also i have to repeat my post on september 2020 here:
#3 (comment)
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
Copy link

akumpf commented Jan 14, 2022

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

  • it leverages services (i.e. no cron) for monitoring.
  • it doesn't hard-code a MAC address (i.e. you can clone the filesystem, and then boot on another pi, though haven't tested that myself yet).
  • It's all contained in one script (no secondary cron helper script needed); simpler to debug and tweak.
  • it seems to work well on the latest Raspberry Pi OS distro (Bullseye) and can work on the new Pi Zero 2 W. The other/main version breaks the wifi and it becomes unreachable on the Pi Zero 2 W; not sure what the cause is, but the fact that this new version worked was a nice surprise.

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
Copy link
Owner

MkLHX commented Jan 20, 2022

@ipitio i merged #12
on master so i think i can close this PR. What do you think?

@ipitio
Copy link
Author

ipitio commented Jan 20, 2022

Yep!

@ipitio ipitio closed this Jan 20, 2022
MkLHX added a commit that referenced this pull request Jun 7, 2023
…nimatch-3.0.8

Bump minimatch from 3.0.4 to 3.0.8 in /docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants