ESP3D/esp3d/configuration.h
2026-04-04 17:04:18 -03:00

337 lines
7.9 KiB
C

/*
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
// ============================================================================
// SD WIFI Pro (FYSETC) configuration
// ESP32 / 4MB flash / SDIO 4-bit shared SD
// ============================================================================
/* 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
/************************************
*
* Serial Communications
*
* Settings and protocols
*
************************************/
/* Serial Communication protocol
* RAW_SERIAL // Basic serial protocol, without data change
* MKS_SERIAL // MakerBase communication protocol
*/
#define COMMUNICATION_PROTOCOL RAW_SERIAL
/* Main Serial port
* USE_SERIAL_0 / USE_SERIAL_1 / USE_SERIAL_2
*/
#define ESP_SERIAL_OUTPUT USE_SERIAL_0
/* Serial buffer size
* Maximum size of the serial buffer
*/
#define SERIAL_RX_BUFFER_SIZE 512
/************************************
*
* Target firmware
*
* Not used - this is a standalone SD WiFi device
*
************************************/
#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
/************************************
*
* Channels of ESP3D
*
* The way ESP3D communicate
*
************************************/
/* Use Web server
* Enable http server
*/
#define HTTP_FEATURE
/* 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 "SD WIFI Pro 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 */
#define ESP_MODEL_NAME "SD_WIFI_PRO"
/* Model number */
#define ESP_MODEL_NUMBER "SWP 1.0"
/* Model url */
#define ESP_MODEL_URL "https://github.com/FYSETC/SD-WIFI-PRO"
/* Manufacturer name */
#define ESP_MANUFACTURER_NAME "FYSETC"
/* Manufacturer url */
#define ESP_MANUFACTURER_URL "https://www.fysetc.com"
/************************************
*
* Flash filesystem
*
* Filesystem on flash
*
************************************/
/* File system type used by ESP3D
* 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 - SDIO 4-bit shared mode
*
************************************/
/* SD card connection
* ESP_SHARED_SD: both host and ESP share the SD card
*/
#define SD_DEVICE_CONNECTION ESP_SHARED_SD
/* SD card library
* ESP_SDIO: ESP32 SDMMC (4-bit mode)
*/
#define SD_DEVICE ESP_SDIO
/* SDIO bit mode
* SD_FOUR_BIT_MODE for maximum throughput
*/
#define SDIO_BIT_MODE SD_FOUR_BIT_MODE
/* Enable date/time on files */
#define SD_TIMESTAMP_FEATURE
/************************************
*
* SD card pins (SDIO mode for SD WIFI Pro)
*
************************************/
/* SD shared flag pin
* Active LOW to claim SD for ESP
*/
#define ESP_FLAG_SHARED_SD_PIN 26
#define ESP_FLAG_SHARED_SD_VALUE 0
/* SDIO pins (standard ESP32 SDMMC pins) */
#define ESP_SDIO_CLK_PIN 14
#define ESP_SDIO_CMD_PIN 15
#define ESP_SDIO_D0_PIN 2
#define ESP_SDIO_D1_PIN 4
#define ESP_SDIO_D2_PIN 12
#define ESP_SDIO_D3_PIN 13
/************************************
*
* Remote access
*
* Remote filesystem access
*
************************************/
/* Enable global filesystem
* Allows to access to all filesystems from same location
*/
#define GLOBAL_FILESYSTEM_FEATURE
/* WebDav access
* FS_ROOT / FS_FLASH / FS_SD
*/
#define WEBDAV_FEATURE FS_SD
/* FTP access (1 connection only)
* FS_ROOT / FS_FLASH / FS_SD
*/
#define FTP_FEATURE FS_SD
/************************************
*
* Update ESP3D
*
* Update ESP3D firmware
*
************************************/
/* Enable Web Update
* Update firmware using WebUI, need 4MB of flash
*/
#define WEB_UPDATE_FEATURE
/* Disable serial forwarding to external device
* No printer/CNC connected - this is a standalone SD WiFi device.
* Non-ESP commands are dropped instead of forwarded to serial.
*/
#define NO_SERIAL_FORWARD
/* Settings location
* SETTINGS_IN_EEPROM //ESP8266/ESP32
* SETTINGS_IN_PREFERENCES //ESP32 only
*/
#define ESP_SAVE_SETTINGS SETTINGS_IN_EEPROM
/************************************
*
* Development setting
* Do not modify them for production
************************************/
// Enable log mode
// LOG_OUTPUT_SERIAL0 / LOG_OUTPUT_SERIAL1 / LOG_OUTPUT_SERIAL2
// LOG_OUTPUT_TELNET / LOG_OUTPUT_WEBSOCKET
// #define ESP_LOG_FEATURE LOG_OUTPUT_SERIAL0
// #define ESP3D_LOG_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(CAMERA_DEVICE)
#if CAMERA_DEVICE == CAMERA_MODEL_ESP32_CAM_BOARD || \
CAMERA_DEVICE == CAMERA_MODEL_ESP32S2_CAM_BOARD
#define USE_BOARD_HEARDER 1
#endif
#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