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

Autohotspot function #967

Merged
merged 9 commits into from
May 22, 2020
Merged

Autohotspot function #967

merged 9 commits into from
May 22, 2020

Conversation

Groovylein
Copy link
Collaborator

Like in #956 requested, I created a new function in the install script to install a service that checks if a Hotspot is required.

The service checks every 5 minutes if a Hotspot is required. If required it opens up a Hotspot with following credentials:
SSID: phoniebox
Password: PlayItLoud

If connected to the Hotspot you can access the webpage via IP:
10.0.0.5

Now I need testers :)
I was only able to test it on my test environment on a RPi 4

ToDos:

  • Merge with buster script
  • Create a Wiki Page

Copy link
Collaborator

@s-martin s-martin left a comment

Choose a reason for hiding this comment

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

Thanks for implementing this. I think many users have been waiting for that feature.

I would suggest to include that as an selectable option in the buster-install-default.sh script.
I would like to avoid two install scripts, which have to be maintained. The install script already causes enough issues ;-)

@MiczFlor
Copy link
Owner

I would suggest to include that as an selectable option in the buster-install-default.sh script.
I would like to avoid two install scripts, which have to be maintained.

There is one issue, I am not sure if this script covers it: in the Web UI you can add more than one WiFi network. And the Phoniebox will connect to the available one based on a rank order or importance. Here is a screenshot of that page and some info:
https://github.com/MiczFlor/RPi-Jukebox-RFID/wiki/MANUAL#wifi-settings

In the Hotspot script, the SSID and password are taken from the wpa configuration. In my understanding it is possible that there are more than one ssid / passwd combinations in that file.

  1. would that confuse the hotspot script?
  2. implementing in the standard install script: if the hotspot conflicts with the WebUI functionality, it should be kept as a separate script?

@MiczFlor
Copy link
Owner

@Groovylein
thanks for the contribution! I will try it later today.
Because you are also checking if wifi is up or not, possibly you could add your check with ip_address to the script, solving this reported bug: #919

The enable / disable of wifi is here:

:) :) :)

@Groovylein
Copy link
Collaborator Author

Found an issue while running the crontab as root. Fixed it now.

@Groovylein
Copy link
Collaborator Author

Thanks for implementing this. I think many users have been waiting for that feature.

I would suggest to include that as an selectable option in the buster-install-default.sh script.
I would like to avoid two install scripts, which have to be maintained. The install script already causes enough issues ;-)

@s-martin you are right. I only created a separate script to test. I will merge it but I think this feature can be installed always. So no option needed.
What do you think @MiczFlor ?

@Groovylein
Copy link
Collaborator Author

  1. would that confuse the hotspot script?

Multiple SSIDs and Passwords would not affect the hotspot script as long as they are defined within /etc/wpa_supplicant/wpa_supplicant.conf. A list is created in this case.

  1. implementing in the standard install script: if the hotspot conflicts with the WebUI functionality,

It should be kept as a separate script?
I need to check how the WebUI functionality is basically working. In my opinion, I would go with @s-martin and merge it into one script

@Groovylein
Copy link
Collaborator Author

Because you are also checking if wifi is up or not, possibly you could add your check with ip_address to the script, solving this reported bug: #919

The enable / disable of wifi is here:

I only copied the script from the source given in line 1041 😬

I can try adapt this and solve the bug

@Groovylein
Copy link
Collaborator Author

@MiczFlor I've tried the WebUI and the script is working as expected since the WebUI is also using a wpa_supplicant build-in functionality named priority.
The only concern I have is power management which causes some troubles in my setup.
I would merge the scripts together if we decide on installing it as an option or not.

@MiczFlor
Copy link
Owner

Hi @Groovylein @s-martin
I will merge this for now and do some testing. We should merge this into one install script. I will do that later. Need to keep in mind:

  • adding this to the -a option: non-interactive install!!!

@MiczFlor MiczFlor merged commit 44f46a5 into MiczFlor:develop May 22, 2020
@MiczFlor
Copy link
Owner

@Groovylein
looks like there is a file missing in your pull request:

sudo cp "${sample_configs_dir}"/dhcpcd.conf.buster-default-noHotspot.sample "${dhcpcd_conf}"

@Groovylein
Copy link
Collaborator Author

@MiczFlor what do you mean by "missing"?
I did not delete any files from the sample config folder

@MiczFlor
Copy link
Owner

You are right. I was wrong. I thought this was part of the new hotspot setup...

@Dodo121188
Copy link

I can't see any wifi network of phoniebox in my smartphone , if my phoniebox isn't Connected to home-wlan. Do i have to install this Feature separately?

Thx

@s-martin
Copy link
Collaborator

s-martin commented Nov 2, 2020

Yes, it's a separate installer script.

https://github.com/MiczFlor/RPi-Jukebox-RFID/blob/develop/scripts/installscripts/buster-install-default-with-autohotspot.sh

@Dodo121188
Copy link

Can i install it per one line installer? Do i have to install it from naked Buster Image or can i install it over an existing phoniebox?

Sorry for this beginner questions :)

@Dodo121188
Copy link

Sorry i get it, i need help.

I put the Code into a new PhonieboxInstall.conf on home/pi, then make chmod - x, but now i can't start the installer. Can somebody pls help?

@s-martin
Copy link
Collaborator

s-martin commented Nov 26, 2020

What commands did you execute and what results or error messages did you get?

@Groovylein
Copy link
Collaborator Author

@Dodo121188
What do you mean by "I can't start the installer"? What is the output?
Do you maybe have a screenshot?

@Dodo121188
Copy link

st login: Thu Nov 26 08:22:17 2020
pi@phoniebox:~ $ sudo chmod -x PhonieboxInstall.conf
pi@phoniebox:~ $ ./PhonieboxInstall.conf
-bash: ./PhonieboxInstall.conf: Keine Berechtigung
pi@phoniebox:~ $ PhonieboxInstall.conf -a
-bash: PhonieboxInstall.conf: Kommando nicht gefunden.
pi@phoniebox:~ $

@Groovylein
Copy link
Collaborator Author

Groovylein commented Nov 26, 2020

Hi @Dodo121188,
the config file is not meant to be called. We need this for the installation script.
You can keep the config file if you modified it.
Please follow the steps:

  • install last develop-branch with autohotspot with oneliner
    cd; rm buster-install-*; wget https://raw.githubusercontent.com/MiczFlor/RPi-Jukebox-RFID/develop/scripts/installscripts/buster-install-default-with-autohotspot.sh; chmod +x buster-install-default-with-autohotspot.sh; GIT_BRANCH=develop bash ./buster-install-default-with-autohotspot.sh
    (oneliner)
  • reboot

If you experience more problem, please use #956 since this merge is closed

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