Кстати в оф сайте есть такая информация:
Спойлер
Network port control pin description
Network port interface | ESP32-S3-ETH GPIO
MISO | GPIO12
MOSI | GPIO11
SCLK | GPIO13
CS | GPIO14
RST | GPIO9
INT | GPIO10
я прозвонил эти контакты, и все в норме как по схеме. А еще на оф сайте я нашел скетч с ETH, но он у меня не работает. В скетче я нашел переменную, значение которой я нигде не могу найти… и интересно что какой то пин подает 5V(3.3V), что за пин я тоже так и не понял… Может для того чтобы W5500 заработала, нужно питание подать на какой то пин? в w5500 есть пин который называется INT, что делает этот пин, немного не понял… но вдруг для того чтобы модуль заработал, нужно именно туда питание подать?
В скетче
#ifdef ETH_POWER_PIN
pinMode(ETH_POWER_PIN, OUTPUT);
digitalWrite(ETH_POWER_PIN, HIGH);
#endif
попытался вывести ее, выдает ошибку
Так пытаюсь
void setup()
{
Serial.begin(115200);
Serial.setDebugOutput(true);
Serial.println();
Serial.println(ETH_POWER_PIN);
pinMode(CAM_ENABLE, OUTPUT); // Configure CAM_ENABLE pin as output
digitalWrite(CAM_ENABLE, LOW); // Ensure CAM_ENABLE is off at startup
WiFi.onEvent(WiFiEvent);
#ifdef ETH_POWER_PIN
pinMode(ETH_POWER_PIN, OUTPUT);
digitalWrite(ETH_POWER_PIN, HIGH);
#endif
Такая ошибка
error: ‘ETH_POWER_PIN’ was not declared in this scope; did you mean ‘ETH_MOSI_PIN’?
96 | Serial.println(ETH_POWER_PIN);
Весь скетч
`/**
* @file CameraShield.ino
* @author Lewis He (lewishe@outlook.com)
* @license MIT
* @copyright Copyright (c) 2023 Shenzhen Xin Yuan Electronic Technology Co., Ltd
* @date 2023-08-07
* @note Only support T-ETH-Lite-ESP32S3, need external camera shield to combine
* @Steps
* 1. Don’t plug in the camera, flash sketch, and plug in the network cable
* 2. After startup, check the connected IP address through the Serial monitor and record the IP address.
* 3. Turn off the power and plug in the camera module
* 4. After powering on, open a browser on a computer on the same LAN and enter the URL you just recorded to access the camera.
*/
#include "esp_camera.h"
#include <WiFi.h>
#if ESP_ARDUINO_VERSION < ESP_ARDUINO_VERSION_VAL(3,0,0)
#include <ETHClass2.h> //Is to use the modified ETHClass
#define ETH ETH2
#else
#include <ETH.h>
#endif
#include "utilities.h" //Board PinMap
//camera Shield pinmap
#define PWDN_GPIO_NUM -1
#define RESET_GPIO_NUM -1
#define XCLK_GPIO_NUM 3
#define SIOD_GPIO_NUM 48
#define SIOC_GPIO_NUM 47
#define Y9_GPIO_NUM 18
#define Y8_GPIO_NUM 15
#define Y7_GPIO_NUM 38
#define Y6_GPIO_NUM 40
#define Y5_GPIO_NUM 42
#define Y4_GPIO_NUM 46
#define Y3_GPIO_NUM 45
#define Y2_GPIO_NUM 41
#define VSYNC_GPIO_NUM 1
#define HREF_GPIO_NUM 2
#define PCLK_GPIO_NUM 39
#define CAM_ENABLE 8
void startCameraServer();
static bool eth_connected = false;
void WiFiEvent(arduino_event_id_t event)
{
switch (event) {
case ARDUINO_EVENT_ETH_START:
Serial.println("ETH Started");
//set eth hostname here
ETH.setHostname("esp32-ethernet");
break;
case ARDUINO_EVENT_ETH_CONNECTED:
Serial.println("ETH Connected");
break;
case ARDUINO_EVENT_ETH_GOT_IP:
Serial.print("ETH MAC: ");
Serial.print(ETH.macAddress());
Serial.print(", IPv4: ");
Serial.print(ETH.localIP());
if (ETH.fullDuplex()) {
Serial.print(", FULL_DUPLEX");
}
Serial.print(", ");
Serial.print(ETH.linkSpeed());
Serial.print("Mbps");
Serial.print(", ");
Serial.print("GatewayIP:");
Serial.println(ETH.gatewayIP());
eth_connected = true;
break;
case ARDUINO_EVENT_ETH_DISCONNECTED:
Serial.println("ETH Disconnected");
eth_connected = false;
break;
case ARDUINO_EVENT_ETH_STOP:
Serial.println("ETH Stopped");
eth_connected = false;
break;
default:
break;
}
}
void setup()
{
Serial.begin(115200);
Serial.setDebugOutput(true);
Serial.println();
Serial.println(ETH_POWER_PIN);
pinMode(CAM_ENABLE, OUTPUT); // Configure CAM_ENABLE pin as output
digitalWrite(CAM_ENABLE, LOW); // Ensure CAM_ENABLE is off at startup
WiFi.onEvent(WiFiEvent);
#ifdef ETH_POWER_PIN
pinMode(ETH_POWER_PIN, OUTPUT);
digitalWrite(ETH_POWER_PIN, HIGH);
#endif
#if CONFIG_IDF_TARGET_ESP32
if (!ETH.begin(ETH_TYPE, ETH_ADDR, ETH_MDC_PIN,
ETH_MDIO_PIN, ETH_RESET_PIN, ETH_CLK_MODE)) {
Serial.println("ETH start Failed!");
}
#else
if (!ETH.begin(ETH_PHY_W5500, 1, ETH_CS_PIN, ETH_INT_PIN, ETH_RST_PIN,
SPI3_HOST,
ETH_SCLK_PIN, ETH_MISO_PIN, ETH_MOSI_PIN)) {
Serial.println("ETH start Failed!");
}
#endif
// The infrared filter function is configured through the web
pinMode(IR_FILTER_NUM, OUTPUT);
while (!eth_connected) {
Serial.println("Wait ETH Connect...");
delay(1000);
};
camera_config_t config;
config.ledc_channel = LEDC_CHANNEL_0;
config.ledc_timer = LEDC_TIMER_0;
config.pin_d0 = Y2_GPIO_NUM;
config.pin_d1 = Y3_GPIO_NUM;
config.pin_d2 = Y4_GPIO_NUM;
config.pin_d3 = Y5_GPIO_NUM;
config.pin_d4 = Y6_GPIO_NUM;
config.pin_d5 = Y7_GPIO_NUM;
config.pin_d6 = Y8_GPIO_NUM;
config.pin_d7 = Y9_GPIO_NUM;
config.pin_xclk = XCLK_GPIO_NUM;
config.pin_pclk = PCLK_GPIO_NUM;
config.pin_vsync = VSYNC_GPIO_NUM;
config.pin_href = HREF_GPIO_NUM;
config.pin_sccb_sda = SIOD_GPIO_NUM;
config.pin_sccb_scl = SIOC_GPIO_NUM;
config.pin_pwdn = PWDN_GPIO_NUM;
config.pin_reset = RESET_GPIO_NUM;
config.xclk_freq_hz = 20000000;
config.frame_size = FRAMESIZE_UXGA;
config.pixel_format = PIXFORMAT_JPEG; // for streaming
//config.pixel_format = PIXFORMAT_RGB565; // for face detection/recognition
config.grab_mode = CAMERA_GRAB_WHEN_EMPTY;
config.fb_location = CAMERA_FB_IN_PSRAM;
config.jpeg_quality = 12;
config.fb_count = 1;
// if PSRAM IC present, init with UXGA resolution and higher JPEG quality
// for larger pre-allocated frame buffer.
if (config.pixel_format == PIXFORMAT_JPEG) {
if (psramFound()) {
config.jpeg_quality = 10;
config.fb_count = 2;
config.grab_mode = CAMERA_GRAB_LATEST;
} else {
// Limit the frame size when PSRAM is not available
config.frame_size = FRAMESIZE_SVGA;
config.fb_location = CAMERA_FB_IN_DRAM;
}
} else {
// Best option for face detection/recognition
config.frame_size = FRAMESIZE_240X240;
config.fb_count = 2;
}
// camera init
esp_err_t err = esp_camera_init(&config);
if (err != ESP_OK) {
Serial.printf("Camera init failed with error 0x%x", err);
return;
}
Serial.println("Camera Start!!!");
sensor_t *s = esp_camera_sensor_get();
// initial sensors are flipped vertically and colors are a bit saturated
if (s->id.PID == OV5640_PID) {
s->set_vflip(s, 1); // flip it back
// s->set_brightness(s, 1); // up the brightness just a bit
// s->set_saturation(s, -2); // lower the saturation
} else {
s->set_vflip(s, 0);
}
// drop down frame size for higher initial frame rate
if (config.pixel_format == PIXFORMAT_JPEG) {
s->set_framesize(s, FRAMESIZE_QVGA);
}
startCameraServer();
}
void loop()
{
Serial.println(ETH_POWER_PIN);
// Do nothing. Everything is done in another task by the web server
delay(10000);
}
`