Skip to content

Commit

Permalink
Merge pull request #153 from HaullingLlama/Restart-in-main-menue
Browse files Browse the repository at this point in the history
Added a restart option to the main menu
  • Loading branch information
Qrome authored Sep 4, 2020
2 parents dab4cca + 778c96c commit c0243dd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ It is recommended to use Arduino IDE. You will need to configure Arduino IDE to
* Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board Manager URLs field. You can add multiple URLs, separating them with commas. This will add support for the Wemos D1 Mini to Arduino IDE.
* Open Boards Manager from Tools > Board menu and install esp8266 Core platform version **2.5.2**
* Select Board: "LOLIN(WEMOS) D1 R2 & mini"
* Set 1M SPIFFS -- **this project requires SPIFFS for saving and reading configuration settings.**
* Set Flash Size to 1M SPIFFS -- **this project requires SPIFFS for saving and reading configuration settings.**
* Select the **Port** from the tools menu.

## Loading Supporting Library Files in Arduino
Expand Down
7 changes: 7 additions & 0 deletions marquee/marquee.ino
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ static const char WEB_ACTIONS2[] PROGMEM = "<a class='w3-bar-item w3-button' hre

static const char WEB_ACTION3[] PROGMEM = "</a><a class='w3-bar-item w3-button' href='/systemreset' onclick='return confirm(\"Do you want to reset to default weather settings?\")'><i class='fas fa-undo'></i> Reset Settings</a>"
"<a class='w3-bar-item w3-button' href='/forgetwifi' onclick='return confirm(\"Do you want to forget to WiFi connection?\")'><i class='fas fa-wifi'></i> Forget WiFi</a>"
"<a class='w3-bar-item w3-button' href='/restart'><i class='fas fa-sync'></i> Restart</a>"
"<a class='w3-bar-item w3-button' href='/update'><i class='fas fa-wrench'></i> Firmware Update</a>"
"<a class='w3-bar-item w3-button' href='https://github.com/Qrome/marquee-scroller' target='_blank'><i class='fas fa-question-circle'></i> About</a>";

Expand Down Expand Up @@ -315,6 +316,7 @@ void setup() {
server.on("/savepihole", handleSavePihole);
server.on("/systemreset", handleSystemReset);
server.on("/forgetwifi", handleForgetWifi);
server.on("/restart", restartEsp);
server.on("/configure", handleConfigure);
server.on("/configurebitcoin", handleBitcoinConfigure);
server.on("/configurewideclock", handleWideClockConfigure);
Expand Down Expand Up @@ -627,6 +629,11 @@ void handleForgetWifi() {
ESP.restart();
}

void restartEsp() {
redirectHome();
ESP.restart();
}

void handleBitcoinConfigure() {
if (!athentication()) {
return server.requestAuthentication();
Expand Down

0 comments on commit c0243dd

Please sign in to comment.