Skip to content

Commit 684a8b7

Browse files
committed
minor stuff
1 parent 50f896e commit 684a8b7

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

httpportal.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
11
#ifndef httpportal_h
22
#define httpportal_h
33

4-
#include <log.h>
4+
// @USES wifimanager portal
55

6+
#include <log.h>
67
#include <WiFiManager.h>
8+
79
WiFiManager portal(Logger);
810

911
void init_httpportal(String title = ""){
10-
portal.setDebugOutput(true,"[HTTPP] ");
12+
portal.setDebugOutput(true,"[HTTPP] ");
1113
// invert theme, dark
1214
portal.setDarkMode(true);
1315
std::vector<const char *> menu = {"wifi","param","info","sep","update","restart","exit"};
1416
portal.setMenu(menu); // custom menu, pass vector
1517
portal.setTitle(title);
18+
// portal.setBackButton(true);
19+
// portal.setHostname(getHostname());
1620
}
1721

1822
void begin_httpportal(){
1923
portal.startWebPortal();
2024
}
2125

2226
void stop_httpportal(){
23-
27+
portal.stopWebPortal();
2428
}
2529

2630
void process_httpportal(){

sense_env.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include <Average.h>
55

6-
Average<float> avg_a(10);
6+
Average<float> avg_a(20);
77

88
// supported sensors
99
// SHT31

temp_logger.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// #include <analogWrite.h>
77
// #endif
88

9-
#include <log.h>
109
#include <buttons.h>
1110
#include <i2c_fans.h>
1211

wifi_funcs.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ String getDeviecID(){
106106
}
107107

108108
void setWiFiHostname(const char* hostname){
109+
// @todo add string templ
109110
#ifdef ESP32
110111
WiFi.setHostname(hostname);
111112
#else
@@ -115,7 +116,7 @@ void setWiFiHostname(const char* hostname){
115116

116117
String getHostname(){
117118
#ifdef ESP32
118-
return WiFi.getHostname(); // getHostName ( @todo return string of c.str?)
119+
return WiFi.getHostname(); // getHostName ( @todo return string or c.str?)
119120
#else
120121
return WiFi.hostname(); // getHostName
121122
#endif
@@ -140,6 +141,9 @@ void init_WiFi(int timeout){
140141
// WiFi_print_sta();
141142
// return;
142143
// }
144+
145+
WiFi.printDiag(Serial);
146+
Serial.println("[WIFI] mode STA");
143147
WiFi.mode(WIFI_STA);
144148
#ifdef ESP8266
145149
WiFi.setSleepMode(WIFI_NONE_SLEEP);
@@ -150,8 +154,8 @@ void init_WiFi(int timeout){
150154

151155
// WiFi.hostname(hostname);
152156
unsigned long start = millis();
153-
if(wifiIsAutoConnect) WiFi.begin();
154-
else WiFi.begin(SSID,PASS);
157+
// if(wifiIsAutoConnect) WiFi.begin();
158+
WiFi.begin(SSID,PASS);
155159
if(timeout > 0){
156160
Serial.println("[WIFI] Connecting to wifi... [" + (String)timeout + " ms]\n");
157161
while((WiFi.status() != WL_CONNECTED) && (millis()-start < timeout)){

0 commit comments

Comments
 (0)