-
-
Notifications
You must be signed in to change notification settings - Fork 794
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
Reset button - factory reset #172
base: master
Are you sure you want to change the base?
Conversation
Original page extends a long way to the right on mobile devices. This re-format contains the same data and controls, but narrows the size of the display. The page now displays on mobile devices with no need for scrolling to the right.
The reset script restores the default RaspAP configuration files. Basically this is a "factory reset" for the device. This script is to be triggered using a physical push button.
I love the idea. |
Getting there. I have tested the code for the reset functions from the command line. All is OK. Next, I will implement your idea about selecting which settings are used for the reset. I intend to tackle this by taking a snapshot of the current files: dhcpcd.conf dnsmasq.conf and hostapd.conf. The reset function can simply copy these into place. I'm going to add a simple control that allow the user to take this snapshot. I'll also put in some sort of selection to record if the user wants to use the snapshot or the RaspAP defaults upon reset. |
The power LED thing only works on early Pi versions. It won't work on Pi 3 or Pi Zero, so I won't be implementing that. |
Hi! Great idea, just what is needed for me. |
Added functions to save current RaspAP settings as "User" defaults. Added a selection for RaspAP factory reset to use User defaults or RaspAP defaults.
# Conflicts: # installers/common.sh
Changed the sed regex delimiting character from a / to a ? The script substitutes a string $raspap_dir. This string can be changed and it will not be escaped. It is not possible to escape the string without the use of additional regex. So, the sed regex delimiting character has been changed to eliminate the need for escaping.
Saving user-defined data for factory reset was more involved than I had anticipated. Completed now though. |
These changes will be reversed once testing is complete
Installation script was unable to write directly into /etc/raspap/hostapd. Writing to /tmp and moving the file in instead.
Commands to set interface up or down used ifconfig to check if interface was already up or down. The rest of the page uses "ip s a". The results of these two checks sometimes conflict. As ifconfig is now obsolete (refer https://linux.die.net/man/8/ifconfig), script has been edited so that everything uses the "ip s a" check. Warnings that the interface was already up/down were output in plain text. Edited to output these warnings as status->messages. Refresh button was using javascript to reload the identical page. This had the consequence of re-submitting the form as well, including Start and Stop commands. Replaced the javascript reload with a link back to the dashboard page. Used a button class id that has a nifty reload symbol. Page was attempting to both change the status of the interface and check the status of the interface on the same page load. This is not possible. Added a javascript timed page refresh after an interface state change so that the interface status can be correctly displayed.
Intitialisation was not putting quotes around string data. All subsequent writes were inserting quotes. Formatting is now consistent.
Full write-up including images
Changed all links back to billz repository
Everything is done. I have tested all changes on fresh Raspbian installations and installing RaspAP using the quick installer. I did testing on Raspberry Pi model B+ and Pi Zero W. Both were using fresh installations of Raspbian Stretch. I've updated the Readme, so check that out for instructions on how to use the button. I have also made a YouTube clip showing how to operate the system. |
I'm no expert when it comes to the git system..... Was this merged to the main branch yet? |
Hasn't been merged yet. Hopefully it can still be merged without conflicts. |
Guys, I made the final commit on this seven months ago. |
Hi Bill,
RE Issue #156
I'm putting together this branch to implement a "factory reset" for RaspAP using a physical push button. The reset function simply restores the default RaspAP configuration files.
I need to develop this functionality for my own purposes, but I'm keen to contribute it back to the community. Let me know what you think about the idea.
My changes are not yet complete. I have opened this pull request early to give us a means of communicating about this branch.
So far, I have implemented the reset shell script and the changes necessary to common.sh auto installer. I am still working on the push button implementation, but I have some good information on implementing this without installing any dependencies. Should be good to go in another day or two.
Nathan.