mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-08-14 06:55:54 +08:00
Add Setting to get verbose boot or minimal one
Fix Boot string format not consistent Change [ESP150] to support verbose parameter in addition to delay Change [ESP400] to group boot delay and boot verbose in a boot subsection Add Boot_verbose in espcnf.ini
This commit is contained in:
parent
d72e193712
commit
5073327e30
@ -53,8 +53,8 @@ Note:
|
||||
* Sync / Set / Get current time
|
||||
[ESP140]<SYNC> <srv1=XXXXX> <srv2=XXXXX> <srv3=XXXXX> <zone=xxx> <dst=YES/NO> <time=YYYY-MM-DD#H24:MM:SS> pwd=<admin password>
|
||||
|
||||
* Get/Set boot delay
|
||||
[ESP150]<time in milliseconds>[pwd=<admin password>]
|
||||
* Get/Set display/set boot delay in ms / Verbose boot
|
||||
[ESP150]<delay=time in milliseconds><verbose=ON/OFF>[pwd=<admin password>]
|
||||
|
||||
* Get/Set WebSocket state which can be ON, OFF
|
||||
[ESP160]<state>pwd=<admin password>
|
||||
|
@ -125,17 +125,20 @@ Baud_rate = 115200
|
||||
#Boot delay in ms
|
||||
Boot_delay = 5000
|
||||
|
||||
#Boot verbose Yes / No
|
||||
Boot_verbose = No
|
||||
|
||||
#Outputs
|
||||
#printer LCD
|
||||
#printer LCD Yes / No
|
||||
Active_Printer_LCD = Yes
|
||||
#esp3d lcd
|
||||
#esp3d lcd Yes / No
|
||||
Active_ESP3D_LCD = Yes
|
||||
#ESP3D Serial
|
||||
#ESP3D Serial Yes / No
|
||||
Active_Serial = Yes
|
||||
#Websocket
|
||||
#Websocket Yes / No
|
||||
Active_WebSocket = Yes
|
||||
#Telnet
|
||||
#Telnet Yes / No
|
||||
Active_Telnet = Yes
|
||||
#Bluetooth[ESP]
|
||||
#Bluetooth Yes / No
|
||||
Active_BT = Yes
|
||||
|
||||
|
@ -371,8 +371,8 @@ bool Commands::execute_internal_command (int cmd, const char* cmd_params, level_
|
||||
response = ESP140(cmd_params, auth_type, output);
|
||||
break;
|
||||
#endif //TIMESTAMP_FEATURE
|
||||
//Get/Set boot delay
|
||||
//[ESP150]<time>[pwd=<admin password>]
|
||||
//Get/Set display/set boot delay in ms / Verbose boot
|
||||
//[ESP150]<delay=time in milliseconds><verbose=YES/NO>[pwd=<admin password>]
|
||||
case 150:
|
||||
response = ESP150(cmd_params, auth_type, output);
|
||||
break;
|
||||
|
@ -252,17 +252,9 @@ size_t ESP3DOutput::printMSG(const char * s, bool withNL)
|
||||
return 0;
|
||||
}
|
||||
#endif //HTTP_FEATURE
|
||||
if (_client & ESP_PRINTER_LCD_CLIENT) {
|
||||
if (isOutput(ESP_PRINTER_LCD_CLIENT) && (Settings_ESP3D::GetFirmwareTarget()!=GRBL)) {
|
||||
display= "M117 ";
|
||||
display+= s;
|
||||
return printLN(display.c_str());
|
||||
} else {
|
||||
return printLN(s);
|
||||
}
|
||||
}
|
||||
if (_client & ESP_SCREEN_CLIENT) {
|
||||
print(s);
|
||||
ESP3DOutput outputscr(ESP_SCREEN_CLIENT);
|
||||
outputscr.print(s);
|
||||
}
|
||||
switch(Settings_ESP3D::GetFirmwareTarget()) {
|
||||
case GRBL:
|
||||
@ -272,13 +264,21 @@ size_t ESP3DOutput::printMSG(const char * s, bool withNL)
|
||||
break;
|
||||
case MARLIN:
|
||||
case MARLINKIMBRA:
|
||||
if (_client & ESP_PRINTER_LCD_CLIENT) {
|
||||
display = "M117 ";
|
||||
} else {
|
||||
display = ";echo: ";
|
||||
}
|
||||
display += s;
|
||||
break;
|
||||
case SMOOTHIEWARE:
|
||||
case REPETIER:
|
||||
default:
|
||||
if (_client & ESP_PRINTER_LCD_CLIENT) {
|
||||
display = "M117 ";
|
||||
} else {
|
||||
display = ";";
|
||||
}
|
||||
display += s;
|
||||
}
|
||||
if(withNL) {
|
||||
|
@ -41,7 +41,7 @@ const char * help[]= {"[ESP] - display this help",
|
||||
"[ESP110](State) - display/set radio state which can be STA, AP, OFF",
|
||||
#endif // WIFI_FEATURE || BLUETOOTH_FEATURE || ETH_FEATURE
|
||||
#if defined( WIFI_FEATURE) || defined (ETH_FEATURE)
|
||||
"[ESP111]display current IP",
|
||||
"[ESP111](header)display current IP",
|
||||
#endif //WIFI_FEATURE || ETH_FEATURE
|
||||
#if defined(WIFI_FEATURE) || defined(ETH_FEATURE) || defined(BT_FEATURE)
|
||||
"[ESP112](Hostname) - display/set Hostname",
|
||||
@ -58,7 +58,7 @@ const char * help[]= {"[ESP] - display this help",
|
||||
#if defined(TIMESTAMP_FEATURE)
|
||||
"[ESP140](SYNC) (srv1=xxxx) (srv2=xxxx) (srv3=xxxx) (zone=xxx) (dst=YES/NO) (time=YYYY-MM-DD#H24:MM:SS) - sync/display/set current time/time servers",
|
||||
#endif //TIMESTAMP_FEATURE
|
||||
"[ESP150](time) - display/set boot delay in ms",
|
||||
"[ESP150](delay=time) (verbose=ON/OFF)- display/set boot delay in ms / Verbose boot",
|
||||
#if defined(WS_DATA_FEATURE)
|
||||
"[ESP160](State) - display/set WebSocket state which can be ON, OFF, CLOSE",
|
||||
"[ESP161](Port) - display/set WebSocket port",
|
||||
|
@ -28,14 +28,16 @@
|
||||
//[ESP111]
|
||||
bool Commands::ESP111(const char* cmd_params, level_authenticate_type auth_type, ESP3DOutput * output)
|
||||
{
|
||||
bool response = true;
|
||||
String parameter;
|
||||
String res = get_param (cmd_params, "");
|
||||
String parameter = get_param (cmd_params, "");
|
||||
(void)auth_type;
|
||||
res += NetConfig::localIP();
|
||||
//log_esp3d("Client %d", output->client());
|
||||
output->printMSG (res.c_str());
|
||||
return response;
|
||||
if (parameter.length() > 0) {
|
||||
parameter += " ";
|
||||
parameter += NetConfig::localIP();
|
||||
output->printLN (parameter.c_str());
|
||||
} else {
|
||||
output->printMSG (NetConfig::localIP().c_str());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif //WIFI_FEATURE
|
||||
|
@ -22,8 +22,8 @@
|
||||
#include "../esp3doutput.h"
|
||||
#include "../settings_esp3d.h"
|
||||
#include "../../modules/authentication/authentication_service.h"
|
||||
//Get/Set boot delay
|
||||
//[ESP150]<time>[pwd=<admin password>]
|
||||
// Get/Set display/set boot delay in ms / Verbose boot
|
||||
//[ESP150]<delay=time in milliseconds><verbose=ON/OFF>[pwd=<admin password>]
|
||||
bool Commands::ESP150(const char* cmd_params, level_authenticate_type auth_type, ESP3DOutput * output)
|
||||
{
|
||||
bool response = true;
|
||||
@ -39,7 +39,10 @@ bool Commands::ESP150(const char* cmd_params, level_authenticate_type auth_type,
|
||||
parameter = get_param (cmd_params, "");
|
||||
//get
|
||||
if (parameter.length() == 0) {
|
||||
output->printMSG(String(Settings_ESP3D::read_uint32(ESP_BOOT_DELAY)).c_str());
|
||||
String s = "delay="+String(Settings_ESP3D::read_uint32(ESP_BOOT_DELAY));
|
||||
s+=" verbose=";
|
||||
s+= Settings_ESP3D::isVerboseBoot(true)?"ON":"OFF";
|
||||
output->printMSG(s.c_str());
|
||||
} else {
|
||||
#ifdef AUTHENTICATION_FEATURE
|
||||
if (auth_type != LEVEL_ADMIN) {
|
||||
@ -47,6 +50,9 @@ bool Commands::ESP150(const char* cmd_params, level_authenticate_type auth_type,
|
||||
return false;
|
||||
}
|
||||
#endif //AUTHENTICATION_FEATURE
|
||||
response = false;
|
||||
parameter = get_param (cmd_params, "delay=");
|
||||
if (parameter.length() != 0) {
|
||||
uint ibuf = parameter.toInt();
|
||||
if ((ibuf > Settings_ESP3D::get_max_int32_value(ESP_BOOT_DELAY)) || (ibuf < Settings_ESP3D::get_min_int32_value(ESP_BOOT_DELAY))) {
|
||||
output->printERROR ("Incorrect delay!");
|
||||
@ -54,7 +60,29 @@ bool Commands::ESP150(const char* cmd_params, level_authenticate_type auth_type,
|
||||
}
|
||||
if (!Settings_ESP3D::write_uint32 (ESP_BOOT_DELAY, ibuf)) {
|
||||
output->printERROR ("Set failed!");
|
||||
response = false;
|
||||
return false;
|
||||
} else {
|
||||
response = true;
|
||||
}
|
||||
}
|
||||
parameter = get_param (cmd_params, "verbose=");
|
||||
if (parameter.length() != 0) {
|
||||
if ((parameter == "ON")|| (parameter == "OFF")) {
|
||||
if (!Settings_ESP3D::write_byte (ESP_VERBOSE_BOOT, (parameter == "ON")?1:0)) {
|
||||
output->printERROR ("Set failed!");
|
||||
return false;
|
||||
} else {
|
||||
Settings_ESP3D::isVerboseBoot(true);
|
||||
response = true;
|
||||
}
|
||||
} else {
|
||||
output->printERROR ("Incorrect command! only ON/OFF is allowed");
|
||||
return false;
|
||||
}
|
||||
response = true;
|
||||
}
|
||||
if (!response) {
|
||||
output->printERROR ("Incorrect command!");
|
||||
} else {
|
||||
output->printMSG ("ok");
|
||||
}
|
||||
|
@ -505,7 +505,7 @@ bool Commands::ESP400(const char* cmd_params, level_authenticate_type auth_type,
|
||||
}
|
||||
output->print ("]}");
|
||||
//Start delay
|
||||
output->print (",{\"F\":\"system/system\",\"P\":\"");
|
||||
output->print (",{\"F\":\"system/boot\",\"P\":\"");
|
||||
output->print (ESP_BOOT_DELAY);
|
||||
output->print ("\",\"T\":\"I\",\"V\":\"");
|
||||
output->print (Settings_ESP3D::read_uint32(ESP_BOOT_DELAY));
|
||||
@ -514,6 +514,12 @@ bool Commands::ESP400(const char* cmd_params, level_authenticate_type auth_type,
|
||||
output->print ("\",\"M\":\"");
|
||||
output->print (Settings_ESP3D::get_min_int32_value(ESP_BOOT_DELAY));
|
||||
output->print ("\"}");
|
||||
//Verbose boot
|
||||
output->print(",{\"F\":\"system/boot\",\"P\":\"");
|
||||
output->print(ESP_VERBOSE_BOOT);
|
||||
output->print("\",\"T\":\"B\",\"V\":\"");
|
||||
output->print (Settings_ESP3D::read_byte(ESP_VERBOSE_BOOT));
|
||||
output->print("\",\"H\":\"verbose\",\"O\":[{\"no\":\"0\"},{\"yes\":\"1\"}]}");
|
||||
//Output flag
|
||||
//Serial
|
||||
output->print (",{\"F\":\"system/outputmsg\",\"P\":\"");
|
||||
|
@ -78,6 +78,9 @@ bool Commands::ESP401(const char* cmd_params, level_authenticate_type auth_type,
|
||||
case ESP_BT_FLAG:
|
||||
ESP3DOutput::isOutput(ESP_ALL_CLIENTS,true);
|
||||
break;
|
||||
case ESP_VERBOSE_BOOT:
|
||||
Settings_ESP3D::isVerboseBoot(true);
|
||||
break;
|
||||
case ESP_TARGET_FW:
|
||||
Settings_ESP3D::GetFirmwareTarget(true);
|
||||
break;
|
||||
|
@ -196,7 +196,7 @@ bool Hal::begin()
|
||||
WiFi.enableAP (false);
|
||||
WiFi.mode (WIFI_OFF);
|
||||
#if SD_DEVICE_CONNECTION == ESP_SHARED_SD
|
||||
#if defined(ESP_SD_DETECT_PIN) && ESP_SD_DETECT_PIN != -1
|
||||
#if defined(ESP_SD_DETECT_PIN) && ESP_SD_DETECT_PIN != -1
|
||||
pinMode (ESP_SD_DETECT_PIN, INPUT);
|
||||
#endif
|
||||
pinMode (ESP_FLAG_SHARED_SD_PIN, OUTPUT);
|
||||
|
@ -89,6 +89,7 @@
|
||||
|
||||
#define DEFAULT_SETUP 0
|
||||
|
||||
#define DEFAULT_VERBOSE_BOOT 0
|
||||
#define DEFAULT_ESP_BYTE 0
|
||||
#define DEFAULT_ESP_STRING_SIZE 0
|
||||
#if defined (WIFI_FEATURE) || defined (ETH_FEATURE)
|
||||
@ -169,6 +170,7 @@ const uint8_t DEFAULT_ADDRESS_VALUE[] = {0, 0, 0, 0};
|
||||
#endif //WIFI_FEATURE || ETH_FEATURE
|
||||
|
||||
uint8_t Settings_ESP3D::_FirmwareTarget = UNKNOWN_FW;
|
||||
bool Settings_ESP3D::_isverboseboot = DEFAULT_VERBOSE_BOOT;
|
||||
|
||||
bool Settings_ESP3D::begin()
|
||||
{
|
||||
@ -177,9 +179,18 @@ bool Settings_ESP3D::begin()
|
||||
}
|
||||
//get target FW
|
||||
Settings_ESP3D::GetFirmwareTarget(true);
|
||||
Settings_ESP3D::isVerboseBoot(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Settings_ESP3D::isVerboseBoot(bool fromsettings)
|
||||
{
|
||||
if(fromsettings) {
|
||||
_isverboseboot = read_byte (ESP_VERBOSE_BOOT);
|
||||
}
|
||||
return _isverboseboot;
|
||||
}
|
||||
|
||||
uint8_t Settings_ESP3D::GetFirmwareTarget(bool fromsettings)
|
||||
{
|
||||
if(fromsettings) {
|
||||
@ -224,6 +235,9 @@ uint8_t Settings_ESP3D::get_default_byte_value(int pos)
|
||||
case ESP_RADIO_MODE:
|
||||
res = DEFAULT_ESP_RADIO_MODE;
|
||||
break;
|
||||
case ESP_VERBOSE_BOOT:
|
||||
res = DEFAULT_VERBOSE_BOOT;
|
||||
break;
|
||||
case ESP_SETUP:
|
||||
res = DEFAULT_SETUP;
|
||||
break;
|
||||
@ -1015,6 +1029,8 @@ bool Settings_ESP3D::reset()
|
||||
|
||||
//Setup done (internal only)
|
||||
Settings_ESP3D::write_byte(ESP_SETUP,Settings_ESP3D::get_default_byte_value(ESP_SETUP));
|
||||
//Verbose boot
|
||||
Settings_ESP3D::write_byte(ESP_VERBOSE_BOOT,Settings_ESP3D::get_default_byte_value(ESP_VERBOSE_BOOT));
|
||||
|
||||
#if defined(DISPLAY_DEVICE) && defined(DISPLAY_TOUCH_DRIVER)
|
||||
//Calibration done (internal only)
|
||||
|
@ -101,6 +101,8 @@
|
||||
#define ESP_FTP_DATA_PASSIVE_PORT 1017 //4 bytes = int
|
||||
#define ESP_FTP_ON 1021 //1 byte = flag
|
||||
#define ESP_AUTO_NOTIFICATION 1022 //1 byte = flag
|
||||
#define ESP_VERBOSE_BOOT 1023 //1 byte = flag
|
||||
|
||||
|
||||
//Hidden password
|
||||
#define HIDDEN_PASSWORD "********"
|
||||
@ -135,6 +137,7 @@ public:
|
||||
static bool reset();
|
||||
static int8_t GetSettingsVersion();
|
||||
static uint8_t GetFirmwareTarget(bool fromsettings = false);
|
||||
static bool isVerboseBoot(bool fromsettings = false);
|
||||
static uint8_t GetSDDevice();
|
||||
static const char* GetFirmwareTargetShortName();
|
||||
static String IPtoString(uint32_t ip_int);
|
||||
@ -144,6 +147,7 @@ public:
|
||||
private:
|
||||
static bool is_string(const char * s, uint len);
|
||||
static uint8_t _FirmwareTarget;
|
||||
static bool _isverboseboot;
|
||||
};
|
||||
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
#define _VERSION_ESP3D_H
|
||||
|
||||
//version and sources location
|
||||
#define FW_VERSION "3.0.0.a73"
|
||||
#define FW_VERSION "3.0.0.a74"
|
||||
#define REPOSITORY "https://github.com/luc-github/ESP3D/tree/3.0"
|
||||
|
||||
#endif //_VERSION_ESP3D_H
|
||||
|
@ -82,7 +82,7 @@ bool EthConfig::StartSTA()
|
||||
bool EthConfig::begin()
|
||||
{
|
||||
bool res = false;
|
||||
ESP3DOutput output(ESP_SERIAL_CLIENT);
|
||||
ESP3DOutput output(ESP_ALL_CLIENTS);
|
||||
end();
|
||||
_started = ETH.begin();
|
||||
if (_started) {
|
||||
|
@ -210,10 +210,12 @@ bool NetConfig::begin()
|
||||
//clear everything
|
||||
end();
|
||||
int8_t espMode =Settings_ESP3D::read_byte(ESP_RADIO_MODE);
|
||||
ESP3DOutput output(ESP_SERIAL_CLIENT);
|
||||
ESP3DOutput output(ESP_ALL_CLIENTS);
|
||||
if (espMode != NO_NETWORK) {
|
||||
if (Settings_ESP3D::isVerboseBoot()) {
|
||||
output.printMSG("Starting Network");
|
||||
}
|
||||
}
|
||||
//setup events
|
||||
if(!_events_registered) {
|
||||
#ifdef ARDUINO_ARCH_ESP8266
|
||||
@ -234,10 +236,12 @@ bool NetConfig::begin()
|
||||
if (espMode == NO_NETWORK) {
|
||||
WiFi.mode(WIFI_OFF);
|
||||
ESP3DGlobalOutput::display_IP();
|
||||
if (Settings_ESP3D::isVerboseBoot()) {
|
||||
ESP3DOutput output(ESP_ALL_CLIENTS);
|
||||
ESP3DGlobalOutput::SetStatus(RADIO_OFF_MSG);
|
||||
output.printMSG(RADIO_OFF_MSG);
|
||||
output.flush();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#if defined (WIFI_FEATURE)
|
||||
@ -259,11 +263,13 @@ bool NetConfig::begin()
|
||||
#if defined (BLUETOOTH_FEATURE)
|
||||
if ((espMode == ESP_BT)) {
|
||||
WiFi.mode(WIFI_OFF);
|
||||
if (Settings_ESP3D::isVerboseBoot()) {
|
||||
ESP3DOutput output(ESP_ALL_CLIENTS);
|
||||
String msg = "BT On";
|
||||
ESP3DGlobalOutput::SetStatus(msg.c_str());
|
||||
output.printMSG(msg.c_str());
|
||||
output.flush();
|
||||
}
|
||||
res = bt_service.begin();
|
||||
}
|
||||
#endif //BLUETOOTH_FEATURE
|
||||
|
@ -91,9 +91,11 @@ bool NetServices::begin()
|
||||
} else {
|
||||
String tmp = "Current time :";
|
||||
tmp+=timeserver.current_time();
|
||||
if (Settings_ESP3D::isVerboseBoot()) {
|
||||
output.printMSG(tmp.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif //TIMESTAMP_FEATURE
|
||||
|
||||
|
||||
@ -140,7 +142,9 @@ bool NetServices::begin()
|
||||
output.printERROR("End Failed");
|
||||
}
|
||||
});
|
||||
if (Settings_ESP3D::isVerboseBoot()) {
|
||||
output.printMSG("OTA service started");
|
||||
}
|
||||
String lhostname =hostname;
|
||||
lhostname.toLowerCase();
|
||||
ArduinoOTA.setHostname(hostname.c_str());
|
||||
@ -157,9 +161,11 @@ bool NetServices::begin()
|
||||
_started =false;
|
||||
} else {
|
||||
String stmp = "mDNS started with '" + lhostname + ".local'";
|
||||
if (Settings_ESP3D::isVerboseBoot()) {
|
||||
output.printMSG(stmp.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif //MDNS_FEATURE && ARDUINO_ARCH_ESP8266
|
||||
#if defined(MDNS_FEATURE) && defined(ARDUINO_ARCH_ESP32)
|
||||
if(WiFi.getMode() != WIFI_AP) {
|
||||
@ -170,9 +176,11 @@ bool NetServices::begin()
|
||||
_started =false;
|
||||
} else {
|
||||
String stmp = "mDNS started with '" + lhostname + ".local'";
|
||||
if (Settings_ESP3D::isVerboseBoot()) {
|
||||
output.printMSG(stmp.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif //MDNS_FEATURE && ARDUINO_ARCH_ESP8266
|
||||
|
||||
#ifdef CAPTIVE_PORTAL_FEATURE
|
||||
@ -180,7 +188,9 @@ bool NetServices::begin()
|
||||
// if DNSServer is started with "*" for domain name, it will reply with
|
||||
// provided IP to all DNS request
|
||||
if (dnsServer.start(DNS_PORT, "*", WiFi.softAPIP())) {
|
||||
if (Settings_ESP3D::isVerboseBoot()) {
|
||||
output.printMSG("Captive Portal started");
|
||||
}
|
||||
} else {
|
||||
output.printERROR("Failed start Captive Portal");
|
||||
}
|
||||
@ -194,9 +204,11 @@ bool NetServices::begin()
|
||||
} else {
|
||||
if(HTTP_Server::started()) {
|
||||
String stmp = "HTTP server started port " + String(HTTP_Server::port());
|
||||
if (Settings_ESP3D::isVerboseBoot()) {
|
||||
output.printMSG(stmp.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif //HTTP_FEATURE
|
||||
#ifdef TELNET_FEATURE
|
||||
if (!telnet_server.begin()) {
|
||||
@ -205,9 +217,11 @@ bool NetServices::begin()
|
||||
} else {
|
||||
if(telnet_server.started()) {
|
||||
String stmp = "Telnet server started port " + String(telnet_server.port());
|
||||
if (Settings_ESP3D::isVerboseBoot()) {
|
||||
output.printMSG(stmp.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif //TELNET_FEATURE
|
||||
#ifdef FTP_FEATURE
|
||||
if (!ftp_server.begin()) {
|
||||
@ -216,9 +230,11 @@ bool NetServices::begin()
|
||||
} else {
|
||||
if(ftp_server.started()) {
|
||||
String stmp = "Ftp server started ports: " + String(ftp_server.ctrlport()) + ","+ String(ftp_server.dataactiveport()) + ","+ String(ftp_server.datapassiveport());
|
||||
if (Settings_ESP3D::isVerboseBoot()) {
|
||||
output.printMSG(stmp.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif //FTP_FEATURE
|
||||
#ifdef WS_DATA_FEATURE
|
||||
if (!websocket_data_server.begin(Settings_ESP3D::read_uint32(ESP_WEBSOCKET_PORT))) {
|
||||
@ -226,9 +242,11 @@ bool NetServices::begin()
|
||||
} else {
|
||||
if (websocket_data_server.started()) {
|
||||
String stmp = "Websocket server started port " + String(websocket_data_server.port());
|
||||
if (Settings_ESP3D::isVerboseBoot()) {
|
||||
output.printMSG(stmp.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif //WS_DATA_FEATURE
|
||||
#if defined(HTTP_FEATURE)
|
||||
if (!websocket_terminal_server.begin()) {
|
||||
@ -239,7 +257,7 @@ bool NetServices::begin()
|
||||
if(WiFi.getMode() != WIFI_AP) {
|
||||
// Add service to MDNS-SD
|
||||
log_esp3d("Add mdns service http / tcp port %d", HTTP_Server::port());
|
||||
if (!MDNS.addService("http", "tcp", HTTP_Server::port())){
|
||||
if (!MDNS.addService("http", "tcp", HTTP_Server::port())) {
|
||||
log_esp3d("failed");
|
||||
}
|
||||
// TODO add TXT records
|
||||
@ -265,8 +283,10 @@ bool NetServices::begin()
|
||||
SSDP.setManufacturerURL (ESP_MANUFACTURER_URL);
|
||||
SSDP.begin();
|
||||
stmp = "SSDP started with '" + hostname + "'";
|
||||
if (Settings_ESP3D::isVerboseBoot()) {
|
||||
output.printMSG(stmp.c_str());
|
||||
}
|
||||
}
|
||||
#endif //SSDP_FEATURE
|
||||
#ifdef NOTIFICATION_FEATURE
|
||||
notificationsservice.begin();
|
||||
|
@ -141,7 +141,8 @@ const char * SysboolKeysVal[] = {"Active_Printer_LCD",
|
||||
"Active_Serial ",
|
||||
"Active_WebSocket",
|
||||
"Active_Telnet",
|
||||
"Active_BT"
|
||||
"Active_BT",
|
||||
"Boot_verbose"
|
||||
} ;
|
||||
|
||||
const uint16_t SysboolKeysPos[] = {ESP_PRINTER_LCD_FLAG,
|
||||
@ -149,7 +150,8 @@ const uint16_t SysboolKeysPos[] = {ESP_PRINTER_LCD_FLAG,
|
||||
ESP_SERIAL_FLAG,
|
||||
ESP_WEBSOCKET_FLAG,
|
||||
ESP_TELNET_FLAG,
|
||||
ESP_BT_FLAG
|
||||
ESP_BT_FLAG,
|
||||
ESP_VERBOSE_BOOT
|
||||
} ;
|
||||
|
||||
const char * NetbyteKeysVal[] = {
|
||||
@ -285,9 +287,9 @@ bool processingFileFunction (const char * section, const char * key, const char
|
||||
if (strcasecmp(ServboolKeysVal[i],key)==0) {
|
||||
T='B';
|
||||
P=ServboolKeysPos[i];
|
||||
if ((strcasecmp("yes",value)==0)||(strcasecmp("true", value)==0)||(strcasecmp("1", value)==0) ) {
|
||||
if ((strcasecmp("yes",value)==0)||(strcasecmp("on", value)==0)||(strcasecmp("true", value)==0)||(strcasecmp("1", value)==0) ) {
|
||||
b = 1;
|
||||
} else if ((strcasecmp("no", value)==0)||(strcasecmp("false", value)==0)||(strcasecmp("0", value)==0) ) {
|
||||
} else if ((strcasecmp("no", value)==0)||(strcasecmp("off", value)==0)||(strcasecmp("false", value)==0)||(strcasecmp("0", value)==0) ) {
|
||||
b = 0;
|
||||
} else {
|
||||
P=-1;
|
||||
@ -370,9 +372,9 @@ bool processingFileFunction (const char * section, const char * key, const char
|
||||
if (strcasecmp(SysboolKeysVal[i],key)==0) {
|
||||
T='B';
|
||||
P=SysboolKeysPos[i];
|
||||
if ((strcasecmp("yes",value)==0)||(strcasecmp("true", value)==0)||(strcasecmp("1", value)==0) ) {
|
||||
if ((strcasecmp("yes",value)==0)||(strcasecmp("on", value)==0)||(strcasecmp("true", value)==0)||(strcasecmp("1", value)==0) ) {
|
||||
b = 1;
|
||||
} else if ((strcasecmp("no", value)==0)||(strcasecmp("false", value)==0)||(strcasecmp("0", value)==0) ) {
|
||||
} else if ((strcasecmp("no", value)==0)||(strcasecmp("off", value)==0)||(strcasecmp("false", value)==0)||(strcasecmp("0", value)==0) ) {
|
||||
b = 0;
|
||||
} else {
|
||||
P=-1;
|
||||
|
@ -118,6 +118,10 @@ bool WiFiConfig::ConnectSTA2AP()
|
||||
uint8_t dot = 0;
|
||||
wl_status_t status = WiFi.status();
|
||||
ESP3DOutput output(ESP_ALL_CLIENTS);
|
||||
if (!Settings_ESP3D::isVerboseBoot()) {
|
||||
output.printMSG("Connecting");
|
||||
output.flush();
|
||||
}
|
||||
while (status != WL_CONNECTED && count < 40) {
|
||||
|
||||
switch (status) {
|
||||
@ -140,8 +144,10 @@ bool WiFiConfig::ConnectSTA2AP()
|
||||
break;
|
||||
}
|
||||
ESP3DGlobalOutput::SetStatus(msg.c_str());
|
||||
if (Settings_ESP3D::isVerboseBoot()) {
|
||||
output.printMSG(msg.c_str());
|
||||
output.flush();
|
||||
}
|
||||
Hal::wait (500);
|
||||
count++;
|
||||
status = WiFi.status();
|
||||
@ -186,10 +192,12 @@ bool WiFiConfig::StartSTA()
|
||||
IPAddress ip(IP), mask(MK), gateway(GW);
|
||||
WiFi.config(ip, gateway,mask);
|
||||
}
|
||||
ESP3DOutput output(ESP_SERIAL_CLIENT);
|
||||
ESP3DOutput output(ESP_ALL_CLIENTS);
|
||||
if (Settings_ESP3D::isVerboseBoot()) {
|
||||
String stmp;
|
||||
stmp = "Connecting to '" + SSID + "'";;
|
||||
output.printMSG(stmp.c_str());
|
||||
}
|
||||
if (WiFi.begin(SSID.c_str(), (password.length() > 0)?password.c_str():nullptr)) {
|
||||
#if defined (ARDUINO_ARCH_ESP8266)
|
||||
WiFi.setSleepMode(WIFI_NONE_SLEEP);
|
||||
@ -277,8 +285,10 @@ bool WiFiConfig::begin()
|
||||
{
|
||||
bool res = false;
|
||||
end();
|
||||
if (Settings_ESP3D::isVerboseBoot()) {
|
||||
ESP3DOutput output(ESP_ALL_CLIENTS);
|
||||
output.printMSG("Starting WiFi");
|
||||
}
|
||||
int8_t wifiMode =Settings_ESP3D::read_byte(ESP_RADIO_MODE);
|
||||
if (wifiMode == ESP_WIFI_AP) {
|
||||
res = StartAP();
|
||||
|
Loading…
x
Reference in New Issue
Block a user