mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-08-15 16:05:59 +08:00
Add command for SSID/PASSWORD/AP or STA/DHCP or STATIC
[ESP100]<SSID> : SSID [ESP101]<Password> : Password [ESP103]STA : Station mode [ESP103]AP : AP mode [ESP103]STATIC : IP Static [ESP103]DHCP : use DHCP
This commit is contained in:
parent
e86ea98718
commit
fa9b87f734
11
README.md
11
README.md
@ -105,11 +105,18 @@ Currently, I tested on ESP01 using 64K SPIFFS ( please use data directory conten
|
|||||||
*from printer/host to module (not fully implemented)
|
*from printer/host to module (not fully implemented)
|
||||||
-request configuration/status
|
-request configuration/status
|
||||||
-set AP/STATION,SSID,PASSSWORD,DHC/STATIC,IP,MASK,GW,BAUD from serial
|
-set AP/STATION,SSID,PASSSWORD,DHC/STATIC,IP,MASK,GW,BAUD from serial
|
||||||
-restart module from host/printer: [ESP888]RESTART (done)
|
-restart module from host/printer: [ESP888]RESTART
|
||||||
-Get IP (only printer see answer): [ESP111]M117 (done)
|
-Get IP (only printer see answer): [ESP111]M117
|
||||||
-reset EEPROM and restart: [ESP444]RESET
|
-reset EEPROM and restart: [ESP444]RESET
|
||||||
-display EEPROM content: [ESP444]CONFIG
|
-display EEPROM content: [ESP444]CONFIG
|
||||||
-go to safe mode without restart: [ESP444]SAFEMODE
|
-go to safe mode without restart: [ESP444]SAFEMODE
|
||||||
|
-SSID: [ESP100]<SSID>
|
||||||
|
-Password: [ESP101]<Password>
|
||||||
|
-Station mode: [ESP103]STA
|
||||||
|
-AP mode: [ESP103]AP
|
||||||
|
-IP Static: [ESP103]STATIC
|
||||||
|
-IP DHCP: [ESP103]DHCP
|
||||||
|
|
||||||
|
|
||||||
##Front End (implemented)
|
##Front End (implemented)
|
||||||
--Display printer status (done)
|
--Display printer status (done)
|
||||||
|
@ -36,9 +36,31 @@ void COMMAND::execute_command(int cmd,String cmd_params)
|
|||||||
|
|
||||||
switch(cmd)
|
switch(cmd)
|
||||||
{
|
{
|
||||||
|
byte mode;
|
||||||
case 800:
|
case 800:
|
||||||
Serial.println("\nCommand received");
|
Serial.println("\nCommand received");
|
||||||
break;
|
break;
|
||||||
|
case 100:
|
||||||
|
if(!CONFIG::write_string(EP_SSID,cmd_params.c_str()))Serial.println("\nError");
|
||||||
|
else Serial.println("\nOk");
|
||||||
|
break;
|
||||||
|
case 101:
|
||||||
|
if(!CONFIG::write_string(EP_PASSWORD,cmd_params.c_str()))Serial.println("\nError");
|
||||||
|
else Serial.println("\nOk");
|
||||||
|
break;
|
||||||
|
case 103:
|
||||||
|
|
||||||
|
if (cmd_params=="STA")mode = CLIENT_MODE;
|
||||||
|
else mode=AP_MODE;
|
||||||
|
if(!CONFIG::write_byte(EP_WIFI_MODE,mode))Serial.println("\nError");
|
||||||
|
else Serial.println("\nOk");
|
||||||
|
break;
|
||||||
|
case 104:
|
||||||
|
if (cmd_params=="STATIC")mode = STATIC_IP_MODE;
|
||||||
|
else mode=DHCP_MODE;
|
||||||
|
if(!CONFIG::write_byte(EP_IP_MODE,mode))Serial.println("\nError");
|
||||||
|
else Serial.println("\nOk");
|
||||||
|
break;
|
||||||
case 111:
|
case 111:
|
||||||
{
|
{
|
||||||
String currentIP ;
|
String currentIP ;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user