using namespace qindesign::network;
/* ETHERNET CHANNELS AND BUFFERS */
uint8_t St = 0;
while (Ethernet.begin(MyMAC) == 0) {
if (millis() - TimeIt > 10000) { // Ten seconds to get a DHCP served address
if (TeensyDebug) {
Serial.println("Failed to configure Ethernet using DHCP");
Serial.print("link Status: "); Serial.println(Ethernet.linkStatus());
Serial.print("hardware Status: "); Serial.println(Ethernet.hardwareStatus());
Serial.print("socket Status: "); Serial.println(String(Ethernet.socketStatus(St)));
}
getFixedIpAddress();
break;
}
}
DNSClient RadioDNS;
IPAddress RadioIP;
RadioDNS.getHostByName ("hello.wrl", RadioIP, 0);
Use Ethernet.begin(MyIP, MyMask, MyGateway, MyDNS). No need to set your own MAC. The QNEthernet library uses the Teensy’s built-in one.I'm currently using this.
Is it fine?Code:Ethernet.begin(MyMAC, MyIP, MyDNS, MyGateway, MyMask);
Back to the DNS question.
I'm assuming I should declare the DNSClient and call the method:
Code:DNSClient RadioDNS; IPAddress RadioIP; RadioDNS.getHostByName ("hello.wrl", RadioIP, 0);
but I get
error: 'DNSClient' does not name a type; did you mean 'Client'?
60 | DNSClient RadioDNS;
| ^~~~~~~~~
| Client
EthernetRoutines.ino: In function 'void FlexURL()':
error: 'class qindesign::network::EthernetClass' has no member named 'getHostByName'; did you mean 'setHostname'?
65 | Ethernet.getHostByName("hello.wrl", FlexIP, 0);
| ^~~~~~~~~~~~~
| setHostname
Ethernet.hostByName(host, ip)
function that returns a bool indicating success. See the Readme for the library. (https://github.com/ssilverman/QNEthernet)