Browse Source

Add ESP32 WiFi interface (#11209)

Hadrien Jouet 5 years ago
parent
commit
0278ad0a6d
93 changed files with 915 additions and 22 deletions
  1. 1
    0
      .travis.yml
  2. 2
    0
      Marlin/Configuration_adv.h
  3. 17
    3
      Marlin/src/HAL/HAL_ESP32/HAL.cpp
  4. 4
    1
      Marlin/src/HAL/HAL_ESP32/HAL.h
  5. 232
    0
      Marlin/src/HAL/HAL_ESP32/WebSocketSerial.cpp
  6. 99
    0
      Marlin/src/HAL/HAL_ESP32/WebSocketSerial.h
  7. 2
    11
      Marlin/src/HAL/HAL_ESP32/ota.cpp
  8. 49
    0
      Marlin/src/HAL/HAL_ESP32/web.cpp
  9. 21
    0
      Marlin/src/HAL/HAL_ESP32/web.h
  10. 55
    0
      Marlin/src/HAL/HAL_ESP32/wifi.cpp
  11. 27
    0
      Marlin/src/HAL/HAL_ESP32/wifi.h
  12. 1
    1
      Marlin/src/HAL/HAL_LINUX/hardware/LinearAxis.cpp
  13. 3
    3
      Marlin/src/core/serial.h
  14. 1
    1
      Marlin/src/inc/SanityCheck.h
  15. 19
    0
      buildroot/share/tests/esp32-tests
  16. 2
    0
      config/default/Configuration_adv.h
  17. 2
    0
      config/examples/3DFabXYZ/Migbot/Configuration_adv.h
  18. 2
    0
      config/examples/AlephObjects/TAZ4/Configuration_adv.h
  19. 2
    0
      config/examples/AliExpress/UM2pExt/Configuration_adv.h
  20. 2
    0
      config/examples/Anet/A2/Configuration_adv.h
  21. 2
    0
      config/examples/Anet/A2plus/Configuration_adv.h
  22. 2
    0
      config/examples/Anet/A6/Configuration_adv.h
  23. 2
    0
      config/examples/Anet/A8/Configuration_adv.h
  24. 2
    0
      config/examples/AnyCubic/i3/Configuration_adv.h
  25. 2
    0
      config/examples/ArmEd/Configuration_adv.h
  26. 2
    0
      config/examples/BIBO/TouchX/cyclops/Configuration_adv.h
  27. 2
    0
      config/examples/BIBO/TouchX/default/Configuration_adv.h
  28. 2
    0
      config/examples/BQ/Hephestos/Configuration_adv.h
  29. 2
    0
      config/examples/BQ/Hephestos_2/Configuration_adv.h
  30. 2
    0
      config/examples/BQ/WITBOX/Configuration_adv.h
  31. 2
    0
      config/examples/Cartesio/Configuration_adv.h
  32. 2
    0
      config/examples/Creality/CR-10/Configuration_adv.h
  33. 2
    0
      config/examples/Creality/CR-10S/Configuration_adv.h
  34. 2
    0
      config/examples/Creality/CR-10_5S/Configuration_adv.h
  35. 2
    0
      config/examples/Creality/CR-10mini/Configuration_adv.h
  36. 2
    0
      config/examples/Creality/CR-8/Configuration_adv.h
  37. 2
    0
      config/examples/Creality/Ender-2/Configuration_adv.h
  38. 2
    0
      config/examples/Creality/Ender-3/Configuration_adv.h
  39. 2
    0
      config/examples/Creality/Ender-4/Configuration_adv.h
  40. 2
    0
      config/examples/Einstart-S/Configuration_adv.h
  41. 2
    0
      config/examples/Felix/Configuration_adv.h
  42. 2
    0
      config/examples/FlashForge/CreatorPro/Configuration_adv.h
  43. 2
    0
      config/examples/FolgerTech/i3-2020/Configuration_adv.h
  44. 2
    0
      config/examples/Formbot/Raptor/Configuration_adv.h
  45. 2
    0
      config/examples/Formbot/T_Rex_2+/Configuration_adv.h
  46. 2
    0
      config/examples/Formbot/T_Rex_3/Configuration_adv.h
  47. 2
    0
      config/examples/Geeetech/A10M/Configuration_adv.h
  48. 2
    0
      config/examples/Geeetech/A20M/Configuration_adv.h
  49. 2
    0
      config/examples/Geeetech/MeCreator2/Configuration_adv.h
  50. 2
    0
      config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h
  51. 2
    0
      config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h
  52. 2
    0
      config/examples/Infitary/i3-M508/Configuration_adv.h
  53. 2
    0
      config/examples/JGAurora/A5/Configuration_adv.h
  54. 2
    0
      config/examples/MakerParts/Configuration_adv.h
  55. 2
    0
      config/examples/Malyan/M150/Configuration_adv.h
  56. 2
    0
      config/examples/Malyan/M200/Configuration_adv.h
  57. 2
    0
      config/examples/Micromake/C1/enhanced/Configuration_adv.h
  58. 2
    0
      config/examples/Mks/Robin/Configuration_adv.h
  59. 2
    0
      config/examples/Mks/Sbase/Configuration_adv.h
  60. 2
    0
      config/examples/RapideLite/RL200/Configuration_adv.h
  61. 2
    0
      config/examples/RigidBot/Configuration_adv.h
  62. 2
    0
      config/examples/SCARA/Configuration_adv.h
  63. 2
    0
      config/examples/Sanguinololu/Configuration_adv.h
  64. 2
    0
      config/examples/TheBorg/Configuration_adv.h
  65. 2
    0
      config/examples/TinyBoy2/Configuration_adv.h
  66. 2
    0
      config/examples/Tronxy/X3A/Configuration_adv.h
  67. 2
    0
      config/examples/Tronxy/X5S-2E/Configuration_adv.h
  68. 2
    0
      config/examples/UltiMachine/Archim1/Configuration_adv.h
  69. 2
    0
      config/examples/UltiMachine/Archim2/Configuration_adv.h
  70. 2
    0
      config/examples/VORONDesign/Configuration_adv.h
  71. 2
    0
      config/examples/Velleman/K8200/Configuration_adv.h
  72. 2
    0
      config/examples/Velleman/K8400/Configuration_adv.h
  73. 2
    0
      config/examples/WASP/PowerWASP/Configuration_adv.h
  74. 2
    0
      config/examples/Wanhao/Duplicator 6/Configuration_adv.h
  75. 2
    0
      config/examples/delta/Anycubic/Kossel/Configuration_adv.h
  76. 2
    0
      config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h
  77. 2
    0
      config/examples/delta/FLSUN/kossel/Configuration_adv.h
  78. 2
    0
      config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h
  79. 2
    0
      config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h
  80. 2
    0
      config/examples/delta/MKS/SBASE/Configuration_adv.h
  81. 2
    0
      config/examples/delta/Tevo Little Monster/Configuration_adv.h
  82. 2
    0
      config/examples/delta/generic/Configuration_adv.h
  83. 2
    0
      config/examples/delta/kossel_mini/Configuration_adv.h
  84. 2
    0
      config/examples/delta/kossel_xl/Configuration_adv.h
  85. 2
    0
      config/examples/gCreate/gMax1.5+/Configuration_adv.h
  86. 2
    0
      config/examples/makibox/Configuration_adv.h
  87. 2
    0
      config/examples/tvrrug/Round2/Configuration_adv.h
  88. 2
    0
      config/examples/wt150/Configuration_adv.h
  89. 37
    0
      data/www/index.html
  90. BIN
      data/www/marlin-logo.png
  91. 166
    0
      data/www/marlin.css
  92. 24
    0
      data/www/marlin.js
  93. 9
    2
      platformio.ini

+ 1
- 0
.travis.yml View File

23
   #- TEST_PLATFORM="STM32F1"
23
   #- TEST_PLATFORM="STM32F1"
24
   - TEST_PLATFORM="teensy35"
24
   - TEST_PLATFORM="teensy35"
25
   - TEST_PLATFORM="linux_native"
25
   - TEST_PLATFORM="linux_native"
26
+  - TEST_PLATFORM="esp32"
26
 
27
 
27
 addons:
28
 addons:
28
   apt:
29
   apt:

+ 2
- 0
Marlin/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 17
- 3
Marlin/src/HAL/HAL_ESP32/HAL.cpp View File

34
 #include "../../inc/MarlinConfigPre.h"
34
 #include "../../inc/MarlinConfigPre.h"
35
 
35
 
36
 #if ENABLED(WIFISUPPORT)
36
 #if ENABLED(WIFISUPPORT)
37
-  #include "ota.h"
37
+  #include <ESPAsyncWebServer.h>
38
+  #include "wifi.h"
39
+  #if ENABLED(OTASUPPORT)
40
+    #include "ota.h"
41
+  #endif
42
+  #if ENABLED(WEBSUPPORT)
43
+    #include "web.h"
44
+  #endif
38
 #endif
45
 #endif
39
 
46
 
40
 // --------------------------------------------------------------------------
47
 // --------------------------------------------------------------------------
83
 
90
 
84
 void HAL_init(void) {
91
 void HAL_init(void) {
85
   #if ENABLED(WIFISUPPORT)
92
   #if ENABLED(WIFISUPPORT)
86
-    OTA_init();
93
+    wifi_init();
94
+    #if ENABLED(OTASUPPORT)
95
+      OTA_init();
96
+    #endif
97
+    #if ENABLED(WEBSUPPORT)
98
+      web_init();
99
+    #endif
100
+    server.begin();
87
   #endif
101
   #endif
88
 
102
 
89
   i2s_init();
103
   i2s_init();
90
 }
104
 }
91
 
105
 
92
 void HAL_idletask(void) {
106
 void HAL_idletask(void) {
93
-  #if ENABLED(WIFISUPPORT)
107
+  #if ENABLED(OTASUPPORT)
94
     OTA_handle();
108
     OTA_handle();
95
   #endif
109
   #endif
96
 }
110
 }

+ 4
- 1
Marlin/src/HAL/HAL_ESP32/HAL.h View File

47
 
47
 
48
 #include "HAL_timers_ESP32.h"
48
 #include "HAL_timers_ESP32.h"
49
 
49
 
50
+#include "WebSocketSerial.h"
51
+
50
 // --------------------------------------------------------------------------
52
 // --------------------------------------------------------------------------
51
 // Defines
53
 // Defines
52
 // --------------------------------------------------------------------------
54
 // --------------------------------------------------------------------------
53
 
55
 
54
 extern portMUX_TYPE spinlock;
56
 extern portMUX_TYPE spinlock;
55
 
57
 
56
-#define NUM_SERIAL 1
58
+#define NUM_SERIAL 2
57
 #define MYSERIAL0 Serial
59
 #define MYSERIAL0 Serial
60
+#define MYSERIAL1 webSocketSerial
58
 
61
 
59
 #define CRITICAL_SECTION_START portENTER_CRITICAL(&spinlock)
62
 #define CRITICAL_SECTION_START portENTER_CRITICAL(&spinlock)
60
 #define CRITICAL_SECTION_END   portEXIT_CRITICAL(&spinlock)
63
 #define CRITICAL_SECTION_END   portEXIT_CRITICAL(&spinlock)

+ 232
- 0
Marlin/src/HAL/HAL_ESP32/WebSocketSerial.cpp View File

1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#ifdef ARDUINO_ARCH_ESP32
23
+
24
+#include "../../inc/MarlinConfig.h"
25
+
26
+#if ENABLED(WIFISUPPORT)
27
+
28
+#include "WebSocketSerial.h"
29
+#include "wifi.h"
30
+
31
+#include <AsyncTCP.h>
32
+#include <ESPAsyncWebServer.h>
33
+
34
+struct ring_buffer_r {
35
+  unsigned char buffer[RX_BUFFER_SIZE];
36
+  volatile ring_buffer_pos_t head, tail;
37
+};
38
+
39
+struct ring_buffer_t {
40
+  unsigned char buffer[256];
41
+  volatile uint8_t head, tail;
42
+};
43
+
44
+ring_buffer_r rx_buffer = { { 0 }, 0, 0 };
45
+ring_buffer_t tx_buffer = { { 0 }, 0, 0 };
46
+
47
+static bool _written;
48
+
49
+#if ENABLED(EMERGENCY_PARSER)
50
+  static EmergencyParser::State emergency_state; // = EP_RESET
51
+#endif
52
+
53
+AsyncWebSocket ws("/ws"); // access at ws://[esp ip]/ws
54
+
55
+FORCE_INLINE int next_rx_index(const int i) { return (ring_buffer_pos_t)(i + 1) & (ring_buffer_pos_t)(RX_BUFFER_SIZE - 1); }
56
+FORCE_INLINE int next_tx_index(const int i) { return (ring_buffer_pos_t)(i + 1) & (ring_buffer_pos_t)(TX_BUFFER_SIZE - 1); }
57
+
58
+static void addToBuffer(uint8_t * const data, const size_t len) {
59
+  for (size_t i = 0; i < len; i++) {
60
+    ring_buffer_pos_t h = rx_buffer.head;
61
+    const ring_buffer_pos_t t = rx_buffer.tail, n = next_rx_index(h);
62
+
63
+    if (n != t) { rx_buffer.buffer[h] = data[i]; h = n; }
64
+
65
+    // TODO: buffer is full, handle?
66
+
67
+    rx_buffer.head = h;
68
+  }
69
+}
70
+
71
+// Handle WebSocket event
72
+static void onEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventType type, void * arg, uint8_t *data, size_t len) {
73
+  switch (type) {
74
+    case WS_EVT_CONNECT: client->ping(); break; // client connected
75
+    case WS_EVT_DISCONNECT:                     // client disconnected
76
+    case WS_EVT_ERROR:                          // error was received from the other end
77
+    case WS_EVT_PONG: break;                    // pong message was received (in response to a ping request maybe)
78
+    case WS_EVT_DATA: {                         // data packet
79
+      AwsFrameInfo * info = (AwsFrameInfo*)arg;
80
+      if (info->opcode == WS_TEXT || info->message_opcode == WS_TEXT)
81
+        addToBuffer(data, len);
82
+    }
83
+  }
84
+}
85
+
86
+// Public Methods
87
+void WebSocketSerial::begin(const long baud_setting) {
88
+  ws.onEvent(onEvent);
89
+  server.addHandler(&ws); // attach AsyncWebSocket
90
+}
91
+
92
+void WebSocketSerial::end() { }
93
+
94
+int WebSocketSerial::peek(void) {
95
+  const int v = rx_buffer.head == rx_buffer.tail ? -1 : rx_buffer.buffer[rx_buffer.tail];
96
+  return v;
97
+}
98
+
99
+int WebSocketSerial::read(void) {
100
+  const ring_buffer_pos_t h = rx_buffer.head, t = rx_buffer.tail;
101
+  if (h == t) return -1;  // Nothing to read? Return now
102
+
103
+  const int v = rx_buffer.buffer[t];
104
+
105
+  rx_buffer.tail = (ring_buffer_pos_t)(t + 1) & (RX_BUFFER_SIZE - 1); // Advance tail
106
+
107
+  return v;
108
+}
109
+
110
+bool WebSocketSerial::available(void) {
111
+  const ring_buffer_pos_t h = rx_buffer.head, t = rx_buffer.tail;
112
+  return (ring_buffer_pos_t)(RX_BUFFER_SIZE + h - t) & (RX_BUFFER_SIZE - 1);
113
+}
114
+
115
+void WebSocketSerial::flush(void) {
116
+  ws.textAll("flush");
117
+  rx_buffer.tail = rx_buffer.head;
118
+}
119
+
120
+#if TX_BUFFER_SIZE
121
+
122
+  void WebSocketSerial::write(const uint8_t c) {
123
+    _written = true;
124
+
125
+    const uint8_t i = (tx_buffer.head + 1) & (TX_BUFFER_SIZE - 1);
126
+
127
+    // Store new char. head is always safe to move
128
+    tx_buffer.buffer[tx_buffer.head] = c;
129
+    tx_buffer.head = i;
130
+
131
+    if (c == '\n') {
132
+      ws.textAll(tx_buffer.buffer, tx_buffer.head);
133
+      tx_buffer.head = 0;
134
+    }
135
+  }
136
+
137
+  void WebSocketSerial::flushTx(void) {
138
+    ws.textAll("flushTx");
139
+    if (!_written) return;
140
+  }
141
+
142
+#else
143
+
144
+ //void WebSocketSerial::write(const uint8_t c) { _written = true; }
145
+ //void WebSocketSerial::flushTx(void) { if (!_written) return; }
146
+
147
+#endif
148
+
149
+/**
150
+ * Imports from print.h
151
+ */
152
+
153
+void WebSocketSerial::print(char c, int base) { print((long)c, base); }
154
+void WebSocketSerial::print(unsigned char b, int base) { print((unsigned long)b, base); }
155
+void WebSocketSerial::print(int n, int base) { print((long)n, base); }
156
+void WebSocketSerial::print(unsigned int n, int base) { print((unsigned long)n, base); }
157
+void WebSocketSerial::print(long n, int base) {
158
+  if (base == 0)
159
+    write(n);
160
+  else if (base == 10) {
161
+    if (n < 0) { print('-'); n = -n; }
162
+    printNumber(n, 10);
163
+  }
164
+  else
165
+    printNumber(n, base);
166
+}
167
+
168
+void WebSocketSerial::print(unsigned long n, int base) {
169
+  if (base == 0) write(n); else printNumber(n, base);
170
+}
171
+
172
+void WebSocketSerial::print(double n, int digits)         { printFloat(n, digits); }
173
+
174
+void WebSocketSerial::println(void)                       { print('\r'); print('\n'); }
175
+void WebSocketSerial::println(const String& s)            { print(s); println(); }
176
+void WebSocketSerial::println(const char c[])             { print(c); println(); }
177
+void WebSocketSerial::println(char c, int base)           { print(c, base); println(); }
178
+void WebSocketSerial::println(unsigned char b, int base)  { print(b, base); println(); }
179
+void WebSocketSerial::println(int n, int base)            { print(n, base); println(); }
180
+void WebSocketSerial::println(unsigned int n, int base)   { print(n, base); println(); }
181
+void WebSocketSerial::println(long n, int base)           { print(n, base); println(); }
182
+void WebSocketSerial::println(unsigned long n, int base)  { print(n, base); println(); }
183
+void WebSocketSerial::println(double n, int digits)       { print(n, digits); println(); }
184
+
185
+// Private Methods
186
+
187
+void WebSocketSerial::printNumber(unsigned long n, uint8_t base) {
188
+  if (n) {
189
+    unsigned char buf[8 * sizeof(long)]; // Enough space for base 2
190
+    int8_t i = 0;
191
+    while (n) {
192
+      buf[i++] = n % base;
193
+      n /= base;
194
+    }
195
+    while (i--)
196
+      print((char)(buf[i] + (buf[i] < 10 ? '0' : 'A' - 10)));
197
+  }
198
+  else
199
+    print('0');
200
+}
201
+
202
+void WebSocketSerial::printFloat(double number, uint8_t digits) {
203
+  // Handle negative numbers
204
+  if (number < 0.0) { print('-'); number = -number; }
205
+
206
+  // Round correctly so that print(1.999, 2) prints as "2.00"
207
+  // Use a lookup table for performance
208
+  constexpr double rounds[] = { 0.5, 0.05, 0.005, 0.0005, 0.00005, 0.000005, 0.0000005, 0.00000005 };
209
+  number += rounds[digits];
210
+
211
+  //number += pow(10, -(digits + 1)); // slower single-line equivalent
212
+
213
+  // Extract the integer part of the number and print it
214
+  unsigned long int_part = (unsigned long)number;
215
+  print(int_part);
216
+
217
+  // Print the decimal point, but only if there are digits beyond
218
+  double remainder = number - (double)int_part;
219
+  if (digits) {
220
+    print('.');
221
+    // Extract digits from the remainder one at a time
222
+    while (digits--) {
223
+      remainder *= 10.0;
224
+      const int toPrint = int(remainder);
225
+      print(toPrint);
226
+      remainder -= toPrint;
227
+    }
228
+  }
229
+}
230
+
231
+#endif // WIFISUPPORT
232
+#endif // ARDUINO_ARCH_ESP32

+ 99
- 0
Marlin/src/HAL/HAL_ESP32/WebSocketSerial.h View File

1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+#include "../../inc/MarlinConfig.h"
25
+
26
+#include <WString.h>
27
+
28
+#define DEC 10
29
+#define HEX 16
30
+#define OCT 8
31
+#define BIN 2
32
+
33
+#ifndef RX_BUFFER_SIZE
34
+  #define RX_BUFFER_SIZE 128
35
+#endif
36
+#ifndef TX_BUFFER_SIZE
37
+  #define TX_BUFFER_SIZE 32
38
+#endif
39
+#if TX_BUFFER_SIZE <= 0
40
+  #error "TX_BUFFER_SIZE is required for the WebSocket."
41
+#endif
42
+
43
+#if RX_BUFFER_SIZE > 256
44
+  typedef uint16_t ring_buffer_pos_t;
45
+#else
46
+  typedef uint8_t ring_buffer_pos_t;
47
+#endif
48
+
49
+class WebSocketSerial {
50
+public:
51
+  WebSocketSerial() {};
52
+  static void begin(const long);
53
+  static void end();
54
+  static int peek(void);
55
+  static int read(void);
56
+  static void flush(void);
57
+  static void flushTx(void);
58
+  static bool available(void);
59
+  static void write(const uint8_t c);
60
+
61
+  #if ENABLED(SERIAL_STATS_DROPPED_RX)
62
+    FORCE_INLINE static uint32_t dropped() { return 0; }
63
+  #endif
64
+
65
+  #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED)
66
+    FORCE_INLINE static int rxMaxEnqueued() { return 0; }
67
+  #endif
68
+
69
+  FORCE_INLINE static void write(const char* str) { while (*str) write(*str++); }
70
+  FORCE_INLINE static void write(const uint8_t* buffer, size_t size) { while (size--) write(*buffer++); }
71
+  FORCE_INLINE static void print(const String& s) { for (int i = 0; i < (int)s.length(); i++) write(s[i]); }
72
+  FORCE_INLINE static void print(const char* str) { write(str); }
73
+
74
+  static void print(char, int = 0);
75
+  static void print(unsigned char, int = 0);
76
+  static void print(int, int = DEC);
77
+  static void print(unsigned int, int = DEC);
78
+  static void print(long, int = DEC);
79
+  static void print(unsigned long, int = DEC);
80
+  static void print(double, int = 2);
81
+
82
+  static void println(const String& s);
83
+  static void println(const char[]);
84
+  static void println(char, int = 0);
85
+  static void println(unsigned char, int = 0);
86
+  static void println(int, int = DEC);
87
+  static void println(unsigned int, int = DEC);
88
+  static void println(long, int = DEC);
89
+  static void println(unsigned long, int = DEC);
90
+  static void println(double, int = 2);
91
+  static void println(void);
92
+  operator bool() { return true; }
93
+
94
+private:
95
+  static void printNumber(unsigned long, const uint8_t);
96
+  static void printFloat(double, uint8_t);
97
+};
98
+
99
+extern WebSocketSerial webSocketSerial;

+ 2
- 11
Marlin/src/HAL/HAL_ESP32/ota.cpp View File

21
 
21
 
22
 #include "../../inc/MarlinConfigPre.h"
22
 #include "../../inc/MarlinConfigPre.h"
23
 
23
 
24
-#if ENABLED(WIFISUPPORT)
24
+#if ENABLED(OTASUPPORT)
25
 
25
 
26
 #include <WiFi.h>
26
 #include <WiFi.h>
27
 #include <ESPmDNS.h>
27
 #include <ESPmDNS.h>
30
 #include "driver/timer.h"
30
 #include "driver/timer.h"
31
 
31
 
32
 void OTA_init() {
32
 void OTA_init() {
33
-  WiFi.mode(WIFI_STA);
34
-  WiFi.begin(WIFI_SSID, WIFI_PWD);
35
-
36
-  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
37
-    Serial.println("Connection Failed! Rebooting...");
38
-    delay(5000);
39
-    ESP.restart();
40
-  }
41
-
42
   ArduinoOTA
33
   ArduinoOTA
43
     .onStart([]() {
34
     .onStart([]() {
44
       timer_pause(TIMER_GROUP_0, TIMER_0);
35
       timer_pause(TIMER_GROUP_0, TIMER_0);
76
   ArduinoOTA.handle();
67
   ArduinoOTA.handle();
77
 }
68
 }
78
 
69
 
79
-#endif // WIFISUPPORT
70
+#endif // OTASUPPORT
80
 
71
 
81
 #endif // ARDUINO_ARCH_ESP32
72
 #endif // ARDUINO_ARCH_ESP32

+ 49
- 0
Marlin/src/HAL/HAL_ESP32/web.cpp View File

1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU General Public License as published by
8
+ * the Free Software Foundation, either version 3 of the License, or
9
+ * (at your option) any later version.
10
+ *
11
+ * This program is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
+ * GNU General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU General Public License
17
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
+ */
19
+
20
+#ifdef ARDUINO_ARCH_ESP32
21
+
22
+#include "../../inc/MarlinConfigPre.h"
23
+
24
+#if ENABLED(WEBSUPPORT)
25
+
26
+#include "../../core/serial.h"
27
+
28
+#include "FS.h"
29
+#include "SPIFFS.h"
30
+#include "wifi.h"
31
+
32
+AsyncEventSource events("/events"); // event source (Server-Sent events)
33
+
34
+void onNotFound(AsyncWebServerRequest *request){
35
+  request->send(404);
36
+}
37
+
38
+void web_init() {
39
+  server.addHandler(&events);       // attach AsyncEventSource
40
+  if (SPIFFS.begin()) {
41
+    server.serveStatic("/", SPIFFS, "/www").setDefaultFile("index.html");
42
+    server.onNotFound(onNotFound);
43
+  }
44
+  else
45
+    SERIAL_ECHO_MSG("SPIFFS Mount Failed");
46
+}
47
+
48
+#endif // WEBSUPPORT
49
+#endif // ARDUINO_ARCH_ESP32

+ 21
- 0
Marlin/src/HAL/HAL_ESP32/web.h View File

1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU General Public License as published by
8
+ * the Free Software Foundation, either version 3 of the License, or
9
+ * (at your option) any later version.
10
+ *
11
+ * This program is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
+ * GNU General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU General Public License
17
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
+ */
19
+#pragma once
20
+
21
+void web_init();

+ 55
- 0
Marlin/src/HAL/HAL_ESP32/wifi.cpp View File

1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU General Public License as published by
8
+ * the Free Software Foundation, either version 3 of the License, or
9
+ * (at your option) any later version.
10
+ *
11
+ * This program is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
+ * GNU General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU General Public License
17
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
+ */
19
+
20
+#ifdef ARDUINO_ARCH_ESP32
21
+
22
+#include "../../inc/MarlinConfigPre.h"
23
+
24
+#if ENABLED(WIFISUPPORT)
25
+
26
+#include <WiFi.h>
27
+#include <ESPmDNS.h>
28
+#include <ESPAsyncWebServer.h>
29
+#include "wifi.h"
30
+
31
+AsyncWebServer server(80);
32
+
33
+#ifndef WIFI_HOSTNAME
34
+  #define WIFI_HOSTNAME DEFAULT_WIFI_HOSTNAME
35
+#endif
36
+
37
+void wifi_init() {
38
+  WiFi.mode(WIFI_STA);
39
+  WiFi.begin(WIFI_SSID, WIFI_PWD);
40
+
41
+  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
42
+    delay(5000);
43
+    ESP.restart();
44
+  }
45
+
46
+  delay(10);
47
+
48
+  // Loop forever (watchdog kill) on failure
49
+  if (!MDNS.begin(WIFI_HOSTNAME)) for(;;) delay(5000);
50
+
51
+  MDNS.addService("http", "tcp", 80);
52
+}
53
+
54
+#endif // WIFISUPPORT
55
+#endif // ARDUINO_ARCH_ESP32

+ 27
- 0
Marlin/src/HAL/HAL_ESP32/wifi.h View File

1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ * Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU General Public License as published by
8
+ * the Free Software Foundation, either version 3 of the License, or
9
+ * (at your option) any later version.
10
+ *
11
+ * This program is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
+ * GNU General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU General Public License
17
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
+ */
19
+#pragma once
20
+
21
+#include <ESPAsyncWebServer.h>
22
+
23
+extern AsyncWebServer server;
24
+
25
+#define DEFAULT_WIFI_HOSTNAME "marlin"
26
+
27
+void wifi_init();

+ 1
- 1
Marlin/src/HAL/HAL_LINUX/hardware/LinearAxis.cpp View File

58
       position += -1 + 2 * Gpio::pin_map[dir_pin].value;
58
       position += -1 + 2 * Gpio::pin_map[dir_pin].value;
59
       Gpio::pin_map[min_pin].value = (position < min_position);
59
       Gpio::pin_map[min_pin].value = (position < min_position);
60
       //Gpio::pin_map[max_pin].value = (position > max_position);
60
       //Gpio::pin_map[max_pin].value = (position > max_position);
61
-      //if(position < min_position) printf("axis(%d) endstop : pos: %d, mm: %f, min: %d\n", step_pin, position, position / 80.0, Gpio::pin_map[min_pin].value);
61
+      //if (position < min_position) printf("axis(%d) endstop : pos: %d, mm: %f, min: %d\n", step_pin, position, position / 80.0, Gpio::pin_map[min_pin].value);
62
     }
62
     }
63
   }
63
   }
64
 }
64
 }

+ 3
- 3
Marlin/src/core/serial.h View File

49
   #define _PORT_REDIRECT(n,p)   REMEMBER(n,serial_port_index,p)
49
   #define _PORT_REDIRECT(n,p)   REMEMBER(n,serial_port_index,p)
50
   #define _PORT_RESTORE(n)      RESTORE(n)
50
   #define _PORT_RESTORE(n)      RESTORE(n)
51
   #define SERIAL_OUT(WHAT, ...) do{ \
51
   #define SERIAL_OUT(WHAT, ...) do{ \
52
-    if (!serial_port_index || serial_port_index == SERIAL_BOTH) MYSERIAL0.WHAT(__VA_ARGS__); \
53
-    if ( serial_port_index) MYSERIAL1.WHAT(__VA_ARGS__); \
52
+    if (!serial_port_index || serial_port_index == SERIAL_BOTH) (void)MYSERIAL0.WHAT(__VA_ARGS__); \
53
+    if ( serial_port_index) (void)MYSERIAL1.WHAT(__VA_ARGS__); \
54
   }while(0)
54
   }while(0)
55
 #else
55
 #else
56
   #define _PORT_REDIRECT(n,p)   NOOP
56
   #define _PORT_REDIRECT(n,p)   NOOP
57
   #define _PORT_RESTORE(n)      NOOP
57
   #define _PORT_RESTORE(n)      NOOP
58
-  #define SERIAL_OUT(WHAT, ...) MYSERIAL0.WHAT(__VA_ARGS__)
58
+  #define SERIAL_OUT(WHAT, ...) (void)MYSERIAL0.WHAT(__VA_ARGS__)
59
 #endif
59
 #endif
60
 
60
 
61
 #define PORT_REDIRECT(p)        _PORT_REDIRECT(1,p)
61
 #define PORT_REDIRECT(p)        _PORT_REDIRECT(1,p)

+ 1
- 1
Marlin/src/inc/SanityCheck.h View File

393
   #elif RX_BUFFER_SIZE && (RX_BUFFER_SIZE < 2 || !IS_POWER_OF_2(RX_BUFFER_SIZE))
393
   #elif RX_BUFFER_SIZE && (RX_BUFFER_SIZE < 2 || !IS_POWER_OF_2(RX_BUFFER_SIZE))
394
     #error "RX_BUFFER_SIZE must be a power of 2 greater than 1."
394
     #error "RX_BUFFER_SIZE must be a power of 2 greater than 1."
395
   #elif TX_BUFFER_SIZE && (TX_BUFFER_SIZE < 2 || TX_BUFFER_SIZE > 256 || !IS_POWER_OF_2(TX_BUFFER_SIZE))
395
   #elif TX_BUFFER_SIZE && (TX_BUFFER_SIZE < 2 || TX_BUFFER_SIZE > 256 || !IS_POWER_OF_2(TX_BUFFER_SIZE))
396
-    #error "TX_BUFFER_SIZE must be 0, a power of 2 greater than 1, and no greater than 256."
396
+    #error "TX_BUFFER_SIZE must be 0 or a power of 2 between 1 and 256."
397
   #endif
397
   #endif
398
 #elif ENABLED(SERIAL_XON_XOFF) || ENABLED(SERIAL_STATS_MAX_RX_QUEUED) || ENABLED(SERIAL_STATS_DROPPED_RX)
398
 #elif ENABLED(SERIAL_XON_XOFF) || ENABLED(SERIAL_STATS_MAX_RX_QUEUED) || ENABLED(SERIAL_STATS_DROPPED_RX)
399
   #error "SERIAL_XON_XOFF and SERIAL_STATS_* features not supported on USB-native AVR devices."
399
   #error "SERIAL_XON_XOFF and SERIAL_STATS_* features not supported on USB-native AVR devices."

+ 19
- 0
buildroot/share/tests/esp32-tests View File

1
+#!/usr/bin/env bash
2
+#
3
+# Build tests for esp32
4
+#
5
+
6
+# exit on first failure
7
+set -e
8
+
9
+restore_configs
10
+opt_set MOTHERBOARD BOARD_ESP32
11
+opt_enable WIFISUPPORT
12
+opt_set "WIFI_SSID \"ssid\""
13
+opt_set "WIFI_PWD \"password\""
14
+opt_set TX_BUFFER_SIZE 64
15
+opt_add WEBSUPPORT
16
+exec_test $1 $2 "ESP32 with WIFISUPPORT and WEBSUPPORT"
17
+
18
+# cleanup
19
+restore_configs

+ 2
- 0
config/default/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/3DFabXYZ/Migbot/Configuration_adv.h View File

2230
 #if ENABLED(WIFISUPPORT)
2230
 #if ENABLED(WIFISUPPORT)
2231
   #define WIFI_SSID "Wifi SSID"
2231
   #define WIFI_SSID "Wifi SSID"
2232
   #define WIFI_PWD  "Wifi Password"
2232
   #define WIFI_PWD  "Wifi Password"
2233
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2234
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2233
 #endif
2235
 #endif
2234
 
2236
 
2235
 /**
2237
 /**

+ 2
- 0
config/examples/AlephObjects/TAZ4/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/AliExpress/UM2pExt/Configuration_adv.h View File

2230
 #if ENABLED(WIFISUPPORT)
2230
 #if ENABLED(WIFISUPPORT)
2231
   #define WIFI_SSID "Wifi SSID"
2231
   #define WIFI_SSID "Wifi SSID"
2232
   #define WIFI_PWD  "Wifi Password"
2232
   #define WIFI_PWD  "Wifi Password"
2233
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2234
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2233
 #endif
2235
 #endif
2234
 
2236
 
2235
 /**
2237
 /**

+ 2
- 0
config/examples/Anet/A2/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/Anet/A2plus/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/Anet/A6/Configuration_adv.h View File

2227
 #if ENABLED(WIFISUPPORT)
2227
 #if ENABLED(WIFISUPPORT)
2228
   #define WIFI_SSID "Wifi SSID"
2228
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_PWD  "Wifi Password"
2229
   #define WIFI_PWD  "Wifi Password"
2230
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2231
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2230
 #endif
2232
 #endif
2231
 
2233
 
2232
 /**
2234
 /**

+ 2
- 0
config/examples/Anet/A8/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/AnyCubic/i3/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/ArmEd/Configuration_adv.h View File

2232
 #if ENABLED(WIFISUPPORT)
2232
 #if ENABLED(WIFISUPPORT)
2233
   #define WIFI_SSID "Wifi SSID"
2233
   #define WIFI_SSID "Wifi SSID"
2234
   #define WIFI_PWD  "Wifi Password"
2234
   #define WIFI_PWD  "Wifi Password"
2235
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2236
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2235
 #endif
2237
 #endif
2236
 
2238
 
2237
 /**
2239
 /**

+ 2
- 0
config/examples/BIBO/TouchX/cyclops/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/BIBO/TouchX/default/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/BQ/Hephestos/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/BQ/Hephestos_2/Configuration_adv.h View File

2236
 #if ENABLED(WIFISUPPORT)
2236
 #if ENABLED(WIFISUPPORT)
2237
   #define WIFI_SSID "Wifi SSID"
2237
   #define WIFI_SSID "Wifi SSID"
2238
   #define WIFI_PWD  "Wifi Password"
2238
   #define WIFI_PWD  "Wifi Password"
2239
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2240
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2239
 #endif
2241
 #endif
2240
 
2242
 
2241
 /**
2243
 /**

+ 2
- 0
config/examples/BQ/WITBOX/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/Cartesio/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/Creality/CR-10/Configuration_adv.h View File

2231
 #if ENABLED(WIFISUPPORT)
2231
 #if ENABLED(WIFISUPPORT)
2232
   #define WIFI_SSID "Wifi SSID"
2232
   #define WIFI_SSID "Wifi SSID"
2233
   #define WIFI_PWD  "Wifi Password"
2233
   #define WIFI_PWD  "Wifi Password"
2234
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2235
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2234
 #endif
2236
 #endif
2235
 
2237
 
2236
 /**
2238
 /**

+ 2
- 0
config/examples/Creality/CR-10S/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/Creality/CR-10_5S/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/Creality/CR-10mini/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/Creality/CR-8/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/Creality/Ender-2/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/Creality/Ender-3/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/Creality/Ender-4/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/Einstart-S/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/Felix/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/FlashForge/CreatorPro/Configuration_adv.h View File

2227
 #if ENABLED(WIFISUPPORT)
2227
 #if ENABLED(WIFISUPPORT)
2228
   #define WIFI_SSID "Wifi SSID"
2228
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_PWD  "Wifi Password"
2229
   #define WIFI_PWD  "Wifi Password"
2230
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2231
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2230
 #endif
2232
 #endif
2231
 
2233
 
2232
 /**
2234
 /**

+ 2
- 0
config/examples/FolgerTech/i3-2020/Configuration_adv.h View File

2236
 #if ENABLED(WIFISUPPORT)
2236
 #if ENABLED(WIFISUPPORT)
2237
   #define WIFI_SSID "Wifi SSID"
2237
   #define WIFI_SSID "Wifi SSID"
2238
   #define WIFI_PWD  "Wifi Password"
2238
   #define WIFI_PWD  "Wifi Password"
2239
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2240
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2239
 #endif
2241
 #endif
2240
 
2242
 
2241
 /**
2243
 /**

+ 2
- 0
config/examples/Formbot/Raptor/Configuration_adv.h View File

2232
 #if ENABLED(WIFISUPPORT)
2232
 #if ENABLED(WIFISUPPORT)
2233
   #define WIFI_SSID "Wifi SSID"
2233
   #define WIFI_SSID "Wifi SSID"
2234
   #define WIFI_PWD  "Wifi Password"
2234
   #define WIFI_PWD  "Wifi Password"
2235
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2236
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2235
 #endif
2237
 #endif
2236
 
2238
 
2237
 /**
2239
 /**

+ 2
- 0
config/examples/Formbot/T_Rex_2+/Configuration_adv.h View File

2242
 #if ENABLED(WIFISUPPORT)
2242
 #if ENABLED(WIFISUPPORT)
2243
   #define WIFI_SSID "Wifi SSID"
2243
   #define WIFI_SSID "Wifi SSID"
2244
   #define WIFI_PWD  "Wifi Password"
2244
   #define WIFI_PWD  "Wifi Password"
2245
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2246
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2245
 #endif
2247
 #endif
2246
 
2248
 
2247
 /**
2249
 /**

+ 2
- 0
config/examples/Formbot/T_Rex_3/Configuration_adv.h View File

2238
 #if ENABLED(WIFISUPPORT)
2238
 #if ENABLED(WIFISUPPORT)
2239
   #define WIFI_SSID "Wifi SSID"
2239
   #define WIFI_SSID "Wifi SSID"
2240
   #define WIFI_PWD  "Wifi Password"
2240
   #define WIFI_PWD  "Wifi Password"
2241
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2242
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2241
 #endif
2243
 #endif
2242
 
2244
 
2243
 /**
2245
 /**

+ 2
- 0
config/examples/Geeetech/A10M/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/Geeetech/A20M/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/Geeetech/MeCreator2/Configuration_adv.h View File

2213
 #if ENABLED(WIFISUPPORT)
2213
 #if ENABLED(WIFISUPPORT)
2214
   #define WIFI_SSID "Wifi SSID"
2214
   #define WIFI_SSID "Wifi SSID"
2215
   #define WIFI_PWD  "Wifi Password"
2215
   #define WIFI_PWD  "Wifi Password"
2216
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2217
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2216
 #endif
2218
 #endif
2217
 
2219
 
2218
 /**
2220
 /**

+ 2
- 0
config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/Infitary/i3-M508/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/JGAurora/A5/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/MakerParts/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/Malyan/M150/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/Malyan/M200/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/Micromake/C1/enhanced/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/Mks/Robin/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/Mks/Sbase/Configuration_adv.h View File

2229
 #if ENABLED(WIFISUPPORT)
2229
 #if ENABLED(WIFISUPPORT)
2230
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_SSID "Wifi SSID"
2231
   #define WIFI_PWD  "Wifi Password"
2231
   #define WIFI_PWD  "Wifi Password"
2232
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2233
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2232
 #endif
2234
 #endif
2233
 
2235
 
2234
 /**
2236
 /**

+ 2
- 0
config/examples/RapideLite/RL200/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/RigidBot/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/SCARA/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/Sanguinololu/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/TheBorg/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/TinyBoy2/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/Tronxy/X3A/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/Tronxy/X5S-2E/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/UltiMachine/Archim1/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/UltiMachine/Archim2/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/VORONDesign/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/Velleman/K8200/Configuration_adv.h View File

2241
 #if ENABLED(WIFISUPPORT)
2241
 #if ENABLED(WIFISUPPORT)
2242
   #define WIFI_SSID "Wifi SSID"
2242
   #define WIFI_SSID "Wifi SSID"
2243
   #define WIFI_PWD  "Wifi Password"
2243
   #define WIFI_PWD  "Wifi Password"
2244
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2245
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2244
 #endif
2246
 #endif
2245
 
2247
 
2246
 /**
2248
 /**

+ 2
- 0
config/examples/Velleman/K8400/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/WASP/PowerWASP/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/Wanhao/Duplicator 6/Configuration_adv.h View File

2230
 #if ENABLED(WIFISUPPORT)
2230
 #if ENABLED(WIFISUPPORT)
2231
   #define WIFI_SSID "Wifi SSID"
2231
   #define WIFI_SSID "Wifi SSID"
2232
   #define WIFI_PWD  "Wifi Password"
2232
   #define WIFI_PWD  "Wifi Password"
2233
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2234
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2233
 #endif
2235
 #endif
2234
 
2236
 
2235
 /**
2237
 /**

+ 2
- 0
config/examples/delta/Anycubic/Kossel/Configuration_adv.h View File

2230
 #if ENABLED(WIFISUPPORT)
2230
 #if ENABLED(WIFISUPPORT)
2231
   #define WIFI_SSID "Wifi SSID"
2231
   #define WIFI_SSID "Wifi SSID"
2232
   #define WIFI_PWD  "Wifi Password"
2232
   #define WIFI_PWD  "Wifi Password"
2233
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2234
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2233
 #endif
2235
 #endif
2234
 
2236
 
2235
 /**
2237
 /**

+ 2
- 0
config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h View File

2230
 #if ENABLED(WIFISUPPORT)
2230
 #if ENABLED(WIFISUPPORT)
2231
   #define WIFI_SSID "Wifi SSID"
2231
   #define WIFI_SSID "Wifi SSID"
2232
   #define WIFI_PWD  "Wifi Password"
2232
   #define WIFI_PWD  "Wifi Password"
2233
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2234
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2233
 #endif
2235
 #endif
2234
 
2236
 
2235
 /**
2237
 /**

+ 2
- 0
config/examples/delta/FLSUN/kossel/Configuration_adv.h View File

2230
 #if ENABLED(WIFISUPPORT)
2230
 #if ENABLED(WIFISUPPORT)
2231
   #define WIFI_SSID "Wifi SSID"
2231
   #define WIFI_SSID "Wifi SSID"
2232
   #define WIFI_PWD  "Wifi Password"
2232
   #define WIFI_PWD  "Wifi Password"
2233
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2234
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2233
 #endif
2235
 #endif
2234
 
2236
 
2235
 /**
2237
 /**

+ 2
- 0
config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h View File

2230
 #if ENABLED(WIFISUPPORT)
2230
 #if ENABLED(WIFISUPPORT)
2231
   #define WIFI_SSID "Wifi SSID"
2231
   #define WIFI_SSID "Wifi SSID"
2232
   #define WIFI_PWD  "Wifi Password"
2232
   #define WIFI_PWD  "Wifi Password"
2233
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2234
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2233
 #endif
2235
 #endif
2234
 
2236
 
2235
 /**
2237
 /**

+ 2
- 0
config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h View File

2230
 #if ENABLED(WIFISUPPORT)
2230
 #if ENABLED(WIFISUPPORT)
2231
   #define WIFI_SSID "Wifi SSID"
2231
   #define WIFI_SSID "Wifi SSID"
2232
   #define WIFI_PWD  "Wifi Password"
2232
   #define WIFI_PWD  "Wifi Password"
2233
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2234
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2233
 #endif
2235
 #endif
2234
 
2236
 
2235
 /**
2237
 /**

+ 2
- 0
config/examples/delta/MKS/SBASE/Configuration_adv.h View File

2230
 #if ENABLED(WIFISUPPORT)
2230
 #if ENABLED(WIFISUPPORT)
2231
   #define WIFI_SSID "Wifi SSID"
2231
   #define WIFI_SSID "Wifi SSID"
2232
   #define WIFI_PWD  "Wifi Password"
2232
   #define WIFI_PWD  "Wifi Password"
2233
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2234
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2233
 #endif
2235
 #endif
2234
 
2236
 
2235
 /**
2237
 /**

+ 2
- 0
config/examples/delta/Tevo Little Monster/Configuration_adv.h View File

2218
 #if ENABLED(WIFISUPPORT)
2218
 #if ENABLED(WIFISUPPORT)
2219
   #define WIFI_SSID "Wifi SSID"
2219
   #define WIFI_SSID "Wifi SSID"
2220
   #define WIFI_PWD  "Wifi Password"
2220
   #define WIFI_PWD  "Wifi Password"
2221
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2222
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2221
 #endif
2223
 #endif
2222
 
2224
 
2223
 /**
2225
 /**

+ 2
- 0
config/examples/delta/generic/Configuration_adv.h View File

2230
 #if ENABLED(WIFISUPPORT)
2230
 #if ENABLED(WIFISUPPORT)
2231
   #define WIFI_SSID "Wifi SSID"
2231
   #define WIFI_SSID "Wifi SSID"
2232
   #define WIFI_PWD  "Wifi Password"
2232
   #define WIFI_PWD  "Wifi Password"
2233
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2234
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2233
 #endif
2235
 #endif
2234
 
2236
 
2235
 /**
2237
 /**

+ 2
- 0
config/examples/delta/kossel_mini/Configuration_adv.h View File

2229
 #if ENABLED(WIFISUPPORT)
2229
 #if ENABLED(WIFISUPPORT)
2230
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_SSID "Wifi SSID"
2231
   #define WIFI_PWD  "Wifi Password"
2231
   #define WIFI_PWD  "Wifi Password"
2232
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2233
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2232
 #endif
2234
 #endif
2233
 
2235
 
2234
 /**
2236
 /**

+ 2
- 0
config/examples/delta/kossel_xl/Configuration_adv.h View File

2230
 #if ENABLED(WIFISUPPORT)
2230
 #if ENABLED(WIFISUPPORT)
2231
   #define WIFI_SSID "Wifi SSID"
2231
   #define WIFI_SSID "Wifi SSID"
2232
   #define WIFI_PWD  "Wifi Password"
2232
   #define WIFI_PWD  "Wifi Password"
2233
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2234
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2233
 #endif
2235
 #endif
2234
 
2236
 
2235
 /**
2237
 /**

+ 2
- 0
config/examples/gCreate/gMax1.5+/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/makibox/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/tvrrug/Round2/Configuration_adv.h View File

2228
 #if ENABLED(WIFISUPPORT)
2228
 #if ENABLED(WIFISUPPORT)
2229
   #define WIFI_SSID "Wifi SSID"
2229
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_PWD  "Wifi Password"
2230
   #define WIFI_PWD  "Wifi Password"
2231
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2232
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2231
 #endif
2233
 #endif
2232
 
2234
 
2233
 /**
2235
 /**

+ 2
- 0
config/examples/wt150/Configuration_adv.h View File

2229
 #if ENABLED(WIFISUPPORT)
2229
 #if ENABLED(WIFISUPPORT)
2230
   #define WIFI_SSID "Wifi SSID"
2230
   #define WIFI_SSID "Wifi SSID"
2231
   #define WIFI_PWD  "Wifi Password"
2231
   #define WIFI_PWD  "Wifi Password"
2232
+  //#define WEBSUPPORT        // Start a webserver with auto-discovery
2233
+  //#define OTASUPPORT        // Support over-the-air firmware updates
2232
 #endif
2234
 #endif
2233
 
2235
 
2234
 /**
2236
 /**

+ 37
- 0
data/www/index.html View File

1
+<!doctype html>
2
+<html lang=en>
3
+<head>
4
+  <meta charset=utf-8>
5
+  <title>Marlin</title>
6
+
7
+  <link rel="stylesheet" type="text/css" href="marlin.css" />
8
+
9
+  <script type="text/javascript" src="marlin.js"></script>
10
+</head>
11
+<body>
12
+  <div class="tabs">
13
+    <div id="logo"></div>
14
+    <input class="input" name="tabs" type="radio" id="tab-1" checked="checked"/>
15
+    <label class="label" for="tab-1">console</label>
16
+    <div class="panel">
17
+      <div class="panel-content">
18
+        <ul id="serial-output"></ul>
19
+
20
+        <form id="serial-command-form" autocomplete="off">
21
+          <div class="form-wrapper">
22
+            <input type="text" id="serial-command">
23
+            <input type="submit" value="Send">
24
+          </div>
25
+        </form>
26
+      </div>
27
+    </div>
28
+    <input class="input" name="tabs" type="radio" id="tab-2"/>
29
+    <label class="label" for="tab-2">controls</label>
30
+    <div class="panel">
31
+      <div class="panel-content">
32
+        #controls
33
+      </div>
34
+    </div>
35
+  </div>
36
+</body>
37
+</html>

BIN
data/www/marlin-logo.png View File


+ 166
- 0
data/www/marlin.css View File

1
+/* CSS reset */
2
+
3
+html, body, div, span, applet, object, iframe,
4
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
5
+a, abbr, acronym, address, big, cite, code,
6
+del, dfn, em, img, ins, kbd, q, s, samp,
7
+small, strike, strong, sub, sup, tt, var,
8
+b, u, i, center,
9
+dl, dt, dd, ol, ul, li,
10
+fieldset, form, label, legend,
11
+table, caption, tbody, tfoot, thead, tr, th, td,
12
+article, aside, canvas, details, embed,
13
+figure, figcaption, footer, header, hgroup,
14
+menu, nav, output, ruby, section, summary,
15
+time, mark, audio, video {
16
+  margin: 0;
17
+  padding: 0;
18
+  border: 0;
19
+  font-size: 100%;
20
+  font: inherit;
21
+  vertical-align: baseline;
22
+  font-family: Impact, Charcoal, sans-serif;
23
+  }
24
+article, aside, details, figcaption, figure,
25
+footer, header, hgroup, menu, nav, section {
26
+  display: block;
27
+  }
28
+body { line-height: 1; }
29
+ol, ul { list-style: none; }
30
+blockquote, q { quotes: none; }
31
+blockquote:before, blockquote:after,
32
+q:before, q:after { content: ''; content: none; }
33
+table {
34
+  border-collapse: collapse;
35
+  border-spacing: 0;
36
+  }
37
+
38
+/* Custom */
39
+
40
+/* Tabs */
41
+* { box-sizing: border-box; }
42
+body {
43
+  display: flex;
44
+  justify-content: center;
45
+  padding: 0px;
46
+  background: #1e1e1e;
47
+  color: #efefef;
48
+  }
49
+h1 {
50
+  margin: 0;
51
+  font-size: 2em;
52
+  }
53
+.tabs {
54
+  display: flex;
55
+  width: 100%;
56
+  flex-wrap: wrap;
57
+  background: #e5e5e5;
58
+  }
59
+.input {
60
+  position: absolute;
61
+  opacity: 0;
62
+  }
63
+.label {
64
+  width: 100%;
65
+  padding: 18px 28px;
66
+  background: #e5e5e5;
67
+  cursor: pointer;
68
+  font-weight: bold;
69
+  font-size: 18px;
70
+  color: #7f7f7f;
71
+  transition: background 0.1s, color 0.1s;
72
+  border-style: solid;
73
+  border-width: 0 0 4px 0;
74
+  border-color: #acacac;
75
+  }
76
+.label:hover {
77
+  background: #d8d8d8;
78
+  }
79
+.label:active {
80
+  background: #ccc;
81
+  }
82
+.input:focus + .label {
83
+  z-index: 1;
84
+  }
85
+.input:checked + .label {
86
+  background: #1e1e1e;
87
+  color: #efefef;
88
+  border-width: 4px 0 0 0;
89
+  border-color: #65a57d;
90
+  }
91
+.panel {
92
+  display: none;
93
+  width: 100%;
94
+  padding: 20px 30px 30px;
95
+  background: #1e1e1e;
96
+  color: #e5e5e5;
97
+  }
98
+.panel .panel-content {
99
+  width: 100%;
100
+  max-width: 800px;
101
+  }
102
+
103
+@media (min-width: 600px) {
104
+  .label { width: auto; }
105
+  .panel { order: 99; }
106
+}
107
+
108
+.input:checked + .label + .panel { display: block; }
109
+
110
+#logo {
111
+  width: 130px;
112
+  height: 58px;
113
+  margin-right: 20px;
114
+  background: url(marlin-logo.png) no-repeat center center;
115
+  }
116
+
117
+input[type="text"], textarea {
118
+  background-color: #2c2c2c;
119
+  border: solid 2px #314b3b;
120
+  color: #e5e5e5;
121
+  outline: none;
122
+  }
123
+
124
+input[type="text"]:focus, textarea:focus {
125
+  border-color: #4d7a5e;
126
+  }
127
+
128
+ul#serial-output {
129
+  width: 100%;
130
+  height: 300px;
131
+  overflow-y: scroll;
132
+  background-color: #2c2c2c;
133
+  border: solid 2px #314b3b;
134
+  }
135
+
136
+ul#serial-output li {
137
+  padding: 4px;
138
+  font-family: "Lucida Console", Monaco, monospace;
139
+  font-size: 0.8em;
140
+  }
141
+
142
+ul#serial-output li:nth-child(odd) {
143
+  background-color: #3c3c3c;
144
+  }
145
+
146
+div.form-wrapper {
147
+  display: flex;
148
+  width: 100%;
149
+  margin: 6px 0;
150
+  }
151
+
152
+div.form-wrapper input {
153
+  font-size: 1.2em;
154
+  padding: 4px 6px;
155
+  }
156
+
157
+div.form-wrapper input[type="text"] {
158
+  flex: 1 1 auto;
159
+  }
160
+
161
+div.form-wrapper input[type="submit"],
162
+div.form-wrapper button {
163
+  border: solid 2px #314b3b;
164
+  background-color: #4d7a5e;
165
+  color: #e5e5e5;
166
+  }

+ 24
- 0
data/www/marlin.js View File

1
+document.addEventListener('DOMContentLoaded', () => {
2
+  const ws = new WebSocket(`ws://${location.host}/ws`);
3
+
4
+  ws.onmessage = (e) => {
5
+    if (typeof e.data === 'string') {
6
+      let node = document.createElement('li');
7
+      let text = document.createTextNode(e.data);
8
+      node.appendChild(text);
9
+      document.getElementById('serial-output').appendChild(node);
10
+    }
11
+  };
12
+
13
+  document.getElementById('serial-command-form').addEventListener('submit', (e) => {
14
+    e.preventDefault();
15
+
16
+    let value = document.getElementById('serial-command').value.trim();
17
+
18
+    if (!value) return;
19
+
20
+    ws.send(`${value}\n`);
21
+
22
+    document.getElementById('serial-command').value = '';
23
+  });
24
+});

+ 9
- 2
platformio.ini View File

286
 monitor_speed = 250000
286
 monitor_speed = 250000
287
 
287
 
288
 #
288
 #
289
-# ARMED
289
+# ARMED (STM32)
290
 #
290
 #
291
 [env:ARMED]
291
 [env:ARMED]
292
 platform    = ststm32
292
 platform    = ststm32
331
 src_filter    = ${common.default_src_filter} +<src/HAL/HAL_TEENSY35_36>
331
 src_filter    = ${common.default_src_filter} +<src/HAL/HAL_TEENSY35_36>
332
 monitor_speed = 250000
332
 monitor_speed = 250000
333
 
333
 
334
+#
335
+# Malyan M200 (STM32F1)
336
+#
334
 [env:malyanm200]
337
 [env:malyanm200]
335
 platform    = ststm32
338
 platform    = ststm32
336
 framework   = arduino
339
 framework   = arduino
355
 # Espressif ESP32
358
 # Espressif ESP32
356
 #
359
 #
357
 [env:esp32]
360
 [env:esp32]
358
-platform    = https://github.com/platformio/platform-espressif32.git#feature/stage
361
+platform    = https://github.com/platformio/platform-espressif32.git ; #feature/stage
359
 board       = esp32dev
362
 board       = esp32dev
360
 framework   = arduino
363
 framework   = arduino
361
 upload_speed = 115200
364
 upload_speed = 115200
362
 monitor_speed = 115200
365
 monitor_speed = 115200
366
+upload_port = /dev/ttyUSB0
367
+lib_deps =
368
+  https://github.com/me-no-dev/AsyncTCP.git
369
+  https://github.com/me-no-dev/ESPAsyncWebServer.git
363
 lib_ignore  =
370
 lib_ignore  =
364
   LiquidCrystal_I2C
371
   LiquidCrystal_I2C
365
   LiquidCrystal
372
   LiquidCrystal

Loading…
Cancel
Save