Skip to content

Commit 83b386d

Browse files
committed
0.8.135
* translated `/system` #1717 * added default pin seetings for opendtufusion board * fixed ethernet static IP * fixed ethernet MAC address read back
1 parent d7007b3 commit 83b386d

File tree

5 files changed

+26
-18
lines changed

5 files changed

+26
-18
lines changed

src/CHANGES.md

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## 0.8.135 - 2024-08-11
44
* translated `/system` #1717
5+
* added default pin seetings for opendtufusion board
6+
* fixed ethernet static IP
7+
* fixed ethernet MAC address read back
58

69
## 0.8.134 - 2024-08-10
710
* combined Ethernet and WiFi variants - Ethernet is now always included, but needs to be enabled if needed

src/network/AhoyEthernet.h

+9-8
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class AhoyEthernet : public AhoyWifi {
2222
};
2323

2424
public:
25-
void begin() override {
25+
virtual void begin() override {
2626
mMode = Mode::WIRELESS;
2727
mAp.enable();
2828
AhoyWifi::begin();
@@ -34,31 +34,32 @@ class AhoyEthernet : public AhoyWifi {
3434
ETH.setHostname(mConfig->sys.deviceName);
3535
}
3636

37-
String getIp(void) {
37+
virtual String getIp(void) override {
3838
if(Mode::WIRELESS == mMode)
3939
return AhoyWifi::getIp();
4040
else
4141
return ETH.localIP().toString();
4242
}
4343

44-
String getMac(void) {
44+
virtual String getMac(void) override {
4545
if(Mode::WIRELESS == mMode)
4646
return AhoyWifi::getMac();
4747
else
48-
return ETH.macAddress();
48+
return mEthSpi.macAddress();
4949
}
5050

51-
bool isWiredConnection() {
51+
virtual bool isWiredConnection() override {
5252
return (Mode::WIRED == mMode);
5353
}
5454

5555
private:
56-
void OnEvent(WiFiEvent_t event) {
56+
virtual void OnEvent(WiFiEvent_t event) override {
5757
switch(event) {
58+
case ARDUINO_EVENT_ETH_CONNECTED:
59+
mMode = Mode::WIRED; // needed for static IP
60+
[[fallthrough]];
5861
case SYSTEM_EVENT_STA_CONNECTED:
5962
mWifiConnecting = false;
60-
[[fallthrough]];
61-
case ARDUINO_EVENT_ETH_CONNECTED:
6263
if(NetworkState::CONNECTED != mStatus) {
6364
if(ARDUINO_EVENT_ETH_CONNECTED == event)
6465
WiFi.disconnect();

src/network/AhoyEthernetSpi.h

+7-3
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,14 @@ class AhoyEthernetSpi {
116116
}
117117

118118
String macAddress() {
119-
uint8_t mac_addr[6] = {0, 0, 0, 0, 0, 0};
119+
uint8_t mac_addr[6];
120120
esp_eth_ioctl(eth_handle, ETH_CMD_G_MAC_ADDR, mac_addr);
121-
char mac_addr_str[24];
122-
snprintf(mac_addr_str, sizeof(mac_addr_str), "%02X:%02X:%02X:%02X:%02X:%02X", mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]);
121+
char mac_addr_str[19];
122+
for(uint8_t i = 0; i < 6; i++) {
123+
snprintf(&mac_addr_str[i*3], sizeof(mac_addr_str), "%02X", mac_addr[i]);
124+
mac_addr_str[i*3+2] = ':';
125+
}
126+
mac_addr_str[17] = '\0';
123127
return String(mac_addr_str);
124128
}
125129

src/network/AhoyWifiEsp32.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ class AhoyWifi : public AhoyNetwork {
4141
mAp.tickLoop();
4242
}
4343

44-
String getIp(void) override {
44+
virtual String getIp(void) override {
4545
return WiFi.localIP().toString();
4646
}
4747

48-
String getMac(void) override {
48+
virtual String getMac(void) override {
4949
return WiFi.macAddress();
5050
}
5151

src/web/html/setup.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -457,11 +457,11 @@
457457
[1, "GPIO1"],
458458
[2, "GPIO2"],
459459
[3, "GPIO3"],
460-
[4, "GPIO4"],
461-
[5, "GPIO5"],
462-
[6, "GPIO6"],
460+
[4, "GPIO4 (CMT CSB)"],
461+
[5, "GPIO5 (CMT SDIO)"],
462+
[6, "GPIO6 (CMT SCLK)"],
463463
[7, "GPIO7"],
464-
[8, "GPIO8"],
464+
[8, "GPIO8 (CMT GPIO3)"],
465465
[9, "GPIO9 (DATA display)"],
466466
[10, "GPIO10 (SCK display)"],
467467
[11, "GPIO11 (CS display)"],
@@ -474,7 +474,7 @@
474474
[18, "GPIO18"],
475475
[19, "GPIO19 ({#PIN_DONT_USE} - USB-)"],
476476
[20, "GPIO20 ({#PIN_DONT_USE} - USB+)"],
477-
[21, "GPIO21"],
477+
[21, "GPIO21 (CMT FCSB)"],
478478
[26, "GPIO26 (PSRAM - {#PIN_NOT_AVAIL})"],
479479
[27, "GPIO27 (FLASH - {#PIN_NOT_AVAIL})"],
480480
[28, "GPIO28 (FLASH - {#PIN_NOT_AVAIL})"],

0 commit comments

Comments
 (0)