From b154356c33855e7b2363e349cc53e63acd643001 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20St=C3=B6r?= Date: Sun, 15 Apr 2018 00:10:34 +0200 Subject: [PATCH] Turn off AP, allow setting hostname Fixes #50 --- esp8266-weather-station-color.ino | 2 ++ settings.h | 1 + 2 files changed, 3 insertions(+) diff --git a/esp8266-weather-station-color.ino b/esp8266-weather-station-color.ino index 6d7cf27..e9aae19 100644 --- a/esp8266-weather-station-color.ino +++ b/esp8266-weather-station-color.ino @@ -130,7 +130,9 @@ bool canBtnPress; void connectWifi() { if (WiFi.status() == WL_CONNECTED) return; //Manual Wifi + WiFi.mode(WIFI_STA); WiFi.begin(WIFI_SSID,WIFI_PASS); + WiFi.hostname(WIFI_HOSTNAME); int i = 0; while (WiFi.status() != WL_CONNECTED) { delay(500); diff --git a/settings.h b/settings.h index ec783ec..f15dbd5 100644 --- a/settings.h +++ b/settings.h @@ -23,6 +23,7 @@ See more at http://blog.squix.ch // Setup #define WIFI_SSID "yourssid" #define WIFI_PASS "yourpassw0rd" +#define WIFI_HOSTNAME "ThingPulse-weather-station-color" const int UPDATE_INTERVAL_SECS = 15 * 60; // Update every 10 minutes const int SLEEP_INTERVAL_SECS = 0; // Going to Sleep after idle times, set 0 for dont sleep