Skip to content

Commit db9f749

Browse files
committed
Changed AP to use a fixed IP-number.
1 parent 4277d89 commit db9f749

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/_holfuy.ino

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,9 @@ void get_host_and_port(unsigned int host_len, char *host, int *port, const char
344344

345345
void loopHolfuy()
346346
{
347+
if (WiFi.getMode() != WIFI_STA) {
348+
return;
349+
}
347350
static uint32_t lastMillis = 0;
348351
static int connection = 0;
349352

@@ -382,10 +385,11 @@ void loopHolfuy()
382385
const char *path;
383386
get_host_and_port(sizeof(host), host, NULL, &path);
384387
char request[256];
388+
// TODO: URL-encode password & id.
385389
snprintf(request,
386390
sizeof(request),
387391
"GET %s?pw=%s&s=%d&m=CSV&su=m/s HTTP/1.1\r\n"
388-
"User-Agent: WindLight/0.0.1\r\n"
392+
"User-Agent: " APP_NAME "/" APP_VERSION "\r\n"
389393
"Host: %s\r\n"
390394
"X-Request-Nr: %u\r\n"
391395
"Connection: Disconnect\r\n\r\n",

src/_wifi.ino

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,15 @@ void setupWiFi() {
112112
wifiReconnectTimer.detach(); // Ensure not to reconnect to WiFi while
113113
// changing into AP mode
114114

115-
#if 0
116115
IPAddress local_IP(192,168,1,1);
117116
IPAddress gateway(192,168,1,1);
118117
IPAddress subnet(255,255,255,0);
119118
WiFi.softAPConfig(local_IP, gateway, subnet);
120-
#endif
121119

122120
WiFi.mode(WIFI_AP);
123121
delay(10);
124122

125-
WiFi.softAP(cfg.hostname, ADMIN_PASSWORD);
123+
WiFi.softAP(cfg.hostname); //, ADMIN_PASSWORD);
124+
LLMNR.notify_ap_change();
126125
}
127126
}

0 commit comments

Comments
 (0)