From 8d9dea5f3eff7bce861da9c97ae6bac85ac8e139 Mon Sep 17 00:00:00 2001 From: George Fu Date: Tue, 21 Apr 2020 17:26:40 +0800 Subject: [PATCH] Update serial info --- ESPWebDAV.ino | 12 ++++++++++-- gcode.cpp | 16 ++++++++++++---- network.cpp | 6 ++++-- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/ESPWebDAV.ino b/ESPWebDAV.ino index 48b30ef..41c92fd 100644 --- a/ESPWebDAV.ino +++ b/ESPWebDAV.ino @@ -23,12 +23,20 @@ void setup() { // ----- WIFI ------- if(config.load() == 1) { // Connected before if(!network.start()) { - SERIAL_ECHOLN(""); SERIAL_ECHOLN("Connect fail, please set the wifi config and connect again"); + SERIAL_ECHOLN("- M50: Set the wifi ssid , 'M50 ssid-name'"); + SERIAL_ECHOLN("- M51: Set the wifi password , 'M51 password'"); + SERIAL_ECHOLN("- M52: Start to connect the wifi"); + SERIAL_ECHOLN("- M53: Check the connection status"); } } else { - SERIAL_ECHOLN("Please set the wifi ssid with M50 and password with M51 , and start connection with M52"); + SERIAL_ECHOLN("Welcome to FYSETC: www.fysetc.com"); + SERIAL_ECHOLN("Please set the wifi config first"); + SERIAL_ECHOLN("- M50: Set the wifi ssid , 'M50 ssid-name'"); + SERIAL_ECHOLN("- M51: Set the wifi password , 'M51 password'"); + SERIAL_ECHOLN("- M52: Start to connect the wifi"); + SERIAL_ECHOLN("- M53: Check the connection status"); } } diff --git a/gcode.cpp b/gcode.cpp index 36b644a..a5f0314 100644 --- a/gcode.cpp +++ b/gcode.cpp @@ -102,7 +102,8 @@ void Gcode::get_serial_commands() { void Gcode::gcode_M50() { for (char *fn = parser.string_arg; *fn; ++fn) if (*fn == ' ') *fn = '\0'; config.ssid(parser.string_arg); - SERIAL_ECHO(config.ssid()); + SERIAL_ECHO("ssid:"); + SERIAL_ECHOLN(config.ssid()); } /** @@ -111,7 +112,8 @@ void Gcode::gcode_M50() { void Gcode::gcode_M51() { for (char *fn = parser.string_arg; *fn; ++fn) if (*fn == ' ') *fn = '\0'; config.password(parser.string_arg); - SERIAL_ECHO(config.password()); + SERIAL_ECHO("password:"); + SERIAL_ECHOLN(config.password()); } /** @@ -119,8 +121,11 @@ void Gcode::gcode_M51() { */ void Gcode::gcode_M52() { if(!network.start()) { - SERIAL_ECHOLN(""); SERIAL_ECHOLN("Connect fail, please set the wifi config and connect again"); + SERIAL_ECHOLN("- M50: Set the wifi ssid , 'M50 ssid-name'"); + SERIAL_ECHOLN("- M51: Set the wifi password , 'M51 password'"); + SERIAL_ECHOLN("- M52: Start to connect the wifi"); + SERIAL_ECHOLN("- M53: Check the connection status"); } } @@ -130,7 +135,10 @@ void Gcode::gcode_M52() { void Gcode::gcode_M53() { if(WiFi.status() != WL_CONNECTED) { SERIAL_ECHOLN("Wifi not connected"); - SERIAL_ECHOLN("Please set the wifi ssid with M50 and password with M51 , and start connection with M52"); + SERIAL_ECHOLN("- M50: Set the wifi ssid , 'M50 ssid-name'"); + SERIAL_ECHOLN("- M51: Set the wifi password , 'M51 password'"); + SERIAL_ECHOLN("- M52: Start to connect the wifi"); + SERIAL_ECHOLN("- M53: Check the connection status"); } else { SERIAL_ECHOLN(""); diff --git a/network.cpp b/network.cpp index 99b1b94..75654b2 100644 --- a/network.cpp +++ b/network.cpp @@ -37,8 +37,10 @@ bool Network::start() { //blink(); SERIAL_ECHO("."); timeout++; - if(timeout++ > WIFI_CONNECT_TIMEOUT/100) + if(timeout++ > WIFI_CONNECT_TIMEOUT/100) { + SERIAL_ECHOLN(""); return false; + } else delay(100); } @@ -79,7 +81,7 @@ void Network::startDAVServer() { } relenquishBusControl(); - DBG_PRINTLN("WebDAV server started"); + DBG_PRINTLN("FYSETC WebDAV server started"); } bool Network::isConnected() {