Compare commits
	
		
			2 Commits
		
	
	
		
			v1.42
			...
			69cb07f721
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 69cb07f721 | |||
| 5fafe9a538 | 
@@ -52,14 +52,14 @@ function sendRequest(submit, server) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
function saveSetting(submit) {
 | 
					function saveSetting(submit) {
 | 
				
			||||||
    server = "/setting?ssid=" + getValue('ssid') + "&password=" + encodeURIComponent(getValue('password'))
 | 
					    server = "/setting?ssid=" + getValue('ssid') + "&password=" + encodeURIComponent(getValue('password'))
 | 
				
			||||||
        + "&host=" + getValue('mqttHostName') + "&port=" + getValue('mqttHostPort')
 | 
					        + "&mqttHostName=" + getValue('mqttHostName') + "&mqttHostPort=" + getValue('mqttHostPort')
 | 
				
			||||||
        + "&login=" + getValue('mqttUserLogin') + "&pass=" + encodeURIComponent(getValue('mqttUserPassword'))
 | 
					        + "&mqttUserLogin=" + getValue('mqttUserLogin') + "&mqttUserPassword=" + encodeURIComponent(getValue('mqttUserPassword'))
 | 
				
			||||||
        + "&prefix=" + getValue('topicPrefix')
 | 
					        + "&topicPrefix=" + getValue('topicPrefix')
 | 
				
			||||||
        + "&name=" + getValue('deviceName')
 | 
					        + "&deviceName=" + getValue('deviceName')
 | 
				
			||||||
        + "&net=" + getValue('espnowNetName')
 | 
					        + "&espnowNetName=" + getValue('espnowNetName')
 | 
				
			||||||
        + "&mode=" + getSelectValue('workModeSelect')
 | 
					        + "&workMode=" + getSelectValue('workModeSelect')
 | 
				
			||||||
        + "&ntp=" + getValue('ntpHostName')
 | 
					        + "&ntpHostName=" + getValue('ntpHostName')
 | 
				
			||||||
        + "&zone=" + getValue('gmtOffset');
 | 
					        + "&gmtOffset=" + getValue('gmtOffset');
 | 
				
			||||||
    sendRequest(submit, server);
 | 
					    sendRequest(submit, server);
 | 
				
			||||||
    alert("Please restart device for changes apply.");
 | 
					    alert("Please restart device for changes apply.");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										34
									
								
								src/main.cpp
									
									
									
									
									
								
							
							
						
						
									
										34
									
								
								src/main.cpp
									
									
									
									
									
								
							@@ -15,13 +15,6 @@
 | 
				
			|||||||
#include "ESP32SSDP.h"
 | 
					#include "ESP32SSDP.h"
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef enum : uint8_t
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    ESP_NOW,
 | 
					 | 
				
			||||||
    ESP_NOW_WIFI,
 | 
					 | 
				
			||||||
    ESP_NOW_LAN
 | 
					 | 
				
			||||||
} work_mode_t;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void onEspnowMessage(const char *data, const uint8_t *sender);
 | 
					void onEspnowMessage(const char *data, const uint8_t *sender);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void onMqttMessage(char *topic, byte *payload, unsigned int length);
 | 
					void onMqttMessage(char *topic, byte *payload, unsigned int length);
 | 
				
			||||||
@@ -42,6 +35,13 @@ void checkMqttAvailability(void);
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void mqttPublish(const char *topic, const char *payload, bool retained);
 | 
					void mqttPublish(const char *topic, const char *payload, bool retained);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					typedef enum : uint8_t
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    ESP_NOW,
 | 
				
			||||||
 | 
					    ESP_NOW_WIFI,
 | 
				
			||||||
 | 
					    ESP_NOW_LAN
 | 
				
			||||||
 | 
					} work_mode_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const String firmware{"1.42"};
 | 
					const String firmware{"1.42"};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
String espnowNetName{"DEFAULT"};
 | 
					String espnowNetName{"DEFAULT"};
 | 
				
			||||||
@@ -628,16 +628,16 @@ void setupWebServer()
 | 
				
			|||||||
                 {
 | 
					                 {
 | 
				
			||||||
        ssid = request->getParam("ssid")->value();
 | 
					        ssid = request->getParam("ssid")->value();
 | 
				
			||||||
        password = request->getParam("password")->value();
 | 
					        password = request->getParam("password")->value();
 | 
				
			||||||
        mqttHostName = request->getParam("host")->value();
 | 
					        mqttHostName = request->getParam("mqttHostName")->value();
 | 
				
			||||||
        mqttHostPort = request->getParam("port")->value().toInt();
 | 
					        mqttHostPort = request->getParam("mqttHostPor")->value().toInt();
 | 
				
			||||||
        mqttUserLogin = request->getParam("login")->value();
 | 
					        mqttUserLogin = request->getParam("mqttUserLogin")->value();
 | 
				
			||||||
        mqttUserPassword = request->getParam("pass")->value();
 | 
					        mqttUserPassword = request->getParam("mqttUserPassword")->value();
 | 
				
			||||||
        topicPrefix = request->getParam("prefix")->value();
 | 
					        topicPrefix = request->getParam("topicPrefix")->value();
 | 
				
			||||||
        deviceName = request->getParam("name")->value();
 | 
					        deviceName = request->getParam("deviceName")->value();
 | 
				
			||||||
        espnowNetName = request->getParam("net")->value();
 | 
					        espnowNetName = request->getParam("espnowNetName")->value();
 | 
				
			||||||
        workMode = request->getParam("mode")->value().toInt();
 | 
					        workMode = request->getParam("workMode")->value().toInt();
 | 
				
			||||||
        ntpHostName = request->getParam("ntp")->value();
 | 
					        ntpHostName = request->getParam("ntpHostName")->value();
 | 
				
			||||||
        gmtOffset = request->getParam("zone")->value().toInt();
 | 
					        gmtOffset = request->getParam("gmtOffset")->value().toInt();
 | 
				
			||||||
        request->send(200);
 | 
					        request->send(200);
 | 
				
			||||||
        saveConfig(); });
 | 
					        saveConfig(); });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user