Created
March 7, 2022 11:58
-
-
Save luigibrancati/958b9788f15e1a9fc20f2cba2ec44051 to your computer and use it in GitHub Desktop.
Full code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "include/server_utils.h" | |
| void setup(){ | |
| Serial.begin(115200); | |
| // Setup static IP and hostname | |
| Serial.println("Configuring WIFI"); | |
| WiFi.mode(WIFI_STA); | |
| if (!WiFi.config(serverIP, serverGateway, serverSubnet, serverPrimaryDNS, serverSecondaryDNS)) { | |
| Serial.println("STA Failed to configure"); | |
| } | |
| Serial.println("Hostname set to "+serverHostname); | |
| WiFi.setHostname(serverHostname.c_str()); | |
| connectToWiFi(); | |
| setupRouting(); | |
| } | |
| void loop(){ | |
| server.handleClient(); | |
| delay(500); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment