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

Merge Autohotspot setup into main install script #2086

Merged

Conversation

AlvinSchiller
Copy link
Collaborator

@AlvinSchiller AlvinSchiller commented Oct 31, 2023

The feature to setup a hotspot automatically if no known network is available lives currently in a separate install script (#967). This script is a duplication of the main install script and misses a few recent changes.

To lower the maintanence effort and make the feature generally available, i merged the changes regarding the autohotspot into the main install script.
Additionally i added a config step, so the user can choose if it shall be activated (defaults to NO). Also the default values for the hotspot can now be changed (non interactive mode is covered).

I would also remove this page https://github.com/MiczFlor/RPi-Jukebox-RFID/wiki/Access-Phoniebox-without-Router as it describes the manuell steps covered by this feature and is also outdated.
Some old sample files have been removed.

  • merge Autohotspot feature into main install script
  • add config step during installation
  • handle non-interactive mode
  • handle deactivation if install script is executed again after first installation
  • add test checks
  • update docs FAQ
  • remove wiki hack Access-Phoniebox-without-Router
  • fix: only run script if WiFi is activated (e.g deactivated via card binding). Otherwise hotspot configuration will be set, and active when WiFi is activated again, even if configured ssids would be available.
  • fix: errorhandling on ssid search. Not handled errorcodes (like 'temporarily not available (-11)' right after enablement of the wifi module) would incorrectly cause the hotspot to be activated. Device and SSID checks have been splited and every result not containing an ssid is handled as error.
  • fix: on wifi activation via command (e.g. card binding) the wifi wasn't configured until the cronjob triggered the autohotspot script. This caused a unnessary wait time for the user. The command logic is now triggering the autohotspot script right after activation. The script has been updated accordingly to handle this situation.
  • added a "--force-hotspot" parameter to the autohotspot script for easy testing

Update docker packages
disable autohotspot service if not selected.
remove old docs
reactivate disable powermanagment.
update comments.
remove obsolete files and calls.
even with multiple invocation we want to keep the first original file.
Delete autohotspot service in helperscript
@s-martin
Copy link
Collaborator

Cool!

@coveralls
Copy link

Pull Request Test Coverage Report for Build 6707480487

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.09%) to 76.727%

Files with Coverage Reduction New Missed Lines %
GPIODevices/two_button_control.py 1 71.43%
Totals Coverage Status
Change from base Build 6585513935: -0.09%
Covered Lines: 633
Relevant Lines: 825

💛 - Coveralls

@Groovylein
Copy link
Collaborator

Good Idea 👍

@AlvinSchiller AlvinSchiller force-pushed the feature/mergeAutohotspotScript branch 2 times, most recently from 1130e4f to 747e3fc Compare November 1, 2023 01:18
@coveralls
Copy link

Pull Request Test Coverage Report for Build 6714477356

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 76.82%

Totals Coverage Status
Change from base Build 6585513935: 0.0%
Covered Lines: 633
Relevant Lines: 824

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build 6726369719

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.03%) to 76.792%

Totals Coverage Status
Change from base Build 6585513935: -0.03%
Covered Lines: 632
Relevant Lines: 823

💛 - Coveralls

@coveralls
Copy link

coveralls commented Nov 1, 2023

Pull Request Test Coverage Report for Build 6754615606

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 76.82%

Totals Coverage Status
Change from base Build 6743891565: 0.0%
Covered Lines: 633
Relevant Lines: 824

💛 - Coveralls

moved autohotspot.sh to sampleconfig
@AlvinSchiller
Copy link
Collaborator Author

The main installation script currently doesn't perform a "deconfiguration" if run again and choose a different settings (eg. for Wifi or Service activation). So the autohotspot feature is aligned with that.
To support it anyway (and also the later activation) the needed setup is entirely moved into a separat script "scripts/helperscripts/setup_autohotspot.sh" and can be run manually by the user to "de-/configure"

on boot or after unblock of wifi the device can give additional errorcodes (-11)
this caused incorrectly a hotspot start
also check for hard blocked wifi
@AlvinSchiller AlvinSchiller marked this pull request as ready for review November 4, 2023 00:57
@s-martin
Copy link
Collaborator

s-martin commented Nov 4, 2023

@AlvinSchiller, ready to merge?

@s-martin s-martin added this to the 2.5 milestone Nov 4, 2023
@AlvinSchiller
Copy link
Collaborator Author

@AlvinSchiller, ready to merge?

Yep. Nothing more from my side.

@s-martin s-martin merged commit c568882 into MiczFlor:develop Nov 4, 2023
23 checks passed
@AlvinSchiller AlvinSchiller deleted the feature/mergeAutohotspotScript branch November 4, 2023 17:18
AlvinSchiller added a commit to AlvinSchiller/RPi-Jukebox-RFID that referenced this pull request Dec 21, 2023
* merge autohotspot setup into main install script

* added autohotspot config step

* fix intendation

* fix tests

* add "iw" to needed packages.
Update docker packages

* refactored into sample confs.
disable autohotspot service if not selected.
remove old docs

* use crontab command.
reactivate disable powermanagment.
update comments.
remove obsolete files and calls.

* hamonized function calls

* only copy original file if not already present.

even with multiple invocation we want to keep the first original file.
Delete autohotspot service in helperscript

* update CODEOWNERS

* remove changes for autohotspot if not selected

* ignore output on service check

* fixes for "clear autohotspot configurations"

* added test for autohotsppt installation

* fix intendation

* check for activated wifi device

* moved autohotspot installation to separate script

moved autohotspot.sh to sampleconfig

* fix remove crontab entry

* unified: dont remove autohotspot configuration

* fix refactored device / ssid check logic

on boot or after unblock of wifi the device can give additional errorcodes (-11)
this caused incorrectly a hotspot start

* fix conf file copy handling on multiple invocation

* update docs

* refactored duplications

* fix for deactivated wifi on startup

also check for hard blocked wifi

* add --force-hotspot option for easier testing

* update script with changes from original source

* extend service handling durin installation

* some clean up

* fix var checks

* update docs

* update docs
@AlvinSchiller AlvinSchiller mentioned this pull request Jan 18, 2024
10 tasks
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.

4 participants