Skip to content

Commit 1d4f9d4

Browse files
committed
Add STA Fallback option (AP, BT, OFF)
Add Command to set verbose boot Fix error with ethernet msg in [ESP110] Fix [ESP0] now displaying context help Fix ESP32 litlleFS 2.0 need / as default root path Fix embedded page overflow on mobile with long file names
1 parent ea01606 commit 1d4f9d4

26 files changed

+778
-471
lines changed

.vscode/settings.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
{
2-
"git.ignoreLimitWarning": true
2+
"git.ignoreLimitWarning": true,
3+
"files.associations": {
4+
"*.tcc": "cpp",
5+
"fstream": "cpp"
6+
}
37
}

docs/Commands.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Note:
1414
* Set/Get STA IP/Mask/GW/DNS
1515
[ESP103]IP=<IP> MSK=<IP> GW=<IP> DNS=<IP> pwd=<admin password>
1616

17+
* Set/Get sta fallback mode which can be WIFI-AP, BT, OFF
18+
[ESP104]<state>pwd=<admin password>
19+
1720
* Set/Get AP SSID
1821
[ESP105]<SSID>pwd=<admin password>
1922

@@ -235,6 +238,9 @@ rmdir / remove / mkdir / exists / create
235238
* Get state / Set Enable / Disable Serial Communication
236239
[ESP900]<ENABLE/DISABLE>[pwd=<admin/user password>]
237240

241+
* Get state / Set Enable / Disable verbose boot
242+
[ESP901]<ENABLE/DISABLE>[pwd=<admin/user password>]
243+
238244
* Get state / Set Enable / Disable buzzer
239245
[ESP910]<ENABLE/DISABLE>[pwd=<admin/user password>]
240246

docs/esp3dcnf.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ hostname = myesp
55
#Radio mode BT, WIFI-STA, WIFI-AP, ETH-STA, OFF
66
radio_mode = WIFI-STA
77

8+
#Station fallback mode BT, WIFI-AP, OFF
9+
sta_fallback = WIFI-AP
10+
811
#Active when boot device or not Yes / No
912
Radio_enabled = Yes
1013

embedded/src/index.html

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,10 @@
6262
<div id="filecontent" class="panel">
6363
<div id="filecontentbody" class="panel-body no-header">
6464
<div class="label" id="path">/</div>
65-
<table class="table table-striped">
66-
<thead>
67-
<tr>
68-
<th>Type</th>
69-
<th>Name</th>
70-
<th>Size</th>
71-
<th width="0%"></th>
72-
<th width="100%"></th>
73-
</tr>
74-
</thead>
75-
<tbody id="fileList"></tbody>
76-
</table>
65+
66+
67+
<div id="fileList"></div>
68+
7769
</div>
7870
<div id="filecontentFooter" class="panel-footer"></div>
7971
</div>

embedded/src/index.js

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ let wsMsg = "";
3030
let logOff = false;
3131
let pageId = "";
3232
let currentPath = "/";
33-
const version = "3.0.0.a2";
33+
const version = "3.0.0.a3";
3434
let xmlhttpupload;
3535
let prgfiletext;
3636
let prgfile;
@@ -490,25 +490,29 @@ function dispatchFileStatus(jsonresponse) {
490490
else newPath = currentPath.substring(0, pos);
491491
console.log("newpath:" + newPath);
492492
content +=
493-
"<tr ><td>" +
493+
"<div class='fileLine'>" +
494+
"<div class='fileLineHead'>"+
495+
"<div class='filetype'>"+
494496
backIcon() +
495-
"</td><td class='fileitem' id='updir'> Up..</td><td colspan='3'></td></tr>";
497+
"</div><div class='fileitem' id='updir'> Up..</div></div></div>";
496498
eventslisteners.push({ action: "updir", id: "updir", target: newPath });
497499
}
498500
for (let i1 = 0; i1 < json.files.length; i1++) {
499501
if (String(json.files[i1].size) == "-1") {
500502
content +=
501-
"<tr><td>" +
503+
"<div class='fileLine'>" +
504+
"<div class='fileLineHead'>"+
505+
"<div class='filetype'>"+
502506
dirIcon() +
503-
"</td><td class='fileitem' id='Dir" +
507+
"</div><div class='fileitem' id='Dir" +
504508
i1 +
505509
"'>" +
506510
json.files[i1].name +
507-
"</td><td></td><td class='fileicon' id='DirDel" +
511+
"</div></div><div class='fileicon' id='DirDel" +
508512
i1 +
509513
"'>" +
510514
trashIcon() +
511-
"</td><td></td></tr>";
515+
"</div></div>";
512516
eventslisteners.push({
513517
action: "dir",
514518
id: "Dir" + i1,
@@ -531,19 +535,21 @@ function dispatchFileStatus(jsonresponse) {
531535
showESP3Dbutton = true;
532536
}
533537
content +=
534-
"<tr><td>" +
538+
"<div class='fileLine' >" +
539+
"<div class='fileLineHead'>"+
540+
"<div class='filetype'>"+
535541
fileIcon() +
536-
"</td><td class='fileitem' id='File" +
542+
"</div><div class='fileitem' id='File" +
537543
i1 +
538544
"'>" +
539545
json.files[i1].name +
540-
"</td><td>" +
546+
"</div></div><div class='fileLineTail'><div class='filesize'>" +
541547
json.files[i1].size +
542-
"</td><td class='fileicon' id='FileDel" +
548+
"</div><div class='fileicon' id='FileDel" +
543549
i1 +
544550
"'>" +
545551
trashIcon() +
546-
"</td><td></td></tr>";
552+
"</div></div></div>";
547553
eventslisteners.push({
548554
action: "file",
549555
id: "File" + i1,

embedded/src/style.css

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -269,20 +269,37 @@ li {
269269
display: none;
270270
}
271271

272-
.table {
273-
border: 0px;
274-
border-spacing: 0;
275-
max-width: 100%;
272+
.filesize,
273+
.filetype,
274+
.fileitem,
275+
.fileicon {
276+
padding: 5px 5px;
277+
border-radius: 5px 5px;
278+
background-color: white;
276279
}
277280

278-
.table th,
279-
.table td {
280-
white-space: nowrap;
281-
padding: 8px;
281+
.fileLineTail {
282+
background-color: white;
283+
display: flex;
284+
justify-content: space-between;
285+
column-gap: 10px;
286+
}
287+
288+
.fileLineHead {
289+
background-color: white;
290+
display: flex;
291+
justify-content: space-between;
292+
column-gap: 10px;
293+
}
294+
295+
.fileLine {
296+
display: flex;
297+
justify-content: space-between;
282298
line-height: 1.42857143;
283-
vertical-align: top;
299+
vertical-align: center;
284300
border-top: 1px solid #5755d9;
285301
background-color: white;
302+
padding: 8px;
286303
}
287304

288305
svg {

esp3d/configuration.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
//#define ETH_FEATURE
5353

5454
//BLUETOOTH_FEATURE : enable BT Serial function
55-
//#define BLUETOOTH_FEATURE
55+
#define BLUETOOTH_FEATURE
5656

5757
//HTTP_FEATURE : enable HTTP function
5858
#define HTTP_FEATURE
@@ -165,7 +165,7 @@
165165
//FS_SD mount SD FS
166166
//FS_USBDISK mount USB disk FS
167167

168-
#define WEBDAV_FEATURE FS_FLASH
168+
//#define WEBDAV_FEATURE FS_FLASH
169169

170170
//FTP_FEATURE : enable FTP feature
171171
//FS_ROOT mount all FS

esp3d/src/core/commands.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,13 @@ bool Commands::execute_internal_command (int cmd, const char* cmd_params, level_
288288
response = ESP103(cmd_params, auth_type, output);
289289
break;
290290
#endif //WIFI_FEATURE ||ETH_FEATURE
291+
#if defined( WIFI_FEATURE) || defined( BLUETOOTH_FEATURE) || defined (ETH_FEATURE)
292+
//Set fallback mode which can be BT, WIFI-AP, OFF
293+
//[ESP104]<state>pwd=<admin password>
294+
case 104:
295+
response = ESP104(cmd_params, auth_type, output);
296+
break;
297+
#endif //WIFI_FEATURE || BLUETOOTH_FEATURE || ETH_FEATURE)
291298
#if defined (WIFI_FEATURE)
292299
//AP SSID
293300
//[ESP105]<SSID>[pwd=<admin password>]
@@ -623,6 +630,11 @@ bool Commands::execute_internal_command (int cmd, const char* cmd_params, level_
623630
case 900:
624631
response = ESP900(cmd_params, auth_type, output);
625632
break;
633+
//Get state / Set Enable / Disable Verbose boot
634+
//[ESP901]<ENABLE/DISABLE>
635+
case 901:
636+
response = ESP901(cmd_params, auth_type, output);
637+
break;
626638
#ifdef BUZZER_DEVICE
627639
//Get state / Set Enable / Disable buzzer
628640
//[ESP910]<ENABLE/DISABLE>

esp3d/src/core/commands.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ class Commands
4545
bool ESP102(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
4646
bool ESP103(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
4747
#endif //WIFI_FEATURE ||ETH_FEATURE
48+
#if defined( WIFI_FEATURE) || defined( BLUETOOTH_FEATURE) || defined (ETH_FEATURE)
49+
bool ESP104(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
50+
#endif //WIFI_FEATURE || BLUETOOTH_FEATURE || ETH_FEATURE
4851
#if defined (WIFI_FEATURE)
4952
bool ESP105(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
5053
bool ESP106(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
@@ -147,6 +150,7 @@ class Commands
147150
#endif //GLOBAL_FILESYSTEM_FEATURE
148151
bool ESP800(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
149152
bool ESP900(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
153+
bool ESP901(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
150154
bool ESP920(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);
151155
#ifdef BUZZER_DEVICE
152156
bool ESP910(const char* cmd_params, level_authenticate_type auth_level, ESP3DOutput * output);

esp3d/src/core/espcmd/ESP0.cpp

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,25 @@ const char * help[]= {"[ESP] - display this help",
3030
"[ESP102](Mode) - display/set STA IP mode (DHCP/STATIC)",
3131
"[ESP103](IP=xxxx MSK=xxxx GW=xxxx) - display/set STA IP/Mask/GW",
3232
#endif //WIFI_FEATURE || ETH_FEATURE
33+
#if defined( WIFI_FEATURE) || defined( BLUETOOTH_FEATURE) || defined (ETH_FEATURE)
34+
"[ESP104](State) - display/set sta fallback mode which can be BT, AP, OFF",
35+
#endif // WIFI_FEATURE || BLUETOOTH_FEATURE || ETH_FEATURE
3336
#if defined (WIFI_FEATURE)
3437
"[ESP105](SSID) - display/set AP SSID",
3538
"[ESP106](Password) - set AP password",
3639
"[ESP107](IP) - display/set AP IP",
3740
"[ESP108](Chanel) - display/set AP chanel",
3841
#endif //WIFI_FEATURE
3942
#if defined( WIFI_FEATURE) || defined( BLUETOOTH_FEATURE) || defined (ETH_FEATURE)
40-
"[ESP110](State) - display/set radio state which can be STA, AP, OFF",
43+
"[ESP110](State) - display/set radio state which can be BT, STA, AP, OFF",
4144
#endif // WIFI_FEATURE || BLUETOOTH_FEATURE || ETH_FEATURE
4245
#if defined( WIFI_FEATURE) || defined (ETH_FEATURE)
4346
"[ESP111](header)display current IP",
4447
#endif //WIFI_FEATURE || ETH_FEATURE
4548
#if defined(WIFI_FEATURE) || defined(ETH_FEATURE) || defined(BT_FEATURE)
4649
"[ESP112](Hostname) - display/set Hostname",
47-
"[ESP114](State) - display/set boot Network state which can be ON, OFF",
48-
"[ESP115](State) - display/set immediate Network state which can be ON, OFF",
50+
"[ESP114](State) - display/set boot Network state which can be ON, OFF",
51+
"[ESP115](State) - display/set immediate Network state which can be ON, OFF",
4952
#endif //WIFI_FEATURE || ETH_FEATURE || BT_FEATURE
5053
#if defined(HTTP_FEATURE)
5154
"[ESP120](State) - display/set HTTP state which can be ON, OFF",
@@ -129,18 +132,19 @@ const char * help[]= {"[ESP] - display this help",
129132
#endif //SD_DEVICE
130133
#if defined(FILESYSTEM_FEATURE)
131134
"[ESP720](path) - List ESP Filesystem",
132-
"[ESP730](Action)=(path) - rmdir / remove / mkdir / exists / create on ESP FileSystem (path)",
135+
"[[ESP730]](Action)=(path) - rmdir / remove / mkdir / exists / create on ESP FileSystem (path)",
133136
#endif //FILESYSTEM_FEATURE
134137
#if defined (SD_DEVICE)
135138
"[ESP740](path) - List SD Filesystem",
136139
"[ESP750](Action)=(path) - rmdir / remove / mkdir / exists / create on SD (path)",
137140
#endif //SD_DEVICE
138141
#if defined (GLOBAL_FILESYSTEM_FEATURE)
139142
"[ESP780](path) - List Global Filesystem",
140-
"[ESP750](Action)=(path) - rmdir / remove / mkdir / exists / create on Global Filesystem (path)",
143+
"[ESP790](Action)=(path) - rmdir / remove / mkdir / exists / create on Global Filesystem (path)",
141144
#endif //GLOBAL_FILESYSTEM_FEATURE
142145
"[ESP800](plain)(time=YYYY-MM-DD-HH-MM-SS) - display FW Informations in plain/JSON",
143146
"[ESP900](ENABLE/DISABLE) - display/set serial state",
147+
"[ESP901](ENABLE/DISABLE) - display/set verbose boot",
144148
#ifdef BUZZER_DEVICE
145149
"[ESP910](ENABLE/DISABLE) - display/set buzzer state",
146150
#endif //BUZZER_DEVICE
@@ -156,6 +160,9 @@ const uint cmdlist[]= {0,
156160
102,
157161
103,
158162
#endif //WIFI_FEATURE || ETH_FEATURE
163+
#if defined( WIFI_FEATURE) || defined( BLUETOOTH_FEATURE) || defined (ETH_FEATURE)
164+
104,
165+
#endif // WIFI_FEATURE || BLUETOOTH_FEATURE || ETH_FEATURE
159166
#if defined (WIFI_FEATURE)
160167
105,
161168
106,
@@ -170,6 +177,7 @@ const uint cmdlist[]= {0,
170177
#endif //WIFI_FEATURE || ETH_FEATURE
171178
#if defined(WIFI_FEATURE) || defined(ETH_FEATURE) || defined(BT_FEATURE)
172179
112,
180+
114,
173181
115,
174182
#endif //WIFI_FEATURE || ETH_FEATURE || BT_FEATURE
175183
#if defined(HTTP_FEATURE)
@@ -197,14 +205,17 @@ const uint cmdlist[]= {0,
197205
#endif //FTP_FEATURE
198206
#if defined(WEBDAV_FEATURE)
199207
190,
200-
111,
208+
191,
201209
#endif //WEBDAV_FEATURE
202210
#if defined (SD_DEVICE)
203211
200,
204212
#endif //SD_DEVICE
205213
#ifdef DIRECT_PIN_FEATURE
206214
201,
207215
#endif //DIRECT_PIN_FEATURE
216+
#if defined (SD_DEVICE)
217+
202,
218+
#endif //SD_DEVICE
208219
#ifdef SENSOR_DEVICE
209220
210,
210221
#endif //SENSOR_DEVICE
@@ -235,6 +246,7 @@ const uint cmdlist[]= {0,
235246
#if defined(NOTIFICATION_FEATURE)
236247
600,
237248
610,
249+
620,
238250
#endif //NOTIFICATION_FEATURE
239251
#if defined(FILESYSTEM_FEATURE) && defined(ESP_GCODE_HOST_FEATURE)
240252
700,
@@ -259,9 +271,12 @@ const uint cmdlist[]= {0,
259271
#endif //GLOBAL_FILESYSTEM_FEATURE
260272
800,
261273
900,
274+
901,
262275
#ifdef BUZZER_DEVICE
263276
910,
277+
264278
#endif //BUZZER_DEVICE
279+
920,
265280
0
266281
};
267282

0 commit comments

Comments
 (0)