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:
Luc 2020-12-13 15:48:32 +01:00
parent d72e193712
commit 5073327e30
19 changed files with 196 additions and 96 deletions

View File

@ -53,8 +53,8 @@ Note:
* Sync / Set / Get current time * 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> [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 * Get/Set display/set boot delay in ms / Verbose boot
[ESP150]<time in milliseconds>[pwd=<admin password>] [ESP150]<delay=time in milliseconds><verbose=ON/OFF>[pwd=<admin password>]
* Get/Set WebSocket state which can be ON, OFF * Get/Set WebSocket state which can be ON, OFF
[ESP160]<state>pwd=<admin password> [ESP160]<state>pwd=<admin password>

View File

@ -125,17 +125,20 @@ Baud_rate = 115200
#Boot delay in ms #Boot delay in ms
Boot_delay = 5000 Boot_delay = 5000
#Boot verbose Yes / No
Boot_verbose = No
#Outputs #Outputs
#printer LCD #printer LCD Yes / No
Active_Printer_LCD = Yes Active_Printer_LCD = Yes
#esp3d lcd #esp3d lcd Yes / No
Active_ESP3D_LCD = Yes Active_ESP3D_LCD = Yes
#ESP3D Serial #ESP3D Serial Yes / No
Active_Serial = Yes Active_Serial = Yes
#Websocket #Websocket Yes / No
Active_WebSocket = Yes Active_WebSocket = Yes
#Telnet #Telnet Yes / No
Active_Telnet = Yes Active_Telnet = Yes
#Bluetooth[ESP] #Bluetooth Yes / No
Active_BT = Yes Active_BT = Yes

View File

@ -371,8 +371,8 @@ bool Commands::execute_internal_command (int cmd, const char* cmd_params, level_
response = ESP140(cmd_params, auth_type, output); response = ESP140(cmd_params, auth_type, output);
break; break;
#endif //TIMESTAMP_FEATURE #endif //TIMESTAMP_FEATURE
//Get/Set boot delay //Get/Set display/set boot delay in ms / Verbose boot
//[ESP150]<time>[pwd=<admin password>] //[ESP150]<delay=time in milliseconds><verbose=YES/NO>[pwd=<admin password>]
case 150: case 150:
response = ESP150(cmd_params, auth_type, output); response = ESP150(cmd_params, auth_type, output);
break; break;

View File

@ -252,17 +252,9 @@ size_t ESP3DOutput::printMSG(const char * s, bool withNL)
return 0; return 0;
} }
#endif //HTTP_FEATURE #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) { if (_client & ESP_SCREEN_CLIENT) {
print(s); ESP3DOutput outputscr(ESP_SCREEN_CLIENT);
outputscr.print(s);
} }
switch(Settings_ESP3D::GetFirmwareTarget()) { switch(Settings_ESP3D::GetFirmwareTarget()) {
case GRBL: case GRBL:
@ -272,13 +264,21 @@ size_t ESP3DOutput::printMSG(const char * s, bool withNL)
break; break;
case MARLIN: case MARLIN:
case MARLINKIMBRA: case MARLINKIMBRA:
display = "M117 "; if (_client & ESP_PRINTER_LCD_CLIENT) {
display = "M117 ";
} else {
display = ";echo: ";
}
display += s; display += s;
break; break;
case SMOOTHIEWARE: case SMOOTHIEWARE:
case REPETIER: case REPETIER:
default: default:
display = ";"; if (_client & ESP_PRINTER_LCD_CLIENT) {
display = "M117 ";
} else {
display = ";";
}
display += s; display += s;
} }
if(withNL) { if(withNL) {

View File

@ -41,7 +41,7 @@ const char * help[]= {"[ESP] - display this help",
"[ESP110](State) - display/set radio state which can be STA, AP, OFF", "[ESP110](State) - display/set radio state which can be STA, AP, OFF",
#endif // WIFI_FEATURE || BLUETOOTH_FEATURE || ETH_FEATURE #endif // WIFI_FEATURE || BLUETOOTH_FEATURE || ETH_FEATURE
#if defined( WIFI_FEATURE) || defined (ETH_FEATURE) #if defined( WIFI_FEATURE) || defined (ETH_FEATURE)
"[ESP111]display current IP", "[ESP111](header)display current IP",
#endif //WIFI_FEATURE || ETH_FEATURE #endif //WIFI_FEATURE || ETH_FEATURE
#if defined(WIFI_FEATURE) || defined(ETH_FEATURE) || defined(BT_FEATURE) #if defined(WIFI_FEATURE) || defined(ETH_FEATURE) || defined(BT_FEATURE)
"[ESP112](Hostname) - display/set Hostname", "[ESP112](Hostname) - display/set Hostname",
@ -58,7 +58,7 @@ const char * help[]= {"[ESP] - display this help",
#if defined(TIMESTAMP_FEATURE) #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", "[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 #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) #if defined(WS_DATA_FEATURE)
"[ESP160](State) - display/set WebSocket state which can be ON, OFF, CLOSE", "[ESP160](State) - display/set WebSocket state which can be ON, OFF, CLOSE",
"[ESP161](Port) - display/set WebSocket port", "[ESP161](Port) - display/set WebSocket port",

View File

@ -28,14 +28,16 @@
//[ESP111] //[ESP111]
bool Commands::ESP111(const char* cmd_params, level_authenticate_type auth_type, ESP3DOutput * output) bool Commands::ESP111(const char* cmd_params, level_authenticate_type auth_type, ESP3DOutput * output)
{ {
bool response = true; String parameter = get_param (cmd_params, "");
String parameter;
String res = get_param (cmd_params, "");
(void)auth_type; (void)auth_type;
res += NetConfig::localIP(); if (parameter.length() > 0) {
//log_esp3d("Client %d", output->client()); parameter += " ";
output->printMSG (res.c_str()); parameter += NetConfig::localIP();
return response; output->printLN (parameter.c_str());
} else {
output->printMSG (NetConfig::localIP().c_str());
}
return true;
} }
#endif //WIFI_FEATURE #endif //WIFI_FEATURE

View File

@ -22,8 +22,8 @@
#include "../esp3doutput.h" #include "../esp3doutput.h"
#include "../settings_esp3d.h" #include "../settings_esp3d.h"
#include "../../modules/authentication/authentication_service.h" #include "../../modules/authentication/authentication_service.h"
//Get/Set boot delay // Get/Set display/set boot delay in ms / Verbose boot
//[ESP150]<time>[pwd=<admin password>] //[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 Commands::ESP150(const char* cmd_params, level_authenticate_type auth_type, ESP3DOutput * output)
{ {
bool response = true; bool response = true;
@ -39,7 +39,10 @@ bool Commands::ESP150(const char* cmd_params, level_authenticate_type auth_type,
parameter = get_param (cmd_params, ""); parameter = get_param (cmd_params, "");
//get //get
if (parameter.length() == 0) { 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 { } else {
#ifdef AUTHENTICATION_FEATURE #ifdef AUTHENTICATION_FEATURE
if (auth_type != LEVEL_ADMIN) { if (auth_type != LEVEL_ADMIN) {
@ -47,14 +50,39 @@ bool Commands::ESP150(const char* cmd_params, level_authenticate_type auth_type,
return false; return false;
} }
#endif //AUTHENTICATION_FEATURE #endif //AUTHENTICATION_FEATURE
uint ibuf = parameter.toInt(); response = false;
if ((ibuf > Settings_ESP3D::get_max_int32_value(ESP_BOOT_DELAY)) || (ibuf < Settings_ESP3D::get_min_int32_value(ESP_BOOT_DELAY))) { parameter = get_param (cmd_params, "delay=");
output->printERROR ("Incorrect delay!"); if (parameter.length() != 0) {
return false; 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!");
return false;
}
if (!Settings_ESP3D::write_uint32 (ESP_BOOT_DELAY, ibuf)) {
output->printERROR ("Set failed!");
return false;
} else {
response = true;
}
} }
if (!Settings_ESP3D::write_uint32 (ESP_BOOT_DELAY, ibuf)) { parameter = get_param (cmd_params, "verbose=");
output->printERROR ("Set failed!"); if (parameter.length() != 0) {
response = false; 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 { } else {
output->printMSG ("ok"); output->printMSG ("ok");
} }

View File

@ -39,25 +39,25 @@ bool Commands::ESP202(const char* cmd_params, level_authenticate_type auth_type,
#endif //AUTHENTICATION_FEATURE #endif //AUTHENTICATION_FEATURE
bool response = true; bool response = true;
String parameter; String parameter;
parameter = get_param (cmd_params, ""); parameter = get_param (cmd_params, "");
//get //get
if (parameter.length() == 0) { if (parameter.length() == 0) {
String r = "SPEED=" + String(Settings_ESP3D::read_byte (ESP_SD_SPEED_DIV)); String r = "SPEED=" + String(Settings_ESP3D::read_byte (ESP_SD_SPEED_DIV));
output->printMSG (r.c_str()); output->printMSG (r.c_str());
} else { //set } else { //set
parameter = get_param (cmd_params, "SPEED="); parameter = get_param (cmd_params, "SPEED=");
if ((parameter == "1") || (parameter == "2") || (parameter == "4")|| (parameter == "6")|| (parameter == "8")|| (parameter == "16")|| (parameter == "32")) { if ((parameter == "1") || (parameter == "2") || (parameter == "4")|| (parameter == "6")|| (parameter == "8")|| (parameter == "16")|| (parameter == "32")) {
if (!Settings_ESP3D::write_byte (ESP_SD_SPEED_DIV, parameter.toInt())) { if (!Settings_ESP3D::write_byte (ESP_SD_SPEED_DIV, parameter.toInt())) {
response = false; response = false;
output->printERROR ("Set failed!"); output->printERROR ("Set failed!");
} else { } else {
ESP_SD::setSPISpeedDivider(parameter.toInt()); ESP_SD::setSPISpeedDivider(parameter.toInt());
output->printMSG ("ok"); output->printMSG ("ok");
} }
} else { } else {
output->printERROR ("Invalid parameter!"); output->printERROR ("Invalid parameter!");
response = false; response = false;
} }
} }
return response; return response;
} }

View File

@ -505,7 +505,7 @@ bool Commands::ESP400(const char* cmd_params, level_authenticate_type auth_type,
} }
output->print ("]}"); output->print ("]}");
//Start delay //Start delay
output->print (",{\"F\":\"system/system\",\"P\":\""); output->print (",{\"F\":\"system/boot\",\"P\":\"");
output->print (ESP_BOOT_DELAY); output->print (ESP_BOOT_DELAY);
output->print ("\",\"T\":\"I\",\"V\":\""); output->print ("\",\"T\":\"I\",\"V\":\"");
output->print (Settings_ESP3D::read_uint32(ESP_BOOT_DELAY)); 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 ("\",\"M\":\"");
output->print (Settings_ESP3D::get_min_int32_value(ESP_BOOT_DELAY)); output->print (Settings_ESP3D::get_min_int32_value(ESP_BOOT_DELAY));
output->print ("\"}"); 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 //Output flag
//Serial //Serial
output->print (",{\"F\":\"system/outputmsg\",\"P\":\""); output->print (",{\"F\":\"system/outputmsg\",\"P\":\"");

View File

@ -78,6 +78,9 @@ bool Commands::ESP401(const char* cmd_params, level_authenticate_type auth_type,
case ESP_BT_FLAG: case ESP_BT_FLAG:
ESP3DOutput::isOutput(ESP_ALL_CLIENTS,true); ESP3DOutput::isOutput(ESP_ALL_CLIENTS,true);
break; break;
case ESP_VERBOSE_BOOT:
Settings_ESP3D::isVerboseBoot(true);
break;
case ESP_TARGET_FW: case ESP_TARGET_FW:
Settings_ESP3D::GetFirmwareTarget(true); Settings_ESP3D::GetFirmwareTarget(true);
break; break;

View File

@ -196,8 +196,8 @@ bool Hal::begin()
WiFi.enableAP (false); WiFi.enableAP (false);
WiFi.mode (WIFI_OFF); WiFi.mode (WIFI_OFF);
#if SD_DEVICE_CONNECTION == ESP_SHARED_SD #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); pinMode (ESP_SD_DETECT_PIN, INPUT);
#endif #endif
pinMode (ESP_FLAG_SHARED_SD_PIN, OUTPUT); pinMode (ESP_FLAG_SHARED_SD_PIN, OUTPUT);
digitalWrite(ESP_FLAG_SHARED_SD_PIN, !ESP_FLAG_SHARED_SD_VALUE); digitalWrite(ESP_FLAG_SHARED_SD_PIN, !ESP_FLAG_SHARED_SD_VALUE);

View File

@ -89,6 +89,7 @@
#define DEFAULT_SETUP 0 #define DEFAULT_SETUP 0
#define DEFAULT_VERBOSE_BOOT 0
#define DEFAULT_ESP_BYTE 0 #define DEFAULT_ESP_BYTE 0
#define DEFAULT_ESP_STRING_SIZE 0 #define DEFAULT_ESP_STRING_SIZE 0
#if defined (WIFI_FEATURE) || defined (ETH_FEATURE) #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 #endif //WIFI_FEATURE || ETH_FEATURE
uint8_t Settings_ESP3D::_FirmwareTarget = UNKNOWN_FW; uint8_t Settings_ESP3D::_FirmwareTarget = UNKNOWN_FW;
bool Settings_ESP3D::_isverboseboot = DEFAULT_VERBOSE_BOOT;
bool Settings_ESP3D::begin() bool Settings_ESP3D::begin()
{ {
@ -177,9 +179,18 @@ bool Settings_ESP3D::begin()
} }
//get target FW //get target FW
Settings_ESP3D::GetFirmwareTarget(true); Settings_ESP3D::GetFirmwareTarget(true);
Settings_ESP3D::isVerboseBoot(true);
return 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) uint8_t Settings_ESP3D::GetFirmwareTarget(bool fromsettings)
{ {
if(fromsettings) { if(fromsettings) {
@ -224,6 +235,9 @@ uint8_t Settings_ESP3D::get_default_byte_value(int pos)
case ESP_RADIO_MODE: case ESP_RADIO_MODE:
res = DEFAULT_ESP_RADIO_MODE; res = DEFAULT_ESP_RADIO_MODE;
break; break;
case ESP_VERBOSE_BOOT:
res = DEFAULT_VERBOSE_BOOT;
break;
case ESP_SETUP: case ESP_SETUP:
res = DEFAULT_SETUP; res = DEFAULT_SETUP;
break; break;
@ -1015,6 +1029,8 @@ bool Settings_ESP3D::reset()
//Setup done (internal only) //Setup done (internal only)
Settings_ESP3D::write_byte(ESP_SETUP,Settings_ESP3D::get_default_byte_value(ESP_SETUP)); 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) #if defined(DISPLAY_DEVICE) && defined(DISPLAY_TOUCH_DRIVER)
//Calibration done (internal only) //Calibration done (internal only)

View File

@ -101,6 +101,8 @@
#define ESP_FTP_DATA_PASSIVE_PORT 1017 //4 bytes = int #define ESP_FTP_DATA_PASSIVE_PORT 1017 //4 bytes = int
#define ESP_FTP_ON 1021 //1 byte = flag #define ESP_FTP_ON 1021 //1 byte = flag
#define ESP_AUTO_NOTIFICATION 1022 //1 byte = flag #define ESP_AUTO_NOTIFICATION 1022 //1 byte = flag
#define ESP_VERBOSE_BOOT 1023 //1 byte = flag
//Hidden password //Hidden password
#define HIDDEN_PASSWORD "********" #define HIDDEN_PASSWORD "********"
@ -135,6 +137,7 @@ public:
static bool reset(); static bool reset();
static int8_t GetSettingsVersion(); static int8_t GetSettingsVersion();
static uint8_t GetFirmwareTarget(bool fromsettings = false); static uint8_t GetFirmwareTarget(bool fromsettings = false);
static bool isVerboseBoot(bool fromsettings = false);
static uint8_t GetSDDevice(); static uint8_t GetSDDevice();
static const char* GetFirmwareTargetShortName(); static const char* GetFirmwareTargetShortName();
static String IPtoString(uint32_t ip_int); static String IPtoString(uint32_t ip_int);
@ -144,6 +147,7 @@ public:
private: private:
static bool is_string(const char * s, uint len); static bool is_string(const char * s, uint len);
static uint8_t _FirmwareTarget; static uint8_t _FirmwareTarget;
static bool _isverboseboot;
}; };

View File

@ -22,7 +22,7 @@
#define _VERSION_ESP3D_H #define _VERSION_ESP3D_H
//version and sources location //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" #define REPOSITORY "https://github.com/luc-github/ESP3D/tree/3.0"
#endif //_VERSION_ESP3D_H #endif //_VERSION_ESP3D_H

View File

@ -82,7 +82,7 @@ bool EthConfig::StartSTA()
bool EthConfig::begin() bool EthConfig::begin()
{ {
bool res = false; bool res = false;
ESP3DOutput output(ESP_SERIAL_CLIENT); ESP3DOutput output(ESP_ALL_CLIENTS);
end(); end();
_started = ETH.begin(); _started = ETH.begin();
if (_started) { if (_started) {

View File

@ -210,9 +210,11 @@ bool NetConfig::begin()
//clear everything //clear everything
end(); end();
int8_t espMode =Settings_ESP3D::read_byte(ESP_RADIO_MODE); 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 (espMode != NO_NETWORK) {
output.printMSG("Starting Network"); if (Settings_ESP3D::isVerboseBoot()) {
output.printMSG("Starting Network");
}
} }
//setup events //setup events
if(!_events_registered) { if(!_events_registered) {
@ -234,10 +236,12 @@ bool NetConfig::begin()
if (espMode == NO_NETWORK) { if (espMode == NO_NETWORK) {
WiFi.mode(WIFI_OFF); WiFi.mode(WIFI_OFF);
ESP3DGlobalOutput::display_IP(); ESP3DGlobalOutput::display_IP();
ESP3DOutput output(ESP_ALL_CLIENTS); if (Settings_ESP3D::isVerboseBoot()) {
ESP3DGlobalOutput::SetStatus(RADIO_OFF_MSG); ESP3DOutput output(ESP_ALL_CLIENTS);
output.printMSG(RADIO_OFF_MSG); ESP3DGlobalOutput::SetStatus(RADIO_OFF_MSG);
output.flush(); output.printMSG(RADIO_OFF_MSG);
output.flush();
}
return true; return true;
} }
#if defined (WIFI_FEATURE) #if defined (WIFI_FEATURE)
@ -259,11 +263,13 @@ bool NetConfig::begin()
#if defined (BLUETOOTH_FEATURE) #if defined (BLUETOOTH_FEATURE)
if ((espMode == ESP_BT)) { if ((espMode == ESP_BT)) {
WiFi.mode(WIFI_OFF); WiFi.mode(WIFI_OFF);
ESP3DOutput output(ESP_ALL_CLIENTS); if (Settings_ESP3D::isVerboseBoot()) {
String msg = "BT On"; ESP3DOutput output(ESP_ALL_CLIENTS);
ESP3DGlobalOutput::SetStatus(msg.c_str()); String msg = "BT On";
output.printMSG(msg.c_str()); ESP3DGlobalOutput::SetStatus(msg.c_str());
output.flush(); output.printMSG(msg.c_str());
output.flush();
}
res = bt_service.begin(); res = bt_service.begin();
} }
#endif //BLUETOOTH_FEATURE #endif //BLUETOOTH_FEATURE

View File

@ -91,7 +91,9 @@ bool NetServices::begin()
} else { } else {
String tmp = "Current time :"; String tmp = "Current time :";
tmp+=timeserver.current_time(); tmp+=timeserver.current_time();
output.printMSG(tmp.c_str()); if (Settings_ESP3D::isVerboseBoot()) {
output.printMSG(tmp.c_str());
}
} }
} }
#endif //TIMESTAMP_FEATURE #endif //TIMESTAMP_FEATURE
@ -140,7 +142,9 @@ bool NetServices::begin()
output.printERROR("End Failed"); output.printERROR("End Failed");
} }
}); });
output.printMSG("OTA service started"); if (Settings_ESP3D::isVerboseBoot()) {
output.printMSG("OTA service started");
}
String lhostname =hostname; String lhostname =hostname;
lhostname.toLowerCase(); lhostname.toLowerCase();
ArduinoOTA.setHostname(hostname.c_str()); ArduinoOTA.setHostname(hostname.c_str());
@ -157,7 +161,9 @@ bool NetServices::begin()
_started =false; _started =false;
} else { } else {
String stmp = "mDNS started with '" + lhostname + ".local'"; String stmp = "mDNS started with '" + lhostname + ".local'";
output.printMSG(stmp.c_str()); if (Settings_ESP3D::isVerboseBoot()) {
output.printMSG(stmp.c_str());
}
} }
} }
#endif //MDNS_FEATURE && ARDUINO_ARCH_ESP8266 #endif //MDNS_FEATURE && ARDUINO_ARCH_ESP8266
@ -170,7 +176,9 @@ bool NetServices::begin()
_started =false; _started =false;
} else { } else {
String stmp = "mDNS started with '" + lhostname + ".local'"; String stmp = "mDNS started with '" + lhostname + ".local'";
output.printMSG(stmp.c_str()); if (Settings_ESP3D::isVerboseBoot()) {
output.printMSG(stmp.c_str());
}
} }
} }
#endif //MDNS_FEATURE && ARDUINO_ARCH_ESP8266 #endif //MDNS_FEATURE && ARDUINO_ARCH_ESP8266
@ -180,7 +188,9 @@ bool NetServices::begin()
// if DNSServer is started with "*" for domain name, it will reply with // if DNSServer is started with "*" for domain name, it will reply with
// provided IP to all DNS request // provided IP to all DNS request
if (dnsServer.start(DNS_PORT, "*", WiFi.softAPIP())) { if (dnsServer.start(DNS_PORT, "*", WiFi.softAPIP())) {
output.printMSG("Captive Portal started"); if (Settings_ESP3D::isVerboseBoot()) {
output.printMSG("Captive Portal started");
}
} else { } else {
output.printERROR("Failed start Captive Portal"); output.printERROR("Failed start Captive Portal");
} }
@ -194,7 +204,9 @@ bool NetServices::begin()
} else { } else {
if(HTTP_Server::started()) { if(HTTP_Server::started()) {
String stmp = "HTTP server started port " + String(HTTP_Server::port()); String stmp = "HTTP server started port " + String(HTTP_Server::port());
output.printMSG(stmp.c_str()); if (Settings_ESP3D::isVerboseBoot()) {
output.printMSG(stmp.c_str());
}
} }
} }
#endif //HTTP_FEATURE #endif //HTTP_FEATURE
@ -205,7 +217,9 @@ bool NetServices::begin()
} else { } else {
if(telnet_server.started()) { if(telnet_server.started()) {
String stmp = "Telnet server started port " + String(telnet_server.port()); String stmp = "Telnet server started port " + String(telnet_server.port());
output.printMSG(stmp.c_str()); if (Settings_ESP3D::isVerboseBoot()) {
output.printMSG(stmp.c_str());
}
} }
} }
#endif //TELNET_FEATURE #endif //TELNET_FEATURE
@ -216,7 +230,9 @@ bool NetServices::begin()
} else { } else {
if(ftp_server.started()) { if(ftp_server.started()) {
String stmp = "Ftp server started ports: " + String(ftp_server.ctrlport()) + ","+ String(ftp_server.dataactiveport()) + ","+ String(ftp_server.datapassiveport()); String stmp = "Ftp server started ports: " + String(ftp_server.ctrlport()) + ","+ String(ftp_server.dataactiveport()) + ","+ String(ftp_server.datapassiveport());
output.printMSG(stmp.c_str()); if (Settings_ESP3D::isVerboseBoot()) {
output.printMSG(stmp.c_str());
}
} }
} }
#endif //FTP_FEATURE #endif //FTP_FEATURE
@ -226,7 +242,9 @@ bool NetServices::begin()
} else { } else {
if (websocket_data_server.started()) { if (websocket_data_server.started()) {
String stmp = "Websocket server started port " + String(websocket_data_server.port()); String stmp = "Websocket server started port " + String(websocket_data_server.port());
output.printMSG(stmp.c_str()); if (Settings_ESP3D::isVerboseBoot()) {
output.printMSG(stmp.c_str());
}
} }
} }
#endif //WS_DATA_FEATURE #endif //WS_DATA_FEATURE
@ -239,7 +257,7 @@ bool NetServices::begin()
if(WiFi.getMode() != WIFI_AP) { if(WiFi.getMode() != WIFI_AP) {
// Add service to MDNS-SD // Add service to MDNS-SD
log_esp3d("Add mdns service http / tcp port %d", HTTP_Server::port()); 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"); log_esp3d("failed");
} }
// TODO add TXT records // TODO add TXT records
@ -265,7 +283,9 @@ bool NetServices::begin()
SSDP.setManufacturerURL (ESP_MANUFACTURER_URL); SSDP.setManufacturerURL (ESP_MANUFACTURER_URL);
SSDP.begin(); SSDP.begin();
stmp = "SSDP started with '" + hostname + "'"; stmp = "SSDP started with '" + hostname + "'";
output.printMSG(stmp.c_str()); if (Settings_ESP3D::isVerboseBoot()) {
output.printMSG(stmp.c_str());
}
} }
#endif //SSDP_FEATURE #endif //SSDP_FEATURE
#ifdef NOTIFICATION_FEATURE #ifdef NOTIFICATION_FEATURE

View File

@ -141,7 +141,8 @@ const char * SysboolKeysVal[] = {"Active_Printer_LCD",
"Active_Serial ", "Active_Serial ",
"Active_WebSocket", "Active_WebSocket",
"Active_Telnet", "Active_Telnet",
"Active_BT" "Active_BT",
"Boot_verbose"
} ; } ;
const uint16_t SysboolKeysPos[] = {ESP_PRINTER_LCD_FLAG, const uint16_t SysboolKeysPos[] = {ESP_PRINTER_LCD_FLAG,
@ -149,7 +150,8 @@ const uint16_t SysboolKeysPos[] = {ESP_PRINTER_LCD_FLAG,
ESP_SERIAL_FLAG, ESP_SERIAL_FLAG,
ESP_WEBSOCKET_FLAG, ESP_WEBSOCKET_FLAG,
ESP_TELNET_FLAG, ESP_TELNET_FLAG,
ESP_BT_FLAG ESP_BT_FLAG,
ESP_VERBOSE_BOOT
} ; } ;
const char * NetbyteKeysVal[] = { const char * NetbyteKeysVal[] = {
@ -285,9 +287,9 @@ bool processingFileFunction (const char * section, const char * key, const char
if (strcasecmp(ServboolKeysVal[i],key)==0) { if (strcasecmp(ServboolKeysVal[i],key)==0) {
T='B'; T='B';
P=ServboolKeysPos[i]; 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; 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; b = 0;
} else { } else {
P=-1; P=-1;
@ -370,9 +372,9 @@ bool processingFileFunction (const char * section, const char * key, const char
if (strcasecmp(SysboolKeysVal[i],key)==0) { if (strcasecmp(SysboolKeysVal[i],key)==0) {
T='B'; T='B';
P=SysboolKeysPos[i]; 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; 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; b = 0;
} else { } else {
P=-1; P=-1;
@ -536,4 +538,4 @@ void UpdateService::end()
void UpdateService::handle() {} void UpdateService::handle() {}
#endif //SD_UPDATE_FEATURE #endif //SD_UPDATE_FEATURE

View File

@ -118,6 +118,10 @@ bool WiFiConfig::ConnectSTA2AP()
uint8_t dot = 0; uint8_t dot = 0;
wl_status_t status = WiFi.status(); wl_status_t status = WiFi.status();
ESP3DOutput output(ESP_ALL_CLIENTS); ESP3DOutput output(ESP_ALL_CLIENTS);
if (!Settings_ESP3D::isVerboseBoot()) {
output.printMSG("Connecting");
output.flush();
}
while (status != WL_CONNECTED && count < 40) { while (status != WL_CONNECTED && count < 40) {
switch (status) { switch (status) {
@ -140,8 +144,10 @@ bool WiFiConfig::ConnectSTA2AP()
break; break;
} }
ESP3DGlobalOutput::SetStatus(msg.c_str()); ESP3DGlobalOutput::SetStatus(msg.c_str());
output.printMSG(msg.c_str()); if (Settings_ESP3D::isVerboseBoot()) {
output.flush(); output.printMSG(msg.c_str());
output.flush();
}
Hal::wait (500); Hal::wait (500);
count++; count++;
status = WiFi.status(); status = WiFi.status();
@ -186,10 +192,12 @@ bool WiFiConfig::StartSTA()
IPAddress ip(IP), mask(MK), gateway(GW); IPAddress ip(IP), mask(MK), gateway(GW);
WiFi.config(ip, gateway,mask); WiFi.config(ip, gateway,mask);
} }
ESP3DOutput output(ESP_SERIAL_CLIENT); ESP3DOutput output(ESP_ALL_CLIENTS);
String stmp; if (Settings_ESP3D::isVerboseBoot()) {
stmp = "Connecting to '" + SSID + "'";; String stmp;
output.printMSG(stmp.c_str()); stmp = "Connecting to '" + SSID + "'";;
output.printMSG(stmp.c_str());
}
if (WiFi.begin(SSID.c_str(), (password.length() > 0)?password.c_str():nullptr)) { if (WiFi.begin(SSID.c_str(), (password.length() > 0)?password.c_str():nullptr)) {
#if defined (ARDUINO_ARCH_ESP8266) #if defined (ARDUINO_ARCH_ESP8266)
WiFi.setSleepMode(WIFI_NONE_SLEEP); WiFi.setSleepMode(WIFI_NONE_SLEEP);
@ -277,8 +285,10 @@ bool WiFiConfig::begin()
{ {
bool res = false; bool res = false;
end(); end();
ESP3DOutput output(ESP_ALL_CLIENTS); if (Settings_ESP3D::isVerboseBoot()) {
output.printMSG("Starting WiFi"); ESP3DOutput output(ESP_ALL_CLIENTS);
output.printMSG("Starting WiFi");
}
int8_t wifiMode =Settings_ESP3D::read_byte(ESP_RADIO_MODE); int8_t wifiMode =Settings_ESP3D::read_byte(ESP_RADIO_MODE);
if (wifiMode == ESP_WIFI_AP) { if (wifiMode == ESP_WIFI_AP) {
res = StartAP(); res = StartAP();