Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit 4e82f38

Browse files
authored
v1.2.1 to increase SPI_CLOCK_MHZ
#### Releases v1.2.1 1. Increase default `SPI_CLOCK_MHZ` clock to 20MHz from 8MHz 2. Update examples to use `DHCP` with `built-in ESP32 Ethernet MAC Address`
1 parent 2c1e934 commit 4e82f38

31 files changed

+384
-227
lines changed

CONTRIBUTING.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,34 @@ However, before reporting a bug please check through the following:
1010

1111
If you don't find anything, please [open a new issue](https://github.com/khoih-prog/WebServer_ESP32_SC_ENC/issues/new).
1212

13+
---
14+
1315
### How to submit a bug report
1416

1517
Please ensure to specify the following:
1618

1719
* Arduino IDE version (e.g. 1.8.19) or Platform.io version
1820
* Board type (e.g. ESP32S3_DEV, ESP32S2_DEV, ESP32C3_DEV)
19-
* Board Core Version (e.g. ESP32 core v2.0.5)
21+
* Board Core Version (e.g. ESP32 core v2.0.6)
2022
* Contextual information (e.g. what you were trying to achieve)
2123
* Simplest possible steps to reproduce
2224
* Anything that might be relevant in your opinion, such as:
2325
* Operating system (Windows, Ubuntu, etc.) and the output of `uname -a`
2426
* Network configuration
2527

2628

27-
Please be educated, civilized and constructive. Disrespective posts against [GitHub Code of Conduct](https://docs.github.com/en/site-policy/github-terms/github-event-code-of-conduct) will be ignored and deleted.
29+
Please be educated, civilized and constructive as you've always been. Disrespective posts against [GitHub Code of Conduct](https://docs.github.com/en/site-policy/github-terms/github-event-code-of-conduct) will be ignored and deleted.
30+
31+
---
2832

2933
### Example
3034

3135
```
3236
Arduino IDE version: 1.8.19
3337
ESP32S3_DEV board
34-
ESP32 core v2.0.5
38+
ESP32 core v2.0.6
3539
OS: Ubuntu 20.04 LTS
36-
Linux xy-Inspiron-3593 5.15.0-56-generic #62~20.04.1-Ubuntu SMP Tue Nov 22 21:24:20 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
40+
Linux xy-Inspiron-3593 5.15.0-57-generic #63~20.04.1-Ubuntu SMP Wed Nov 30 13:40:16 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
3741
3842
Context:
3943
I encountered a crash while using this library

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616

1717
* [Changelog](#changelog)
18+
* [Releases v1.2.1](#releases-v121)
1819
* [Releases v1.2.0](#releases-v120)
1920
* [Releases v1.1.0](#releases-v110)
2021
* [Releases v1.0.0](#releases-v100)
@@ -24,6 +25,11 @@
2425

2526
## Changelog
2627

28+
#### Releases v1.2.1
29+
30+
1. Increase default `SPI_CLOCK_MHZ` clock to 20MHz from 8MHz
31+
2. Update examples to use `DHCP` with `built-in ESP32 Ethernet MAC Address`
32+
2733
#### Releases v1.2.0
2834

2935
1. Add support to ESP32_C3-based boards using `LwIP ENC28J60 Ethernet`

examples/AdvancedWebServer/AdvancedWebServer.ino

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
// Optional values to override default settings
5353
//#define ETH_SPI_HOST SPI2_HOST
54-
//#define SPI_CLOCK_MHZ 8
54+
//#define SPI_CLOCK_MHZ 20
5555

5656
// Must connect INT to GPIOxx or not working
5757
//#define INT_GPIO 4
@@ -225,12 +225,10 @@ void setup()
225225

226226
// start the ethernet connection and the server:
227227
// Use DHCP dynamic IP and random mac
228-
uint16_t index = millis() % NUMBER_OF_MAC;
229-
230228
//bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ,
231-
// int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac);
232-
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
233-
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[index] );
229+
// int SPI_HOST, uint8_t *W6100_Mac = W6100_Default_Mac);
230+
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
231+
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[millis() % NUMBER_OF_MAC] );
234232

235233
// Static IP, leave without this line to get IP via DHCP
236234
//bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = 0, IPAddress dns2 = 0);

examples/HelloServer/HelloServer.ino

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
//////////////////////////////////////////////////////////
2323

2424
// Optional values to override default settings
25-
//#define SPI_HOST 1
26-
//#define SPI_CLOCK_MHZ 8
25+
//#define ETH_SPI_HOST SPI2_HOST
26+
//#define SPI_CLOCK_MHZ 20
2727

2828
// Must connect INT to GPIOxx or not working
2929
//#define INT_GPIO 4
@@ -134,16 +134,14 @@ void setup()
134134

135135
// start the ethernet connection and the server:
136136
// Use DHCP dynamic IP and random mac
137-
uint16_t index = millis() % NUMBER_OF_MAC;
138-
139137
//bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ,
140-
// int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac);
141-
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
142-
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[index] );
138+
// int SPI_HOST, uint8_t *W6100_Mac = W6100_Default_Mac);
139+
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
140+
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[millis() % NUMBER_OF_MAC] );
143141

144142
// Static IP, leave without this line to get IP via DHCP
145143
//bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = 0, IPAddress dns2 = 0);
146-
ETH.config(myIP, myGW, mySN, myDNS);
144+
//ETH.config(myIP, myGW, mySN, myDNS);
147145

148146
ESP32_ENC_waitForConnect();
149147

examples/HelloServer2/HelloServer2.ino

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
//////////////////////////////////////////////////////////
2323

2424
// Optional values to override default settings
25-
//#define SPI_HOST 1
26-
//#define SPI_CLOCK_MHZ 8
25+
//#define ETH_SPI_HOST SPI2_HOST
26+
//#define SPI_CLOCK_MHZ 20
2727

2828
// Must connect INT to GPIOxx or not working
2929
//#define INT_GPIO 4
@@ -134,16 +134,14 @@ void setup()
134134

135135
// start the ethernet connection and the server:
136136
// Use DHCP dynamic IP and random mac
137-
uint16_t index = millis() % NUMBER_OF_MAC;
138-
139137
//bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ,
140-
// int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac);
141-
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
142-
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[index] );
138+
// int SPI_HOST, uint8_t *W6100_Mac = W6100_Default_Mac);
139+
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
140+
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[millis() % NUMBER_OF_MAC] );
143141

144142
// Static IP, leave without this line to get IP via DHCP
145143
//bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = 0, IPAddress dns2 = 0);
146-
ETH.config(myIP, myGW, mySN, myDNS);
144+
//ETH.config(myIP, myGW, mySN, myDNS);
147145

148146
ESP32_ENC_waitForConnect();
149147

examples/HttpBasicAuth/HttpBasicAuth.ino

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
//////////////////////////////////////////////////////////
2323

2424
// Optional values to override default settings
25-
//#define SPI_HOST 1
26-
//#define SPI_CLOCK_MHZ 8
25+
//#define ETH_SPI_HOST SPI2_HOST
26+
//#define SPI_CLOCK_MHZ 20
2727

2828
// Must connect INT to GPIOxx or not working
2929
//#define INT_GPIO 4
@@ -108,16 +108,14 @@ void setup()
108108

109109
// start the ethernet connection and the server:
110110
// Use DHCP dynamic IP and random mac
111-
uint16_t index = millis() % NUMBER_OF_MAC;
112-
113111
//bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ,
114-
// int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac);
115-
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
116-
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[index] );
112+
// int SPI_HOST, uint8_t *W6100_Mac = W6100_Default_Mac);
113+
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
114+
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[millis() % NUMBER_OF_MAC] );
117115

118116
// Static IP, leave without this line to get IP via DHCP
119117
//bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = 0, IPAddress dns2 = 0);
120-
ETH.config(myIP, myGW, mySN, myDNS);
118+
//ETH.config(myIP, myGW, mySN, myDNS);
121119

122120
ESP32_ENC_waitForConnect();
123121

examples/MQTTClient_Auth/MQTTClient_Auth.ino

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
//////////////////////////////////////////////////////////
3636

3737
// Optional values to override default settings
38-
//#define SPI_HOST 1
39-
//#define SPI_CLOCK_MHZ 8
38+
//#define ETH_SPI_HOST SPI2_HOST
39+
//#define SPI_CLOCK_MHZ 20
4040

4141
// Must connect INT to GPIOxx or not working
4242
//#define INT_GPIO 4
@@ -191,16 +191,14 @@ void setup()
191191

192192
// start the ethernet connection and the server:
193193
// Use DHCP dynamic IP and random mac
194-
uint16_t index = millis() % NUMBER_OF_MAC;
195-
196194
//bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ,
197-
// int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac);
198-
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
199-
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[index] );
195+
// int SPI_HOST, uint8_t *W6100_Mac = W6100_Default_Mac);
196+
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
197+
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[millis() % NUMBER_OF_MAC] );
200198

201199
// Static IP, leave without this line to get IP via DHCP
202200
//bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = 0, IPAddress dns2 = 0);
203-
ETH.config(myIP, myGW, mySN, myDNS);
201+
//ETH.config(myIP, myGW, mySN, myDNS);
204202

205203
ESP32_ENC_waitForConnect();
206204

examples/MQTTClient_Basic/MQTTClient_Basic.ino

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
//////////////////////////////////////////////////////////
3737

3838
// Optional values to override default settings
39-
//#define SPI_HOST 1
40-
//#define SPI_CLOCK_MHZ 8
39+
//#define ETH_SPI_HOST SPI2_HOST
40+
//#define SPI_CLOCK_MHZ 20
4141

4242
// Must connect INT to GPIOxx or not working
4343
//#define INT_GPIO 4
@@ -192,16 +192,14 @@ void setup()
192192

193193
// start the ethernet connection and the server:
194194
// Use DHCP dynamic IP and random mac
195-
uint16_t index = millis() % NUMBER_OF_MAC;
196-
197195
//bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ,
198-
// int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac);
199-
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
200-
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[index] );
196+
// int SPI_HOST, uint8_t *W6100_Mac = W6100_Default_Mac);
197+
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
198+
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[millis() % NUMBER_OF_MAC] );
201199

202200
// Static IP, leave without this line to get IP via DHCP
203201
//bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = 0, IPAddress dns2 = 0);
204-
ETH.config(myIP, myGW, mySN, myDNS);
202+
//ETH.config(myIP, myGW, mySN, myDNS);
205203

206204
ESP32_ENC_waitForConnect();
207205

examples/MQTT_ThingStream/MQTT_ThingStream.ino

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
//////////////////////////////////////////////////////////
3939

4040
// Optional values to override default settings
41-
//#define SPI_HOST 1
42-
//#define SPI_CLOCK_MHZ 8
41+
//#define ETH_SPI_HOST SPI2_HOST
42+
//#define SPI_CLOCK_MHZ 20
4343

4444
// Must connect INT to GPIOxx or not working
4545
//#define INT_GPIO 4
@@ -237,16 +237,14 @@ void setup()
237237

238238
// start the ethernet connection and the server:
239239
// Use DHCP dynamic IP and random mac
240-
uint16_t index = millis() % NUMBER_OF_MAC;
241-
242240
//bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ,
243-
// int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac);
244-
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
245-
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[index] );
241+
// int SPI_HOST, uint8_t *W6100_Mac = W6100_Default_Mac);
242+
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
243+
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[millis() % NUMBER_OF_MAC] );
246244

247245
// Static IP, leave without this line to get IP via DHCP
248246
//bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = 0, IPAddress dns2 = 0);
249-
ETH.config(myIP, myGW, mySN, myDNS);
247+
//ETH.config(myIP, myGW, mySN, myDNS);
250248

251249
ESP32_ENC_waitForConnect();
252250

examples/PostServer/PostServer.ino

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
//////////////////////////////////////////////////////////
2323

2424
// Optional values to override default settings
25-
//#define SPI_HOST 1
26-
//#define SPI_CLOCK_MHZ 8
25+
//#define ETH_SPI_HOST SPI2_HOST
26+
//#define SPI_CLOCK_MHZ 20
2727

2828
// Must connect INT to GPIOxx or not working
2929
//#define INT_GPIO 4
@@ -183,16 +183,14 @@ void setup()
183183

184184
// start the ethernet connection and the server:
185185
// Use DHCP dynamic IP and random mac
186-
uint16_t index = millis() % NUMBER_OF_MAC;
187-
188186
//bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ,
189-
// int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac);
190-
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
191-
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[index] );
187+
// int SPI_HOST, uint8_t *W6100_Mac = W6100_Default_Mac);
188+
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
189+
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[millis() % NUMBER_OF_MAC] );
192190

193191
// Static IP, leave without this line to get IP via DHCP
194192
//bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = 0, IPAddress dns2 = 0);
195-
ETH.config(myIP, myGW, mySN, myDNS);
193+
//ETH.config(myIP, myGW, mySN, myDNS);
196194

197195
ESP32_ENC_waitForConnect();
198196

examples/SimpleAuthentication/SimpleAuthentication.ino

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
//////////////////////////////////////////////////////////
2323

2424
// Optional values to override default settings
25-
//#define SPI_HOST 1
26-
//#define SPI_CLOCK_MHZ 8
25+
//#define ETH_SPI_HOST SPI2_HOST
26+
//#define SPI_CLOCK_MHZ 20
2727

2828
// Must connect INT to GPIOxx or not working
2929
//#define INT_GPIO 4
@@ -227,16 +227,14 @@ void setup()
227227

228228
// start the ethernet connection and the server:
229229
// Use DHCP dynamic IP and random mac
230-
uint16_t index = millis() % NUMBER_OF_MAC;
231-
232230
//bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ,
233-
// int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac);
234-
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
235-
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[index] );
231+
// int SPI_HOST, uint8_t *W6100_Mac = W6100_Default_Mac);
232+
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
233+
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[millis() % NUMBER_OF_MAC] );
236234

237235
// Static IP, leave without this line to get IP via DHCP
238236
//bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = 0, IPAddress dns2 = 0);
239-
ETH.config(myIP, myGW, mySN, myDNS);
237+
//ETH.config(myIP, myGW, mySN, myDNS);
240238

241239
ESP32_ENC_waitForConnect();
242240

examples/UdpNTPClient/UdpNTPClient.ino

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
//////////////////////////////////////////////////////////
2828

2929
// Optional values to override default settings
30-
//#define SPI_HOST 1
31-
//#define SPI_CLOCK_MHZ 8
30+
//#define ETH_SPI_HOST SPI2_HOST
31+
//#define SPI_CLOCK_MHZ 20
3232

3333
// Must connect INT to GPIOxx or not working
3434
//#define INT_GPIO 4
@@ -146,16 +146,14 @@ void setup()
146146

147147
// start the ethernet connection and the server:
148148
// Use DHCP dynamic IP and random mac
149-
uint16_t index = millis() % NUMBER_OF_MAC;
150-
151149
//bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ,
152-
// int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac);
153-
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
154-
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[index] );
150+
// int SPI_HOST, uint8_t *W6100_Mac = W6100_Default_Mac);
151+
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
152+
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[millis() % NUMBER_OF_MAC] );
155153

156154
// Static IP, leave without this line to get IP via DHCP
157155
//bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = 0, IPAddress dns2 = 0);
158-
ETH.config(myIP, myGW, mySN, myDNS);
156+
//ETH.config(myIP, myGW, mySN, myDNS);
159157

160158
ESP32_ENC_waitForConnect();
161159

0 commit comments

Comments
 (0)