Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,15 @@ float linear_turn_fudge = 1.0;
float linear_motion_fudge = 1.0;
bool wheels_forward = true;

// Set these to your desired credentials.
bool use_wifi = false;
const char *ssid = "silly-bobcat";
const char *password = (char *)NULL;
// Either connect to your existing wifi network...
bool use_wifi = true;
const char *wifi_name = "YOUR WIFI NETWORK NAME";
const char *wifi_password = "YOUR WIFI PASSWORD";

// ...or create a wifi hotspot
const char *hotspot_name = "silly-bobcat";
const char *hotspot_password = (char *)NULL;


// primitive motion plan parsing/interpreting
#define MAX_PLAN_LEN 1024
Expand Down Expand Up @@ -532,10 +537,6 @@ void addAllFiles()
}
}

// Replace with your network credentials
#include "network_credentials.h"
// const char* network_ssid = "YOUR SSID";
// const char* network_password = "YOUR PASSWORD";

void setup()
{
Expand Down Expand Up @@ -565,9 +566,9 @@ void setup()
// try connecting to the wifi network
if (use_wifi) {
WiFi.mode(WIFI_STA);
WiFi.begin(network_ssid, network_password);
WiFi.begin(wifi_name, wifi_password);
Serial.print("Connecting to ");
Serial.print(network_ssid);
Serial.print(wifi_name);
Serial.print(" ");
for(int i=0; i<20; i++)
{
Expand All @@ -583,8 +584,8 @@ void setup()
Serial.println(" --> connected.");
}
if (!use_wifi || (WiFi.status() != WL_CONNECTED)){
Serial.println("Configuring access point...");
WiFi.softAP(ssid);
Serial.println("Configuring hotspot...");
WiFi.softAP(hotspot_name);
IPAddress myIP = WiFi.softAPIP();
// WiFi.softAPsetHostname(hostname);
Serial.print("AP IP address: ");
Expand All @@ -594,7 +595,7 @@ void setup()
Serial.println(WiFi.localIP());
}
// mdns_init();
// mdns_hostname_set(ssid);
// mdns_hostname_set(hotspot_name);

Serial.println("Configuring server...");
// dynamic pages
Expand Down
2 changes: 0 additions & 2 deletions src/network_credentials.h

This file was deleted.