diff --git a/Command/main/data/favicon.ico b/Command/main/data/favicon.ico new file mode 100644 index 0000000..cbaef43 Binary files /dev/null and b/Command/main/data/favicon.ico differ diff --git a/Command/index.html b/Command/main/data/index.html similarity index 98% rename from Command/index.html rename to Command/main/data/index.html index b242ae1..30c9d16 100644 --- a/Command/index.html +++ b/Command/main/data/index.html @@ -4,6 +4,10 @@ Rover Command Center + + + + - - - - -

ROVER COMMAND CENTER

- -
- -
-
-

Movement Control

-
- -
-
- - - -
- -
-
- -
-
-

Sensor Data

-
    - -
  • - -
    -
    - -
    -
  • - - -
  • - -
    -
    - 28mm -
    -
  • - -
-
- -
- -
- - - - - -)====="; - AsyncWebServer server(80); // server port 80 for initial HTTP request for the main webpage. WebSocketsServer websockets(81); // server port 81 for real time data flow through websockets. @@ -360,6 +66,15 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t length digitalWrite(R_Led,MVM_R_status); digitalWrite(D_Led,MVM_B_status); } + + case WStype_BIN: + case WStype_ERROR: + case WStype_FRAGMENT_TEXT_START: + case WStype_FRAGMENT_BIN_START: + case WStype_FRAGMENT: + case WStype_FRAGMENT_FIN: + default: + break; } } @@ -373,7 +88,10 @@ void setup() pinMode(D_Led,OUTPUT); pinMode(butPin, INPUT_PULLUP); - + if(!SPIFFS.begin(true)){ + Serial.println("An Error has occurred while mounting SPIFFS"); + return; +} /* Serial.println(); Serial.println(); Serial.print("Connecting to "); @@ -408,13 +126,14 @@ void setup() } Serial.println("mDNS responder started! Rover Command Center can now be accessed at 'rover.local' "); - - - server.on("/", [](AsyncWebServerRequest * request) - { - request->send_P(200, "text/html", index_html); + server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){ + request->send(SPIFFS, "/index.html", "text/html"); }); + server.on("/favicon.ico", HTTP_GET, [](AsyncWebServerRequest *request){ + request->send(SPIFFS, "/favicon.ico", "image/png"); + }); + server.onNotFound(notFound); server.begin();