-
Notifications
You must be signed in to change notification settings - Fork 25
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
Button for wifi reset #417
Comments
brilliant idea, i was thinking something like if rpi not connected to wifi or network then make it access pint automatically but button would be better option so gives user control over this. |
I was thinking of using hostapd and the ISC DHCPD server.
The script reads like this: |
@sandreialexandru once again great work, when i press the button for 10 seconds rpi becomes as access point, thinking out loud, anyway to we can setup simple web portal or simple webpage and ask user to enter wifi details and save and reboot rpi |
I'm still working on finding a solution to this. Current kernel has issues with wifi driver for acces point and hostapd does not start. |
@sandreialexandru have look at raspap-webgui maybe you can find solution how they are doing this. |
After many searches and almost giving up, I have found a solution to our problem here Steps:
Stopping here works fine, but I have gone a little further. I thought it would be nice to have the name of the hotspot "PiHOME" with "pihome" as the password so I changed those. The script verifies an md5 for the files so I have eliminated that. The rest remains the same. After the hotspot is up and we are connected we can navigate to 10.0.0.5 and login into PiHOME The script runs at every boot and creates a hotspot when no credentials are found for a wifi network in range. To install the modified version, copy the archive bellow to the root directory follow steps 3, 4, 5. When asked I have chosen option 2 Install Autohotspot with No Internet for connected devices |
Is this compatible with other sbc? i.e orange pi etc?
… On 21 Oct 2020, at 12:25, sandreialexandru ***@***.***> wrote:
After many searches and almost giving up, I have found a solution to our problem here
Steps:
I never got it working without doing rpi-update in the console, so do that
curl "https://www.raspberryconnect.com/images/hsinstaller/AutoHotspot-Setup.tar.gz" -o AutoHotspot-Setup.tar.gz
tar -xzvf AutoHotspot-Setup.tar.gz
cd Autohotspot
sudo ./autohotspot-setup.sh
Stopping here works fine, but I have gone a little further. I thought it would be nice to have the name of the hotspot "PiHOME" with "pihome" as the password so I changed those. The script verifies an md5 for the files so I have eliminated that. The rest remains the same.
After the hotspot is up and we are connected we can navigate to 10.0.0.5 and login into PiHOME
The script runs at every boot and creates a hotspot when no credentials are found for a wifi network in range.
If we delete the file /etc/systemd/system/autohotspot.service the script won't start at every boot and we can call it with a button and python.(script bellow)
WiFi_button_script.zip
To install the modified version, copy the archive bellow to the root directory follow steps 3, 4, 5. When asked I have chosen option 2 Install Autohotspot with No Internet for connected devices
Autohotspot.tar.gz
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I have tested it only on RPi 3B+ and RPi Zero W. |
I m waiting for orange pi delivery any day, once i have it i”ll give it a try, thank you for working on this.
… On 21 Oct 2020, at 15:52, sandreialexandru ***@***.***> wrote:
I have tested it only on RPi 3B+ and RPi Zero W.
I can't say for sure, because I have no any other sbc to test on, but I believe it should work as long as the wifi chip is capable of "listening" mode.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Response from the creator of the script: I see Orange Pi has Debian as a listed OS. If that version is using dhcpcd as the network manger instead of dhcp or other network manager then the script will most likely work. The file /etc/network/interfaces must not be used with this as it will conflict. Lots of older guides online will use this file for network config. you can check with sudo systemctl status dhcpcd if it returns with Active: active (running) then it probably work if you follow the manual guides. I will look at other OS at a future point and see what needs be modified. |
Speaking of wifi reset, has anyone managed lately to get a fallback access point for the gateway? |
no i haven't, still waiting for orange pi delivery, |
Sorry! I meant the WiFi gateway, not serial gateway. |
Yes i have WiFi gateway at home and works great, why you asking? |
I have recently tried the Double Reset Detector library and the WiFiManager library, but none of them seem to work. I want to get an access point fallback for the gateway and not have to re-flash the NodeMCU for every SSID |
I have different sketch that i m using with with custom wifimanager library, if you want i can share with you, including library, it has its web interface with some stats and fall back to access point when wifi not available.
… On 25 Oct 2020, at 19:58, sandreialexandru ***@***.***> wrote:
I have recently tried the Double Reset Detector library and the WiFiManager library, but none of them seem to work. I want to get an access point fallback for the gateway and not have to re-flash the NodeMCU for every SSID
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
That would be great! Thank you in advance! |
@sandreialexandru committed update to ESP8266 gateway sketch |
Thank you! Will download and try. |
I can't get this to work because wifi_ssid and wifi_password are not defined |
did you move wifimanager library to your library folder (i placed it in same folder) |
Yes, I've replaced it with the one that you gave me |
Hi, I've tried the autohotspot script on a Banana Pi M2 Zero and after a few tweeks got it to work, the main problem was that Armbian uses NetworkManager rather than wpasupplicant, but this was no problem to re-configure, also had to install dhcpcd, and modify the installer script. I see this being useful when setting-up from an img file where a wired connection is not available, if building from scratch then you would have already sorted out the network connections. In the img file case wifi will not be configured and the system will default to a hot-spot and the user can connect to the GUI to configure the wifi and reboot. |
Can we make single install script for all boards ? |
I guess so, will have a look. By the way there is a bug in the code - in file /config/hostapd the line DAEMON_CONF="/etc/hostapd/hostapd.config" should read DAEMON_CONF="/etc/hostapd/hostapd.conf" |
Hi, Patched version which will install on Raspbian or Armbian, fixed /config/hostapd and recalculated md5 checksums Will run as AP if no wifi credentials have been set |
An update to fix a couple of Armbian issues, the SSID is PiHomeHotspot and the password is 1234567890 |
Hi, I think this is now working, if not connected to your local wifi network it will startup as a hotspot called PiHome, the IP address will be either 192.168.50.5 or 10.0.0.5, depending if you chose option 1 or 2 in the setup, the password is 1234567890 You can connect with a browser and if in hotspot mode it will enable you to select a SSID and enter the password and then Set and Reboot into connected mode, with the usual login page Attached the latest setup package and new index.php, please re-run autohotspot-setup.sh as it now adds sudo access for the wifi configuration |
@twa127 amazing work! Thank you! |
Hi Guys this will be working on button only or automatically. |
First of all great work @twa127, I think adding option for button to trigger ap mode would be very good addition, but we have to make it to check wird connection or give user option in screen to check box which will ignore wifi setup which might not be a good option, perhaps login screen option to setup wireless settings? |
I see this as a initial set-up mechanism, so don't see the need for a button. I've now added a check for an ethernet connection and if found the normal login page is displayed, if wifi is not configured then the wifi operates as an AP (added another line to /etc/sudoers.d/pihome). If you want to configure the wifi, then just boot without the ethernet cable or refresh the login page with the cable unplugged. |
The wifi button posted earlier worked for me. The only thing to take into consideration is the fact that one of the GPIOs would be occupied for the button, which means that the script for board detection would have to be modified. |
Forgot to include the amended language file |
my 2cent: once wifi is connected then you dont need button to trigger ap mode, simply disconnect wire or power off your wifi router to make it to ap mode (i haven't tested this scenario) but i think it should work. |
yes definitely does work and that's my preferred option. The only thing this does not allow is the situation where you want to permanently access PiHome as an AP ie connect to it as an AP and login to PiHome GUI, but personally I don't see why you would want to use it like this. |
My pihome is currently in manually setup AP mode used for wifi gateway independent from my home wifi network with wired connection to home network. |
I know one user who has setup like this, but majority users would be happy to have setup in ap mode to setup WiFi, |
Added an option to the AP mode login screen to enable AP mode working. Can be de-selected from the Network Settings GUI. Note - a new field has been added to the network_settings table. If AP Mode tickbox is ticked then you do not need to enter a SSID or Password. |
@twa127 is there any conflict between #432 and /cron/check_wifi.sh |
Sorry can't test this on my bpi m2 zero, but I would have thought it makes no sense to be running check_wifi.sh if you were operating in AP mode and so not connected to a router |
i have rpi b+ and usb WiFi, once every while it decide to disconnect WiFi network and stay disconnected. so option was to power off and on rpi or have this script checking WiFi connection. i think it time for me to upgrade my rpi |
Thinking a bit more, the answer is no, check_wifi.sh is not compatible with #432 as it uses ifup and ifdown which require the use of entries in /etc/network/interfaces and these entries were removed by the autohotspot installer. I suggest a re-think of the code for check_wifi.sh and/or reboot_wifi.sh so that they do not use ifup and ifdown |
I think swapping ifup wlan0 to be ifconfig wlan0 up and ifdown to be ifconfig wlan0 down will fix the issue |
Looking at the current configuration, crontab is not using check_wifi.sh but is using reboot_wifi.sh. reboot_wifi.sh should be compatible with #432 as it uses 'ip link set wlan0 down' and 'ip link set wlan0 up' to toggle the wireless interface. |
yes you are right, reboot_wifi.sh is in use
|
i did one test on rpi 4 4gb, i can connect to PiHomeHotspot but in safari i tried 192.168.50.5 (option 1 during installation) but can not open page PiHome page is there anything else i have to do? |
Not tried it on a RPi but both BPi and OPi worked fine with option 1, opened in both Edge and Safari. If you do ifconfig/ipconfig on the client are you getting a valid ip address with a gateway of 192.168.50.5 ? |
yes my mobile had correct range of ip address with gateway 192.168.50.5 |
is the hostapd service running eg ps -aux | grep hostapd |
also found opening with safari on my phone was slow but if I waited it did open after about 60 seconds |
on iphone it took little longer to connect to ap as well and i dont know how long i waited before giving up, let me try again later and i'll update here. |
@twa127 today i installed PiHome on CentOS 7 on HP T620 Thin Client, i couldnt get pass the WiFi AP setup, so i had to make small change in index.php and set $eth_connected = 1; after line 62 to get passed this, |
That's pushing the envelope :-) I've added a check for if the autohotspot service has been installed |
Ignore AP mode in index.php if autohotspot.service has not been installed, #417
I was thinking about adding a button to the RPi GPIO wich would put it into access point mode for the configuration of the home newtwork(reset button).
Steps:
This is useful when router network settings are changed.
I have an idea about the python script but the web UI is php and not my area of expertise.
We would need hostapd and the ISC DHCPD server.
What do you think?
The text was updated successfully, but these errors were encountered: