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

Commit 7b3055e

Browse files
authored
v1.5.3 using built-in ESP32 MAC Address
#### Releases v1.5.3 1. Using `built-in ESP32 MAC Address` 2. Increase default `SPI_CLOCK_MHZ` clock to 20MHz from 8MHz
1 parent 14ed082 commit 7b3055e

32 files changed

+288
-131
lines changed

.codespellrc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# See: https://github.com/codespell-project/codespell#using-a-config-file
2+
[codespell]
3+
# In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here:
4+
ignore-words-list = ,
5+
check-filenames =
6+
check-hidden =
7+
skip = ./.git,./src,./examples,./Packages_Patches,./LibraryPatches

CONTRIBUTING.md

+11-4
Original file line numberDiff line numberDiff line change
@@ -10,27 +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_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
18-
* Board Core Version (e.g. ESP32 core v2.0.5)
20+
* Board type (e.g. ESP32_DEV)
21+
* Board Core Version (e.g. ESP32 core v2.0.6)
1922
* Contextual information (e.g. what you were trying to achieve)
2023
* Simplest possible steps to reproduce
2124
* Anything that might be relevant in your opinion, such as:
2225
* Operating system (Windows, Ubuntu, etc.) and the output of `uname -a`
2326
* Network configuration
2427

2528

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+
---
32+
2633
### Example
2734

2835
```
2936
Arduino IDE version: 1.8.19
30-
WT32_ETH01 board
31-
ESP32 core v2.0.5
37+
ESP32_DEV board
38+
ESP32 core v2.0.6
3239
OS: Ubuntu 20.04 LTS
33-
Linux xy-Inspiron-3593 5.15.0-53-generic #59~20.04.1-Ubuntu SMP Thu Oct 20 15:10:22 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
3441
3542
Context:
3643
I encountered a crash while using this library

changelog.md

+7
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,27 @@
88
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Donate to my libraries using BuyMeACoffee" style="height: 50px !important;width: 181px !important;" ></a>
99
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://img.shields.io/badge/buy%20me%20a%20coffee-donate-orange.svg?logo=buy-me-a-coffee&logoColor=FFDD00" style="height: 20px !important;width: 200px !important;" ></a>
1010

11+
1112
---
1213
---
1314

1415
## Table of Contents
1516

1617

1718
* [Changelog](#changelog)
19+
* [Releases v1.5.3](#releases-v153)
1820
* [Releases v1.5.1](#releases-v151)
1921

2022
---
2123
---
2224

2325
## Changelog
2426

27+
#### Releases v1.5.3
28+
29+
1. Using `built-in ESP32 MAC Address`
30+
2. Increase default `SPI_CLOCK_MHZ` clock to 20MHz from 8MHz
31+
2532
#### Releases v1.5.1
2633

2734
1. Initial coding to support ESP32 boards using ENC28J60 LwIP Ethernet. Sync with [WebServer_WT32_ETH01 v1.5.1](https://github.com/khoih-prog/WebServer_WT32_ETH01)

examples/AdvancedWebServer/AdvancedWebServer.ino

+6-8
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
//////////////////////////////////////////////////////////
5151

5252
// Optional values to override default settings
53-
//#define SPI_HOST 1
54-
//#define SPI_CLOCK_MHZ 8
53+
//#define ETH_SPI_HOST SPI3_HOST
54+
//#define SPI_CLOCK_MHZ 20
5555

5656
// Must connect INT to GPIOxx or not working
5757
//#define INT_GPIO 4
@@ -208,16 +208,14 @@ void setup()
208208

209209
// start the ethernet connection and the server:
210210
// Use DHCP dynamic IP and random mac
211-
uint16_t index = millis() % NUMBER_OF_MAC;
212-
213211
//bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ,
214-
// int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac);
215-
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST );
216-
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST, mac[index] );
212+
// int SPI_HOST, uint8_t *W6100_Mac = W6100_Default_Mac);
213+
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
214+
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[millis() % NUMBER_OF_MAC] );
217215

218216
// Static IP, leave without this line to get IP via DHCP
219217
//bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = 0, IPAddress dns2 = 0);
220-
ETH.config(myIP, myGW, mySN, myDNS);
218+
//ETH.config(myIP, myGW, mySN, myDNS);
221219

222220
ESP32_ENC_waitForConnect();
223221

examples/HelloServer/HelloServer.ino

+5-7
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 SPI3_HOST
26+
//#define SPI_CLOCK_MHZ 20
2727

2828
// Must connect INT to GPIOxx or not working
2929
//#define INT_GPIO 4
@@ -131,12 +131,10 @@ void setup()
131131

132132
// start the ethernet connection and the server:
133133
// Use DHCP dynamic IP and random mac
134-
uint16_t index = millis() % NUMBER_OF_MAC;
135-
136134
//bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ,
137-
// int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac);
138-
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST );
139-
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST, mac[index] );
135+
// int SPI_HOST, uint8_t *W6100_Mac = W6100_Default_Mac);
136+
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
137+
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[millis() % NUMBER_OF_MAC] );
140138

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

examples/HelloServer2/HelloServer2.ino

+5-7
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 SPI3_HOST
26+
//#define SPI_CLOCK_MHZ 20
2727

2828
// Must connect INT to GPIOxx or not working
2929
//#define INT_GPIO 4
@@ -131,12 +131,10 @@ void setup()
131131

132132
// start the ethernet connection and the server:
133133
// Use DHCP dynamic IP and random mac
134-
uint16_t index = millis() % NUMBER_OF_MAC;
135-
136134
//bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ,
137-
// int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac);
138-
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST );
139-
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST, mac[index] );
135+
// int SPI_HOST, uint8_t *W6100_Mac = W6100_Default_Mac);
136+
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
137+
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[millis() % NUMBER_OF_MAC] );
140138

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

examples/HttpBasicAuth/HttpBasicAuth.ino

+5-7
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 SPI3_HOST
26+
//#define SPI_CLOCK_MHZ 20
2727

2828
// Must connect INT to GPIOxx or not working
2929
//#define INT_GPIO 4
@@ -105,12 +105,10 @@ void setup()
105105

106106
// start the ethernet connection and the server:
107107
// Use DHCP dynamic IP and random mac
108-
uint16_t index = millis() % NUMBER_OF_MAC;
109-
110108
//bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ,
111-
// int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac);
112-
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST );
113-
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST, mac[index] );
109+
// int SPI_HOST, uint8_t *W6100_Mac = W6100_Default_Mac);
110+
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
111+
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[millis() % NUMBER_OF_MAC] );
114112

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

examples/MQTTClient_Auth/MQTTClient_Auth.ino

+5-7
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 SPI3_HOST
39+
//#define SPI_CLOCK_MHZ 20
4040

4141
// Must connect INT to GPIOxx or not working
4242
//#define INT_GPIO 4
@@ -188,12 +188,10 @@ void setup()
188188

189189
// start the ethernet connection and the server:
190190
// Use DHCP dynamic IP and random mac
191-
uint16_t index = millis() % NUMBER_OF_MAC;
192-
193191
//bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ,
194-
// int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac);
195-
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST );
196-
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST, mac[index] );
192+
// int SPI_HOST, uint8_t *W6100_Mac = W6100_Default_Mac);
193+
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
194+
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[millis() % NUMBER_OF_MAC] );
197195

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

examples/MQTTClient_Basic/MQTTClient_Basic.ino

+5-6
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 SPI3_HOST
40+
//#define SPI_CLOCK_MHZ 20
4141

4242
// Must connect INT to GPIOxx or not working
4343
//#define INT_GPIO 4
@@ -189,11 +189,10 @@ void setup()
189189

190190
// start the ethernet connection and the server:
191191
// Use DHCP dynamic IP and random mac
192-
uint16_t index = millis() % NUMBER_OF_MAC;
193-
194192
//bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ,
195-
// int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac);
196-
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST );
193+
// int SPI_HOST, uint8_t *W6100_Mac = W6100_Default_Mac);
194+
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
195+
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[millis() % NUMBER_OF_MAC] );
197196
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST, mac[index] );
198197

199198
// Static IP, leave without this line to get IP via DHCP

examples/MQTT_ThingStream/MQTT_ThingStream.ino

+5-7
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 SPI3_HOST
42+
//#define SPI_CLOCK_MHZ 20
4343

4444
// Must connect INT to GPIOxx or not working
4545
//#define INT_GPIO 4
@@ -234,12 +234,10 @@ void setup()
234234

235235
// start the ethernet connection and the server:
236236
// Use DHCP dynamic IP and random mac
237-
uint16_t index = millis() % NUMBER_OF_MAC;
238-
239237
//bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ,
240-
// int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac);
241-
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST );
242-
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST, mac[index] );
238+
// int SPI_HOST, uint8_t *W6100_Mac = W6100_Default_Mac);
239+
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
240+
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[millis() % NUMBER_OF_MAC] );
243241

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

examples/PostServer/PostServer.ino

+5-7
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 SPI3_HOST
26+
//#define SPI_CLOCK_MHZ 20
2727

2828
// Must connect INT to GPIOxx or not working
2929
//#define INT_GPIO 4
@@ -180,12 +180,10 @@ void setup()
180180

181181
// start the ethernet connection and the server:
182182
// Use DHCP dynamic IP and random mac
183-
uint16_t index = millis() % NUMBER_OF_MAC;
184-
185183
//bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ,
186-
// int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac);
187-
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST );
188-
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST, mac[index] );
184+
// int SPI_HOST, uint8_t *W6100_Mac = W6100_Default_Mac);
185+
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
186+
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[millis() % NUMBER_OF_MAC] );
189187

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

examples/SimpleAuthentication/SimpleAuthentication.ino

+5-7
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 SPI3_HOST
26+
//#define SPI_CLOCK_MHZ 20
2727

2828
// Must connect INT to GPIOxx or not working
2929
//#define INT_GPIO 4
@@ -224,12 +224,10 @@ void setup()
224224

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

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

examples/UdpNTPClient/UdpNTPClient.ino

+5-7
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 SPI3_HOST
31+
//#define SPI_CLOCK_MHZ 20
3232

3333
// Must connect INT to GPIOxx or not working
3434
//#define INT_GPIO 4
@@ -142,12 +142,10 @@ void setup()
142142

143143
// start the ethernet connection and the server:
144144
// Use DHCP dynamic IP and random mac
145-
uint16_t index = millis() % NUMBER_OF_MAC;
146-
147145
//bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ,
148-
// int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac);
149-
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST );
150-
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST, mac[index] );
146+
// int SPI_HOST, uint8_t *W6100_Mac = W6100_Default_Mac);
147+
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
148+
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[millis() % NUMBER_OF_MAC] );
151149

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

examples/UdpSendReceive/UdpSendReceive.ino

+5-7
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 SPI3_HOST
26+
//#define SPI_CLOCK_MHZ 20
2727

2828
// Must connect INT to GPIOxx or not working
2929
//#define INT_GPIO 4
@@ -138,12 +138,10 @@ void setup()
138138

139139
// start the ethernet connection and the server:
140140
// Use DHCP dynamic IP and random mac
141-
uint16_t index = millis() % NUMBER_OF_MAC;
142-
143141
//bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ,
144-
// int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac);
145-
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST );
146-
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST, mac[index] );
142+
// int SPI_HOST, uint8_t *W6100_Mac = W6100_Default_Mac);
143+
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
144+
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[millis() % NUMBER_OF_MAC] );
147145

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

0 commit comments

Comments
 (0)