raspap-webgui
raspap-webgui copied to clipboard
Reset button - factory reset
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.
I love the idea. Haven't looked at the code yet. An addition I thought off would be that the reset button could get the default configuration from a file so that the user could decide the settings it "resets" too
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. A bit more about the reset button itself. I have coded the reset button (just one button) to implement three functions: A short press reboots the Pi (> 2 seconds) A longer press shuts down the Pi (>6 seconds) A very long press performs the reset of the settings and then reboots the pi (>15 seconds) I'm indicating which time period the sequence is in using different flash rates on an LED connected to GPIO. Just remembered that I can take over the power LED on the raspberry Pi main board. I can make it duplicate these flash functions. I should implement this. After that, I need to test it all with a clean Raspbian and the quick installer. Finally, I'll update the documentation.
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. So the reset would change back everything to the same IP and login credentials? of course depending on which config file that is chosen that you guys mentioned previously
Saving user-defined data for factory reset was more involved than I had anticipated. Completed now though. I have now tested everything from the command line and the browser. For the final step, I need to run an end-to-end test with the quick installer and see if anything breaks.
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. Over to you.
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. If you want or need to use the code you could fork the whole project and perform the merge yourself. Once the change is officially merged into raspap you could drop your own project and go back to the official project.
Guys, I made the final commit on this seven months ago. "Is there life out there? Almost definitely, say UK scientists."