mirror of
https://github.com/s00500/ESPUI.git
synced 2024-11-24 17:30:55 +00:00
Some example improvements by @thomastech
Signed-off-by: Lukas Bachschwell <lukas@lbsfilm.at>
This commit is contained in:
parent
29964a83f2
commit
e3638beb14
@ -2,7 +2,7 @@
|
||||
#include <ESPUI.h>
|
||||
|
||||
const byte DNS_PORT = 53;
|
||||
IPAddress apIP(192, 168, 1, 1);
|
||||
IPAddress apIP(192, 168, 4, 1);
|
||||
DNSServer dnsServer;
|
||||
|
||||
#if defined(ESP32)
|
||||
@ -200,8 +200,19 @@ void setup(void)
|
||||
Serial.print("\n\nCreating hotspot");
|
||||
|
||||
WiFi.mode(WIFI_AP);
|
||||
delay(100);
|
||||
WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));
|
||||
WiFi.softAP(ssid);
|
||||
#if defined(ESP32)
|
||||
uint32_t chipid = 0;
|
||||
for (int i = 0; i < 17; i = i + 8)
|
||||
{
|
||||
chipid |= ((ESP.getEfuseMac() >> (40 - i)) & 0xff) << i;
|
||||
}
|
||||
#else
|
||||
uint32_t chipid = ESP.getChipId();
|
||||
#endif char ap_ssid[25];
|
||||
snprintf(ap_ssid, 26, "ESPUI-%08X", chipid);
|
||||
WiFi.softAP(ap_ssid);
|
||||
|
||||
timeout = 5;
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include <ESPUI.h>
|
||||
|
||||
const byte DNS_PORT = 53;
|
||||
IPAddress apIP(192, 168, 1, 1);
|
||||
IPAddress apIP(192, 168, 4, 1);
|
||||
DNSServer dnsServer;
|
||||
|
||||
#if defined(ESP32)
|
||||
@ -190,8 +190,20 @@ void setup(void)
|
||||
Serial.print("\n\nCreating hotspot");
|
||||
|
||||
WiFi.mode(WIFI_AP);
|
||||
delay(100);
|
||||
WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));
|
||||
WiFi.softAP(ssid);
|
||||
#if defined(ESP32)
|
||||
uint32_t chipid = 0;
|
||||
for (int i = 0; i < 17; i = i + 8)
|
||||
{
|
||||
chipid |= ((ESP.getEfuseMac() >> (40 - i)) & 0xff) << i;
|
||||
}
|
||||
#else
|
||||
uint32_t chipid = ESP.getChipId();
|
||||
#endif
|
||||
char ap_ssid[25];
|
||||
snprintf(ap_ssid, 26, "ESPUI-%08X", chipid);
|
||||
WiFi.softAP(ap_ssid);
|
||||
|
||||
timeout = 5;
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include <ESPUI.h>
|
||||
|
||||
const byte DNS_PORT = 53;
|
||||
IPAddress apIP(192, 168, 1, 1);
|
||||
IPAddress apIP(192, 168, 4, 1);
|
||||
DNSServer dnsServer;
|
||||
|
||||
#if defined(ESP32)
|
||||
@ -198,8 +198,20 @@ void setup(void)
|
||||
Serial.print("\n\nCreating hotspot");
|
||||
|
||||
WiFi.mode(WIFI_AP);
|
||||
delay(100);
|
||||
WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));
|
||||
WiFi.softAP(ssid);
|
||||
#if defined(ESP32)
|
||||
uint32_t chipid = 0;
|
||||
for (int i = 0; i < 17; i = i + 8)
|
||||
{
|
||||
chipid |= ((ESP.getEfuseMac() >> (40 - i)) & 0xff) << i;
|
||||
}
|
||||
#else
|
||||
uint32_t chipid = ESP.getChipId();
|
||||
#endif
|
||||
char ap_ssid[25];
|
||||
snprintf(ap_ssid, 26, "ESPUI-%08X", chipid);
|
||||
WiFi.softAP(ap_ssid);
|
||||
|
||||
timeout = 5;
|
||||
|
||||
|
@ -8,18 +8,30 @@
|
||||
; Please visit documentation for the other options and examples
|
||||
; https://docs.platformio.org/page/projectconf.html
|
||||
|
||||
[platformio]
|
||||
src_dir = ./src
|
||||
data_dir = ../../data
|
||||
|
||||
[env]
|
||||
lib_extra_dirs = ../../
|
||||
board_build.filesystem = littlefs
|
||||
; Additional scripts: Usage: see https://github.com/s00500/ESPUI/issues/144#issuecomment-1005135077
|
||||
;extra_scripts =
|
||||
; LittleFSBuilder.py
|
||||
|
||||
[env:esp8266]
|
||||
platform = espressif8266
|
||||
board = nodemcuv2
|
||||
framework = arduino
|
||||
|
||||
lib_extra_dirs = ../../
|
||||
board = nodemcuv2
|
||||
lib_deps =
|
||||
bblanchon/ArduinoJson @ ^6.18.5
|
||||
me-no-dev/ESP Async WebServer @ ^1.2.3
|
||||
|
||||
[env:esp32]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
||||
framework = arduino
|
||||
|
||||
lib_extra_dirs = ../../
|
||||
|
||||
lib_deps = lorol/LittleFS_esp32
|
||||
board = esp32dev
|
||||
lib_deps =
|
||||
lorol/LittleFS_esp32@^1.0.6
|
||||
bblanchon/ArduinoJson @ ^6.18.5
|
||||
me-no-dev/ESP Async WebServer @ ^1.2.3
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include <ESPUI.h>
|
||||
|
||||
const byte DNS_PORT = 53;
|
||||
IPAddress apIP(192, 168, 1, 1);
|
||||
IPAddress apIP(192, 168, 4, 1);
|
||||
DNSServer dnsServer;
|
||||
|
||||
#if defined(ESP32)
|
||||
@ -190,8 +190,21 @@ void setup(void)
|
||||
Serial.print("\n\nCreating hotspot");
|
||||
|
||||
WiFi.mode(WIFI_AP);
|
||||
delay(100);
|
||||
WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));
|
||||
WiFi.softAP(ssid);
|
||||
#if defined(ESP32)
|
||||
uint32_t chipid = 0;
|
||||
for (int i = 0; i < 17; i = i + 8)
|
||||
{
|
||||
chipid |= ((ESP.getEfuseMac() >> (40 - i)) & 0xff) << i;
|
||||
}
|
||||
#else
|
||||
uint32_t chipid = ESP.getChipId();
|
||||
#endif
|
||||
|
||||
char ap_ssid[25];
|
||||
snprintf(ap_ssid, 26, "ESPUI-%08X", chipid);
|
||||
WiFi.softAP(ap_ssid);
|
||||
|
||||
timeout = 5;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user