Skip to content

Commit

Permalink
Idf 5.1.4/Arduino 3.0.4 porting for esp32 (#1046)
Browse files Browse the repository at this point in the history
* Update WebSocket library
* Update SSDP library
* Update TFT_eSPI library
* Update EspLuaEngine library
* Update SDFat library
* Change to pioarduino
* Make ESP3DMessageFIFO and ESP3DMessage  more thread safe
* Fix sanity checks for BT
* Add some C6 support
* Refactor ethernet code
* Split Ethernet Sta / WiFi sta ESP Commands  and settings
* Simplify wait and wdtFeed code
* Set C3 with 4MB by default in platformio.ini
* Apply Disable brown out only on ESP32 to avoid crash e.g:ESP32S3
* Add missing entries in platformio.ini
  • Loading branch information
luc-github authored Sep 5, 2024
1 parent 8deab1f commit 93312ff
Show file tree
Hide file tree
Showing 2,062 changed files with 51,022 additions and 152,840 deletions.
2 changes: 1 addition & 1 deletion .github/ci/install-esp32.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ echo "Clone esp32 core"
cd $HOME/arduino_ide/hardware
mkdir esp32
cd esp32
git clone -b 2.0.8 https://github.com/espressif/arduino-esp32.git esp32
git clone -b 3.0.4 https://github.com/espressif/arduino-esp32.git esp32
cd esp32
git submodule update --init
cd tools
Expand Down
8 changes: 4 additions & 4 deletions .github/ci/prepare-libs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ shopt -s globstar
ls $HOME
# Make sure we are inside the github workspace
cd $GITHUB_WORKSPACE
cp -r ./libraries/ESP32SSDP-1.2.1 $HOME/arduino_ide/libraries/
cp -r ./libraries/arduinoWebSockets-2.3.6 $HOME/arduino_ide/libraries/
cp -r ./libraries/ESP32SSDP-2.0.2 $HOME/arduino_ide/libraries/
cp -r ./libraries/arduinoWebSockets-2.5.2 $HOME/arduino_ide/libraries/
cp -r ./libraries/DHT_sensor_library_for_ESPx-1.0.6 $HOME/arduino_ide/libraries/
cp -r ./libraries/esp8266-oled-ssd1306-4.3.0 $HOME/arduino_ide/libraries/
cp -r ./libraries/TFT_eSPI-2.4.72 $HOME/arduino_ide/libraries/
cp -r ./libraries/TFT_eSPI-2.5.43 $HOME/arduino_ide/libraries/
cp -r ./libraries/lvgl-8.2.0 $HOME/arduino_ide/libraries/
cp -r ./libraries/EspLuaEngine-1.0.1 $HOME/arduino_ide/libraries/
cp -r ./libraries/EspLuaEngine-1.0.2 $HOME/arduino_ide/libraries/
cp -r ./libraries/BMx280MI-1.2.0 $HOME/arduino_ide/libraries/
#TODO add SDFat libraries according version and target

7 changes: 0 additions & 7 deletions astyle.bat

This file was deleted.

7 changes: 0 additions & 7 deletions astyle.sh

This file was deleted.

18 changes: 18 additions & 0 deletions docs/esp3dcnf.ini
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,24 @@ AP_IP = 192.168.0.1
#AP channel 1~14
AP_channel = 11

#Ethernet STA IP Mode DHCP / STATIC
ETH_STA_IP_mode = DHCP

#Ethernet STA static IP
ETH_STA_IP = 192.168.0.2

#Ethernet STA static gateway
ETH_STA_GW = 192.168.0.1

#Ethernet STA static mask
ETH_STA_MSK = 255.255.255.0

#Ethernet STA static dns
ETH_STA_DNS = 192.168.0.1

#Ethernet fallback mode BT, OFF
eth_sta_fallback = OFF

[services]
#Active or not Serial Bridge Yes / No
Serial_Bridge_active = Yes
Expand Down
38 changes: 23 additions & 15 deletions esp3d/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
/* Use Ethernet
* Enable ethernet communications
*/
// #define ETH_FEATURE
//#define ETH_FEATURE

// Ethernet type (Check ETH.h eth_phy_type_t)
// TYPE_ETH_PHY_LAN8720
Expand All @@ -136,20 +136,20 @@
// MODE_ETH_CLOCK_GPIO0_OUT
// MODE_ETH_CLOCK_GPIO16_OUT
// MODE_ETH_CLOCK_GPIO17_OUT
#define ESP3D_ETH_CLK_MODE 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 12
// #define ESP3D_ETH_PHY_MDC_PIN 23
// #define ESP3D_ETH_PHY_MDIO_PIN 18
#define ESP3D_ETH_PHY_POWER_PIN 16
#define ESP3D_ETH_PHY_MDC_PIN 23
#define ESP3D_ETH_PHY_MDIO_PIN 18

// Address of ethernet board
// #define ESP3D_ETH_PHY_ADDR 0
#define ESP3D_ETH_PHY_ADDR 1

/* Use Bluetooth
* Enable serial bluetooth communications
*/
// #define BLUETOOTH_FEATURE
//#define BLUETOOTH_FEATURE

/************************************
*
Expand Down Expand Up @@ -283,14 +283,15 @@
* 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_SHARED_SD
//#define SD_DEVICE_CONNECTION ESP_DIRECT_SD

/* SD card library
* ESP_SD_NATIVE //esp32 / esp8266
* ESP_SDIO //esp32 only
* ESP_SDFAT2 //esp8266 / esp32
*/
// #define SD_DEVICE ESP_SD_NATIVE
//#define SD_DEVICE ESP_SDFAT2


// #define SD_CARD_TYPE ESP_FYSETC_WIFI_PRO_SDCARD

Expand All @@ -299,7 +300,7 @@
* SD_ONE_BIT_MODE
* SD_FOUR_BIT_MODE
*/
// #define SDIO_BIT_MODE SD_ONE_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
Expand Down Expand Up @@ -335,7 +336,13 @@
/* SD card CS pin
* The pin used to select SD card in SPI mode
*/
// #define ESP_SD_CS_PIN 5
//#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

/************************************
*
Expand Down Expand Up @@ -383,7 +390,7 @@
* The pin used to reset ESP3D setting if set to low for more than 1 second at
* start
*/
#define ESP3D_RESET_PIN 0
//#define ESP3D_RESET_PIN 0

/************************************
*
Expand Down Expand Up @@ -505,9 +512,10 @@
* 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_AI_THINKER
// #define CAMERA_DEVICE CAMERA_MODEL_XIAO_ESP32S3

/* Flip vertically
* Flip camera vertically
Expand Down Expand Up @@ -621,9 +629,9 @@
// LOG_OUTPUT_SERIAL2
// LOG_OUTPUT_TELNET
// LOG_OUTPUT_WEBSOCKET
// #define ESP_LOG_FEATURE LOG_OUTPUT_SERIAL0
//#define ESP_LOG_FEATURE LOG_OUTPUT_SERIAL0

// #define ESP3D_DEBUG_LEVEL LOG_LEVEL_DEBUG
//#define ESP3D_DEBUG_LEVEL LOG_LEVEL_DEBUG

#ifdef ESP_LOG_FEATURE
#define LOG_ESP3D_BAUDRATE 115200
Expand Down
20 changes: 10 additions & 10 deletions esp3d/src/core/commands/ESP0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,11 @@ const char* help[] = {
"[ESP100](SSID) - display/set STA SSID",
"[ESP101](Password) - set STA password",
#endif // WIFI_FEATURE
#if defined(WIFI_FEATURE) || defined(ETH_FEATURE)
#if defined(WIFI_FEATURE)
"[ESP102](Mode) - display/set STA IP mode (DHCP/STATIC)",
"[ESP103](IP=xxxx MSK=xxxx GW=xxxx) - display/set STA IP/Mask/GW",
#endif // WIFI_FEATURE || ETH_FEATURE
#if defined(WIFI_FEATURE) || defined(BLUETOOTH_FEATURE) || defined(ETH_FEATURE)
"[ESP104](State) - display/set sta fallback mode which can be BT, SETUP, "
"OFF",
#endif // WIFI_FEATURE || BLUETOOTH_FEATURE || ETH_FEATURE
#if defined(WIFI_FEATURE)
"[ESP105](SSID) - display/set AP SSID",
"[ESP106](Password) - set AP password",
"[ESP107](IP) - display/set AP IP",
Expand All @@ -53,6 +49,11 @@ const char* help[] = {
"[ESP115](State) - display/set immediate Network state which can be ON, "
"OFF",
#endif // WIFI_FEATURE || ETH_FEATURE || BT_FEATURE
#if defined(ETH_FEATURE)
"[ESP116](Mode) - display/set ETH STA IP mode (DHCP/STATIC)",
"[ESP117](IP=xxxx MSK=xxxx GW=xxxx) - display/set ETH STA IP/Mask/GW",
"[ESP118](State) - display/set eth sta fallback mode which can be BT, Off",
#endif // ETH_FEATURE
#if defined(HTTP_FEATURE)
"[ESP120](State) - display/set HTTP state which can be ON, OFF",
"[ESP121](Port) - display/set HTTP port ",
Expand Down Expand Up @@ -196,13 +197,9 @@ const uint cmdlist[] = {
#if defined(WIFI_FEATURE)
100, 101,
#endif // WIFI_FEATURE
#if defined(WIFI_FEATURE) || defined(ETH_FEATURE)
#if defined(WIFI_FEATURE)
102, 103,
#endif // WIFI_FEATURE || ETH_FEATURE
#if defined(WIFI_FEATURE) || defined(BLUETOOTH_FEATURE) || defined(ETH_FEATURE)
104,
#endif // WIFI_FEATURE || BLUETOOTH_FEATURE || ETH_FEATURE
#if defined(WIFI_FEATURE)
105, 106, 107, 108,
#endif // WIFI_FEATURE
#if defined(WIFI_FEATURE) || defined(BLUETOOTH_FEATURE) || defined(ETH_FEATURE)
Expand All @@ -214,6 +211,9 @@ const uint cmdlist[] = {
#if defined(WIFI_FEATURE) || defined(ETH_FEATURE) || defined(BT_FEATURE)
112, 114, 115,
#endif // WIFI_FEATURE || ETH_FEATURE || BT_FEATURE
#if defined(ETH_FEATURE)
116, 117, 118,
#endif // ETH_FEATURE
#if defined(HTTP_FEATURE)
120, 121,
#endif // HTTP_FEATURE
Expand Down
7 changes: 2 additions & 5 deletions esp3d/src/core/commands/ESP102.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,14 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "../../include/esp3d_config.h"
#if defined(WIFI_FEATURE) || defined(ETH_FEATURE)
#if defined(WIFI_FEATURE)
#include "../../modules/network/netconfig.h"
#include "../esp3d_commands.h"
#include "../esp3d_settings.h"

#if defined(WIFI_FEATURE)
#include "../../modules/wifi/wificonfig.h"
#endif // WIFI_FEATURE
#if defined(ETH_FEATURE)
#include "../../modules/ethernet/ethconfig.h"
#endif // ETH_FEATURE
#include "../../modules/authentication/authentication_service.h"
#define COMMAND_ID 102
// Change STA IP mode (DHCP/STATIC)
Expand Down Expand Up @@ -97,4 +94,4 @@ void ESP3DCommands::ESP102(int cmd_params_pos, ESP3DMessage* msg) {
}
}

#endif // WIFI_FEATURE || ETH_FEATURE
#endif // WIFI_FEATURE
7 changes: 2 additions & 5 deletions esp3d/src/core/commands/ESP103.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,14 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "../../include/esp3d_config.h"
#if defined(WIFI_FEATURE) || defined(ETH_FEATURE)
#if defined(WIFI_FEATURE)
#include "../../modules/network/netconfig.h"
#include "../esp3d_commands.h"
#include "../esp3d_settings.h"

#if defined(WIFI_FEATURE)
#include "../../modules/wifi/wificonfig.h"
#endif // WIFI_FEATURE
#if defined(ETH_FEATURE)
#include "../../modules/ethernet/ethconfig.h"
#endif // ETH_FEATURE
#include "../../modules/authentication/authentication_service.h"
#define COMMAND_ID 103
// Change STA IP/Mask/GW
Expand Down Expand Up @@ -121,4 +118,4 @@ void ESP3DCommands::ESP103(int cmd_params_pos, ESP3DMessage* msg) {
}
}

#endif // WIFI_FEATURE || ETH_FEATURE
#endif // WIFI_FEATURE
12 changes: 1 addition & 11 deletions esp3d/src/core/commands/ESP104.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "../../include/esp3d_config.h"
#if defined(WIFI_FEATURE) || defined(BLUETOOTH_FEATURE) || defined(ETH_FEATURE)
#if defined(WIFI_FEATURE)
#include "../../modules/authentication/authentication_service.h"
#include "../../modules/network/netconfig.h"
#include "../esp3d_commands.h"
Expand Down Expand Up @@ -54,11 +54,6 @@ void ESP3DCommands::ESP104(int cmd_params_pos, ESP3DMessage* msg) {
ok_msg = "BT";
} else
#endif // BLUETOOTH_FEATURE
#if defined(WIFI_FEATURE)
if (byteValue == (uint8_t)ESP_AP_SETUP) {
ok_msg = "CONFIG";
} else
#endif // WIFI_FEATURE
if (byteValue == (uint8_t)ESP_NO_NETWORK) {
ok_msg = "OFF";
} else {
Expand All @@ -76,11 +71,6 @@ void ESP3DCommands::ESP104(int cmd_params_pos, ESP3DMessage* msg) {
byteValue = (uint8_t)ESP_BT;
} else
#endif // BLUETOOTH_FEATURE
#if defined(WIFI_FEATURE)
if (tmpstr == "CONFIG") {
byteValue = (uint8_t)ESP_AP_SETUP;
} else
#endif // WIFI_FEATURE
if (tmpstr == "OFF") {
byteValue = (uint8_t)ESP_NO_NETWORK;
} else {
Expand Down
Loading

0 comments on commit 93312ff

Please sign in to comment.