mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-08-12 08:28:59 +08:00
Add ESP700 command
Send file line by line from SPIFFS: [ESP700]<file name> for macro purpose
This commit is contained in:
parent
b7afbafb52
commit
7c0afb3f0c
11
README.md
11
README.md
@ -102,12 +102,13 @@ Additionally 404.tpl (the page not found) and restart.tpl(restart page when appl
|
|||||||
|
|
||||||
##Direct commands:
|
##Direct commands:
|
||||||
```
|
```
|
||||||
-restart module from host/printer: [ESP888]RESTART
|
-Restart module from host/printer: [ESP888]RESTART
|
||||||
|
-Send file line by line from SPIFFS: [ESP700]<file name>
|
||||||
-Get IP (only printer see answer): [ESP111]M117
|
-Get IP (only printer see answer): [ESP111]M117
|
||||||
-reset EEPROM and restart: [ESP444]RESET
|
-Reset EEPROM and restart: [ESP444]RESET
|
||||||
-reset user password: [ESP555]<admin password>
|
-Deset user password: [ESP555]<admin password>
|
||||||
-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>
|
-SSID: [ESP100]<SSID>
|
||||||
-Password: [ESP101]<Password>
|
-Password: [ESP101]<Password>
|
||||||
-Station mode: [ESP103]STA
|
-Station mode: [ESP103]STA
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "wifi.h"
|
#include "wifi.h"
|
||||||
#include "webinterface.h"
|
#include "webinterface.h"
|
||||||
|
#include <FS.h>
|
||||||
|
|
||||||
String COMMAND::buffer_serial;
|
String COMMAND::buffer_serial;
|
||||||
String COMMAND::buffer_tcp;
|
String COMMAND::buffer_tcp;
|
||||||
@ -119,6 +120,32 @@ void COMMAND::execute_command(int cmd,String cmd_params)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
case 700: //read local file
|
||||||
|
{//be sure serial is locked
|
||||||
|
if ((web_interface->blockserial)) break;
|
||||||
|
cmd_params.trim() ;
|
||||||
|
if ((cmd_params.length() > 0) && (cmd_params[0] != '/')) cmd_params = "/" + cmd_params;
|
||||||
|
File currentfile = SPIFFS.open(cmd_params, "r");
|
||||||
|
if (currentfile) {//if file open success
|
||||||
|
//flush to be sure send buffer is empty
|
||||||
|
Serial.flush();
|
||||||
|
//read content
|
||||||
|
String currentline = currentfile.readString();
|
||||||
|
//until no line in file
|
||||||
|
while (currentline.length() >0)
|
||||||
|
{ //send line to serial
|
||||||
|
Serial.println(currentline);
|
||||||
|
//flush to be sure send buffer is empty
|
||||||
|
delay(0);
|
||||||
|
Serial.flush();
|
||||||
|
currentline="";
|
||||||
|
//read next line if any
|
||||||
|
currentline = currentfile.readString();
|
||||||
|
}
|
||||||
|
currentfile.close()
|
||||||
|
; }
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 888:
|
case 888:
|
||||||
if (cmd_params=="RESTART") {
|
if (cmd_params=="RESTART") {
|
||||||
Serial.print("\r");
|
Serial.print("\r");
|
||||||
|
@ -68,7 +68,7 @@
|
|||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include "wifi.h"
|
#include "wifi.h"
|
||||||
//version and sources location
|
//version and sources location
|
||||||
#define FW_VERSION "0.7.71"
|
#define FW_VERSION "0.7.72"
|
||||||
#define REPOSITORY "https://github.com/luc-github/ESP8266"
|
#define REPOSITORY "https://github.com/luc-github/ESP8266"
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user