-
-
Notifications
You must be signed in to change notification settings - Fork 476
/
Copy pathconfiguration.h
708 lines (598 loc) · 16.4 KB
/
configuration.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
/*
configuration.h - ESP3D configuration file
Copyright (c) 2014 Luc Lebosse. All rights reserved.
This code is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This code is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with This code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _CONFIGURATION_H
#define _CONFIGURATION_H
/* Setup station as default, use AP mode first if not done
* Note: need both defined to enable it
* Uncomment and edit them to define
*/
// #define STATION_WIFI_SSID "*********"
// #define STATION_WIFI_PASSWORD "*********"
/* You can also use a different config file for SSID/password
* Just save it in same location as this configuration.h
* This file is ignored by github
*/
#if defined __has_include
#if __has_include("myconfig.h")
#include "myconfig.h"
#endif
#endif
/************************************
*
* ESP32 C3 -patch
*
* Uncomment only if your ESP32 C3 board cannot start
*
************************************/
// Possible values
// WIFI_POWER_5dBm
// WIFI_POWER_8_5dBm
// WIFI_POWER_15dBm
// #define ESP32_WIFI_TX_POWER WIFI_POWER_15dBm
/************************************
*
* Serial Communications
*
* Settings and protocols
*
************************************/
/* Serial Communication protocol
* RAW_SERIAL // Basic serial protocol, without data change
* MKS_SERIAL // This is a MakerBase communication protocol, used with MKS
* printers and TFT, it encapsulated data in a custom protocol
*/
#define COMMUNICATION_PROTOCOL RAW_SERIAL
/* Main Serial port / Ouptut
* which serial ESP use to communicate to printer (ESP32 has 3 serials
* available, ESP8266 only 2) USE_SERIAL_0 //for ESP8266/32, also used by
* bootloader output, so consider to make it quiet USE_SERIAL_1 //for ESP8266/32
* USE_SERIAL_2 //for ESP32 Only
*/
// Main serial port
#define ESP_SERIAL_OUTPUT USE_SERIAL_0
/* Optional Output
* Instead of Serial, you can use USB Serial
* USB_SERIAL_FEATURE on ESP32 S2/S3 Only
*/
//#define USB_SERIAL_FEATURE
/* Bridge Serial port (deprecated on esp8266 as second serial is)
* which serial ESP use to bridge to another device (ESP32 has 3 serials
* available, ESP8266 only 2) USE_SERIAL_0 //for ESP8266/32, also used by
* bootloader output, so consider to make it quiet USE_SERIAL_1 //for ESP8266/32
* USE_SERIAL_2 //for ESP32 Only\
* Comment if not used
*/
// #define ESP_SERIAL_BRIDGE_OUTPUT USE_SERIAL_1
/* Serial buffer size
* Maximum size of the serial buffer
*/
#define SERIAL_RX_BUFFER_SIZE 512
/************************************
*
* Target firmware
*
* Targeted firmware that ESP3D will communicate with
*
************************************/
/* Target firmware (default UNKNOWN_FW can be changed later in settings)
* UNKNOWN_FW
* GRBL
* MARLIN
* SMOOTHIEWARE
* REPETIER
*/
#define DEFAULT_FW UNKNOWN_FW
/************************************
*
* Radio mode of ESP3D
*
* The radio mode ESP3D communicate with the network
*
************************************/
/* Use WiFi
* Enable wifi communications
*/
#define WIFI_FEATURE
/* Use Ethernet
* Enable ethernet communications
*/
// #define ETH_FEATURE
// Ethernet type (Check ETH.h eth_phy_type_t)
// TYPE_ETH_PHY_LAN8720
// TYPE_ETH_PHY_TLK110
// TYPE_ETH_PHY_RTL8201
// TYPE_ETH_PHY_DP83848
// TYPE_ETH_PHY_DM9051
// TYPE_ETH_PHY_KSZ8041
// TYPE_ETH_PHY_KSZ8081
// TYPE_ETH_PHY_W5500
#define ESP3D_ETH_PHY_TYPE TYPE_ETH_PHY_W5500
// Ethernet board Clock mode
// MODE_ETH_CLOCK_GPIO0_IN
// MODE_ETH_CLOCK_GPIO0_OUT
// MODE_ETH_CLOCK_GPIO16_OUT
// MODE_ETH_CLOCK_GPIO17_OUT
//#define ESP3D_ETH_CLK_MODE MODE_ETH_CLOCK_GPIO0_IN
// Pins of ethernet board
//#define ESP3D_ETH_PHY_POWER_PIN 16
//#define ESP3D_ETH_PHY_MDC_PIN 23
//#define ESP3D_ETH_PHY_MDIO_PIN 18
// These are the pins for the W5500 chip using SPI
#define ETHERNET_SPI_USE_SPI 1
#define ETHERNET_SPI_USE_SPI2 0
#define ETH_SPI_SCK 18
#define ETH_SPI_MISO 23
#define ETH_SPI_MOSI 19
#define ETH_PHY_CS 5
#define ETH_PHY_IRQ -1
#define ETH_PHY_RST 4
// Address of ethernet board
#define ESP3D_ETH_PHY_ADDR 1
/* Use Bluetooth
* Enable serial bluetooth communications
*/
//#define BLUETOOTH_FEATURE
/************************************
*
* Channels of ESP3D
*
* The way ESP3D communicate
*
************************************/
/* Use Web server
* Enable http server
*/
#define HTTP_FEATURE
/* Use telnet server
* Enable telnet light (raw tcp) communications
*/
#define TELNET_FEATURE
/* Disable telnet welcome message
*/
#define DISABLE_TELNET_WELCOME_MESSAGE
/* Use Websocket server
* Enable websocket communications
*/
// #define WS_DATA_FEATURE
// Enable notifications
// Allows to send notifications to the user
#define NOTIFICATION_FEATURE
/* Notification message when online
* The message that will be sent when the ESP is online
*/
#define NOTIFICATION_ESP_ONLINE "Hi, %ESP_NAME% is now online at %ESP_IP%"
/* Notification title message
* The title of notification
*/
#define ESP_NOTIFICATION_TITLE "ESP3D Notification"
/************************************
*
* Discovery methods of ESP3D
*
* The discovery methods of ESP3D
*
************************************/
/* Use captive portal
* Enable captive portal in AP mode
*/
#define CAPTIVE_PORTAL_FEATURE
/* Use mDNS discovery
* This method need `bonjour` protocol on windows, or `avahi` on linux
*/
#define MDNS_FEATURE
/* Use Simple Service Discovery Protocol
* It is supported on Windows out of the box
*/
#define SSDP_FEATURE
/************************************
*
* SSDP Customization settings
*
* Customize your ESP3D
*
************************************/
/* Model name
* Modele name of device
*/
#define ESP_MODEL_NAME "ESP Board"
/* Model number
* Modele number of device
*/
#define ESP_MODEL_NUMBER "ESP3D 3.0"
/* Model url
* Modele url of device
*/
#define ESP_MODEL_URL "https://www.espressif.com/en/products/devkits"
/* Manufacturer name
* Manufacturer name of device
*/
#define ESP_MANUFACTURER_NAME "Espressif Systems"
/* Manufacturer url
* Manufacturer url of device
*/
#define ESP_MANUFACTURER_URL "https://www.espressif.com"
/************************************
*
* Flash filesystem
*
* Filesystem on flash
*
************************************/
/* File system type used by ESP3D
* Type of file system used by ESP3D to store files
* ESP_SPIFFS_FILESYSTEM (Deprecated)
* ESP_FAT_FILESYSTEM (ESP32 only with large partitions)
* ESP_LITTLEFS_FILESYSTEM (Default)
*/
#define FILESYSTEM_FEATURE ESP_LITTLEFS_FILESYSTEM
/* Enable date/time on files
* Set date/time on files using SNTP or last webui connection
*/
#define FILESYSTEM_TIMESTAMP_FEATURE
/************************************
*
* SD filesystem
*
* Filesystem on SD card
*
************************************/
/* SD card connection
* ESP_NO_SD //(default)
* ESP_NOT_SHARED_SD //Only your ESP board is connected to SDCard
* ESP_SHARED_SD //Printer SD Card is also connected to ESP3D
* Does your system has SD card and how it is connected to your ESP3D
*/
//#define SD_DEVICE_CONNECTION ESP_NOT_SHARED_SD
/* SD card library
* ESP_SD_NATIVE //esp32 / esp8266
* ESP_SDIO //esp32 only
* ESP_SDFAT2 //esp8266 / esp32
*/
//#define SD_DEVICE ESP_SDFAT2
// #define SD_CARD_TYPE ESP_FYSETC_WIFI_PRO_SDCARD
/* Sdio bit mode
* Mode used by SDIO library 1 bit / 4bits
* SD_ONE_BIT_MODE
* SD_FOUR_BIT_MODE
*/
//#define SDIO_BIT_MODE SD_ONE_BIT_MODE
/* Enable date/time on files
* Set date/time on files using SNTP or last webui connection
*/
// #define SD_TIMESTAMP_FEATURE
/************************************
*
* SD card pins
*
************************************/
/* SD card detect pin
* The pin used to detect SD card
*/
// #define ESP_SD_DETECT_PIN 4
/* SD card detect pin value
* State of SD card detect pin when card is present
*/
// #define ESP_SD_DETECT_VALUE 0
/* SD shared flag pin
* The pin used to enable SD card for ESP board
*/
// #define ESP_FLAG_SHARED_SD_PIN -1
/* SD shared flag pin value
* State of SD card shared pin for ESP board
*/
// #define ESP_FLAG_SHARED_SD_VALUE 0
/* SD card CS pin
* The pin used to select SD card in SPI mode
*/
//#define ESP_SD_CS_PIN 21
//#define ESP_SD_MISO_PIN 8
//#define ESP_SD_MOSI_PIN 9
//#define ESP_SD_SCK_PIN 7
//#define ESP_SDIO_CMD_PIN 38
//#define ESP_SDIO_D0_PIN 40
//#define ESP_SDIO_CLK_PIN 39
/************************************
*
* Remote access
*
* Remote filesystem access
*
************************************/
/* Enable global filesystem
* Allows to access to all filesystems from same location
*/
//#define GLOBAL_FILESYSTEM_FEATURE
/* WebDav access
* Use WebDav to access to your filesystem
* FS_ROOT //mount all FS, need GLOBAL_FILESYSTEM_FEATURE
* FS_FLASH //mount Flash FS
* FS_SD mount SD FS
*/
//#define WEBDAV_FEATURE FS_ROOT
/* FTP access
* Use FTP to access to your filesystem (1 connection only)
* FS_ROOT //mount all FS, need GLOBAL_FILESYSTEM_FEATURE
* FS_FLASH //mount Flash FS
* FS_SD //mount SD FS
*/
// #define FTP_FEATURE FS_ROOT
/************************************
*
* Reset ESP3D
*
* Reset ESP3D settings
*
************************************/
/* Enable pin reset feature
* Use a pin to reset ESP3D settings
*/
// #define PIN_RESET_FEATURE
/* Reset pin
* The pin used to reset ESP3D setting if set to low for more than 1 second at
* start
*/
//#define ESP3D_RESET_PIN 0
/************************************
*
* Update ESP3D
*
* Update ESP3D firmware
*
************************************/
/* Enable OTA
* Over The Air Update (OTA)
*/
// #define OTA_FEATURE
/* Enable Web Update
* Update firmware using WebUI, need 4MB of flash
*/
#define WEB_UPDATE_FEATURE
/* Enable SD card Update
* Update firmware and settings using file on SDCard
*/
// #define SD_UPDATE_FEATURE
/************************************
*
* Display settings
*
* Rendering screens
*
************************************/
/* Printer screen
* If your printer has a display
*/
//#define PRINTER_HAS_DISPLAY
/* ESP3D screen
* Screen connected to ESP board
* OLED I2C SSD1306 128X64
* OLED_I2C_SSDSH1106_132X64
* TFT_SPI_ST7789_240X240
* TFT_SPI_ST7789_135X240
*/
//#define DISPLAY_DEVICE OLED_I2C_SSD1306_128X64
/* Flip screen
* Flip/rotate screen
*/
// #define DISPLAY_FLIP_VERTICALY
/* Display i2C address
* Wire address of display
*/
#define DISPLAY_I2C_ADDR 0x3c
#define ESP_SDA_PIN 21
#define ESP_SCL_PIN 22
/* Display reset pin
* The pin used to reset the screen (optional)
*/
// #define DISPLAY_I2C_PIN_RST 22
/* TFT led pin
* The pin used for the backlight
*/
// #define DISPLAY_LED_PIN -1
/************************************
*
* Audio settings
*
* Buzzer feature
*
************************************/
/* Enable buzzer
* Your esp board has a passive buzzer
*/
// #define BUZZER_DEVICE
/* Buzzer pin
* The pin used for the passive buzzer
*/
// #define ESP3D_BUZZER_PIN 33
/************************************
*
* Sensor settings
*
* Sensor feature
*
************************************/
//#define SENSOR_DEVICE BMP280_DEVICE
// Sensor i2C address
// Wire address of sensor
#define SENSOR_ADDR 0x76
// Unit
// C
// Unit of the sensor result
#define SENSOR__UNIT "C"
/* Sensor pin
* The pin used for the sensor
*/
// #define ESP3D_SENSOR_PIN 34
/* Sensor Unit
* Unit of the sensor result
*/
// #define SENSOR__UNIT "C"
/************************************
*
* Camera settings
*
* Connected camera
*
************************************/
/* Camera type
* CAMERA_MODEL_CUSTOM //Edit the pins in include/pins.h
* CAMERA_MODEL_ESP_EYE
* CAMERA_MODEL_M5STACK_PSRAM
* CAMERA_MODEL_M5STACK_V2_PSRAM
* CAMERA_MODEL_M5STACK_WIDE
* CAMERA_MODEL_AI_THINKER //ESP32-CAM
* CAMERA_MODEL_WROVER_KIT
* CAMERA_MODEL_ESP32_CAM_BOARD
* CAMERA_MODEL_ESP32S2_CAM_BOARD
* CAMERA_MODEL_ESP32S3_CAM_LCD
* CAMERA_MODEL_ESP32S3_EYE
* CAMERA_MODEL_XIAO_ESP32S3
* Camera connected to ESP board, only ones with PSRAM are supported
*/
// #define CAMERA_DEVICE CAMERA_MODEL_XIAO_ESP32S3
/* Flip vertically
* Flip camera vertically
*/
// #define CAMERA_DEVICE_FLIP_VERTICALY
/* Flip horizontally
* Flip camera horizontally
*/
// #define CAMERA_DEVICE_FLIP_HORIZONTALY
/************************************
*
* Levels of security
*
* How commands are allowed to be sent to ESP3D
*
************************************/
/* Enable serial commands
* Allow commands to be sent to ESP3D via serial port
*/
#define SERIAL_COMMAND_FEATURE
/* Allow remote access by enabling cross origin access
* check https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
* this should be enabled only in specific cases
* like show the camera in web page different than device web server
* /if you do not know what is that then better left it commented
* Allow to show the camera in web page different than device web server
*/
// #define ESP_ACCESS_CONTROL_ALLOW_ORIGIN
/* Enable authentication
* Force usage of authentication for commands
*/
// #define AUTHENTICATION_FEATURE
/************************************
*
* Additional features
*
* Extra settings
*
************************************/
/* Enable direct control pin
* Controls pins using [ESP201]
*/
#define DIRECT_PIN_FEATURE
/************************************
*
* Scripting settings
*
* Scripting on ESP3D
*
************************************/
/* Enable Autostart
* Commands to run on startup
* Separate commands with ';' or use file
*/
// #define ESP_AUTOSTART_SCRIPT "[ESP300]/FS/init.lua\n"
// #define ESP_AUTOSTART_SCRIPT "M117 Mounting SD;M21"
// #define ESP_AUTOSTART_SCRIPT_FILE "autoscript.gco"
/* Enable lua interpreter
* Allow to use lua interpreter on ESP3D on ESP32/S2/S3/C3 only
*/
//#define ESP_LUA_INTERPRETER_FEATURE
/* Hook when got IP
* Commands to run on event
* Separate commands with ';'
*/
#define ESP_GOT_IP_HOOK "[ESP212]IP:%ESP_IP%"
/* Hook when got date time
* Commands to run on event
* Separate commands with ';'
*/
#define ESP_GOT_DATE_TIME_HOOK "[ESP212]DATE:%ESP_DATETIME%"
/* Gcode Host Feature
* This feature allows to process Gcode files like macros.
*/
#define GCODE_HOST_FEATURE
/* Settings location
* SETTINGS_IN_EEPROM //ESP8266/ESP32
* SETTINGS_IN_PREFERENCES //ESP32 only
* Location where ESP3D will save settings
*/
#define ESP_SAVE_SETTINGS SETTINGS_IN_EEPROM
/************************************
*
* Development setting
* Do not modify them for production
************************************/
// Enable log mode
// Do not do this when connected to printer !!!
// be noted all upload may failed if enabled
// LOG_OUTPUT_SERIAL0
// LOG_OUTPUT_SERIAL1
// LOG_OUTPUT_SERIAL2
// LOG_OUTPUT_TELNET
// LOG_OUTPUT_WEBSOCKET
// #define ESP_LOG_FEATURE LOG_OUTPUT_SERIAL0
// #define ESP3D_DEBUG_LEVEL LOG_LEVEL_DEBUG
#ifdef ESP_LOG_FEATURE
#define LOG_ESP3D_BAUDRATE 115200
#define LOG_ESP3D_OUTPUT_PORT 8000
#endif // ESP_LOG_FEATURE
// Enable benchmark report in dev console
// #define ESP_BENCHMARK_FEATURE
// Disable sanity check at compilation
// #define ESP_NO_SANITY_CHECK
/************************************
*
* Sanity checks
* Do not modify
************************************/
#if defined(ESP_GOT_DATE_TIME_HOOK) || defined(SD_TIMESTAMP_FEATURE) || \
defined(FILESYSTEM_TIMESTAMP_FEATURE)
#define TIMESTAMP_FEATURE
#endif // SD_TIMESTAMP_FEATURE || FILESYSTEM_TIMESTAMP_FEATURE
#if defined(PRINTER_HAS_DISPLAY)
#define HAS_SERIAL_DISPLAY ""
#endif // PRINTER_HAS_DISPLAY
#if defined(CAMERA_DEVICE)
#if CAMERA_DEVICE == CAMERA_MODEL_ESP32_CAM_BOARD || \
CAMERA_DEVICE == CAMERA_MODEL_ESP32S2_CAM_BOARD
#define USE_BOARD_HEARDER 1
#endif // CAMERA_DEVICE==CAMERA_MODEL_ESP32_CAM_BOARD ||
// CAMERA_DEVICE==CAMERA_MODEL_ESP32S2_CAM_BOARD
#endif // CAMERA_DEVICE
#if !defined(WIFI_FEATURE) && !defined(ETH_FEATURE)
#undef HTTP_FEATURE
#undef TELNET_FEATURE
#undef WEBDAV_FEATURE
#undef FTP_FEATURE
#undef WEB_UPDATE_FEATURE
#undef CAPTIVE_PORTAL_FEATURE
#undef SSDP_FEATURE
#undef MDNS_FEATURE
#undef NOTIFICATION_FEATURE
#endif
#endif //_CONFIGURATION_H