Skip to content

Instantly share code, notes, and snippets.

@luigibrancati
Created March 7, 2022 11:58
Show Gist options
  • Select an option

  • Save luigibrancati/958b9788f15e1a9fc20f2cba2ec44051 to your computer and use it in GitHub Desktop.

Select an option

Save luigibrancati/958b9788f15e1a9fc20f2cba2ec44051 to your computer and use it in GitHub Desktop.
Full code
#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