ArduinoMDNS ResolvingHostNames Example on EdgeBox-ESP-100 Guru Mediation Error

I am trying to run the ResolvingHostNames example from the ArduinoMDNS library on the EdgeBox-ESP-100. I am using the boilerplate example code (with my MAC address). The ethernet connection is successful. However, I get a Guru mediation error after entering the hostname to resolve. Here is the serial output. I decoded the Backtrace via the ESP Exception Decoder, which is also given below. Thanks in advance for any help with this issue.

ETH: Local IP is 192.168.0.66
Enter a mDNS host name via the Arduino Serial Monitor to have it resolved.
Do not postfix the name with “.local”
Resolving 'mark-dev-pi
’ via Multicast DNS (Bonjour)…
Guru Meditation Error: Core 1 panic’ed (LoadProhibited). Exception was unhandled.

Core 1 register dump:
PC : 0x42004f34 PS : 0x00060830 A0 : 0x82003cb2 A1 : 0x3fcebbf0
A2 : 0x3fcebc18 A3 : 0x00000000 A4 : 0x3fc951fc A5 : 0x00000000
A6 : 0x3fcec3b4 A7 : 0x00000000 A8 : 0x3c0302ec A9 : 0x0000002e
A10 : 0x3fcecaab A11 : 0x3fcecab2 A12 : 0x000000ff A13 : 0x0000ff00
A14 : 0x00ff0000 A15 : 0xff000000 SAR : 0x00000016 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000 LBEG : 0x400556d5 LEND : 0x400556e5 LCOUNT : 0xfffffffb

Backtrace: 0x42004f31:0x3fcebbf0 0x42003caf:0x3fcebc10 0x420048ad:0x3fcebc40 0x4200197f:0x3fcebc80 0x42006845:0x3fcebeb0

ESP Exception Decoder
Sketch: EdgeBox_ESP_100_ResolvingHostNames FQBN: esp32:esp32:Edgebox-ESP-100

Backtrace: 0x42004f31:0x3fcebbf0 0x42003caf:0x3fcebc10 0x420048ad:0x3fcebc40 0x4200197f:0x3fcebc80 0x42006845:0x3fcebeb0

Decoding stack results
0x42004f31: is in IPAddress::IPAddress(unsigned char const*) (C:\Users\MarkWest\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\cores\esp32/Printable.h:33).
0x42003caf: is in MDNS::_finishedResolvingName(char*, unsigned char const*) (c:\Users\MarkWest\OneDrive - Sonnys Direct\Documents\Arduino\libraries\ArduinoMDNS\MDNS.cpp:1429).
0x420048ad: MDNS::run() at c:\Users\MarkWest\OneDrive - Sonnys Direct\Documents\Arduino\libraries\ArduinoMDNS\MDNS.cpp:1071
0x4200197f: loop() at C:\Temp\EdgeBox_ESP_100_ResolvingHostNames\EdgeBox_ESP_100_ResolvingHostNames.ino:91
0x42006845: loopTask(void*) at C:\Users\MarkWest\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\cores\esp32\main.cpp:50

Paste exception to decode…

Hi there,
Can you try changing the host name to “mark” I don’t think it likes the “-”'s
HTH
GL :slight_smile: PJ

@PJ_Glasso I removed the dashes from my hostname. Still getting the Guru Mediation Error. However, the system reboots, which it didn’t do before. Here is my serial output.

ETH: Local IP is 192.168.0.66
Enter a mDNS host name via the Arduino Serial Monitor to have it resolved.
Do not postfix the name with “.local”
Resolving 'markdevpi
’ via Multicast DNS (Bonjour)…
Guru Meditation Error: Core 1 panic’ed (LoadProhibited). Exception was unhandled.

Core 1 register dump:
PC : 0x42004f34 PS : 0x00060830 A0 : 0x82003cb2 A1 : 0x3fcebbf0
A2 : 0x3fcebc18 A3 : 0x00000000 A4 : 0x3fc951fc A5 : 0x00000000
A6 : 0x3fcec3b4 A7 : 0x00000000 A8 : 0x3c0302ec A9 : 0x0000002e
A10 : 0x3fcecaa9 A11 : 0x3fcecab0 A12 : 0x000000ff A13 : 0x0000ff00
A14 : 0x00ff0000 A15 : 0xff000000 SAR : 0x00000016 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000 LBEG : 0x400556d5 LEND : 0x400556e5 LCOUNT : 0xfffffffb

Backtrace: 0x42004f31:0x3fcebbf0 0x42003caf:0x3fcebc10 0x420048ad:0x3fcebc40 0x4200197f:0x3fcebc80 0x42006845:0x3fcebeb0

ELF file SHA256: 33e69648250ed1e2

Rebooting…
�R~��gBETH: Local IP is 192.168.0.66
Enter a mDNS host name via the Arduino Serial Monitor to have it resolved.
Do not postfix the name with “.local”

Regards, Mark

Hi there,
Ok , you’re getting closer , time to see the code your sending.
Post it using the </> tags above.
I suspect a Lib is the issue.
HTH
GL :slight_smile: PJ :v:

@PJ_Glasso Here you go. Thanks.

#include <SPI.h>
#include <Ethernet.h>
#include <EthernetUdp.h>
#include <ArduinoMDNS.h>

EthernetUDP udp;
MDNS mdns(udp);

void nameFound(const char* name, IPAddress ip);

void setup() {
  uint8_t mac[6];
  esp_read_mac(mac, ESP_MAC_WIFI_STA);
  Ethernet.begin(mac);

  // Initialize the mDNS library. You can now reach or ping this
  // Arduino via the host name "arduino.local", provided that your operating
  // system is mDNS/Bonjour-enabled (such as macOS).
  // Always call this before any other method!
  mdns.begin(Ethernet.localIP(), "arduino");

  // We specify the function that the mDNS library will call when it
  // resolves a host name. In this case, we will call the function named
  // "nameFound".
  mdns.setNameResolvedCallback(nameFound);

  Serial.begin(9600);
  Serial.print("ETH: Local IP is ");
  Serial.println(Ethernet.localIP());
  Serial.println("Enter a mDNS host name via the Arduino Serial Monitor to "
                 "have it resolved.");
  Serial.println("Do not postfix the name with \".local\"");
}

void loop() {
  char hostName[512];
  int length = 0;

  // read in a host name from the Arduino IDE's Serial Monitor.
  while (Serial.available()) {
    hostName[length] = Serial.read();
    length = (length + 1) % 512;
    delay(5);
  }
  hostName[length] = '\0';

  // You can use the "isResolvingName()" function to find out whether the
  // mDNS library is currently resolving a host name.
  // If so, we skip this input, since we want our previous request to continue.
  if (!mdns.isResolvingName()) {
    if (length > 0) {
      Serial.print("Resolving '");
      Serial.print(hostName);
      Serial.println("' via Multicast DNS (Bonjour)...");

      // Now we tell the mDNS library to resolve the host name. We give it a
      // timeout of 5 seconds (e.g. 5000 milliseconds) to find an answer. The
      // library will automatically resend the query every second until it
      // either receives an answer or your timeout is reached - In either case,
      // the callback function you specified in setup() will be called.

      mdns.resolveName(hostName, 5000);
    }
  }

  // This actually runs the mDNS module. YOU HAVE TO CALL THIS PERIODICALLY,
  // OR NOTHING WILL WORK! Preferably, call it once per loop().
  mdns.run();
}

// This function is called when a name is resolved via mDNS/Bonjour. We set
// this up in the setup() function above. The name you give to this callback
// function does not matter at all, but it must take exactly these arguments
// (a const char*, which is the hostName you wanted resolved, and a const
// byte[4], which contains the IP address of the host on success, or NULL if
// the name resolution timed out).
void nameFound(const char* name, IPAddress ip) {
  if (ip != INADDR_NONE) {
    Serial.print("The IP address for '");
    Serial.print(name);
    Serial.print("' is ");
    Serial.println(ip);
  } else {
    Serial.print("Resolving '");
    Serial.print(name);
    Serial.println("' timed out.");
  }
}

Hi there,
AT first Glance, Can you comment this out or move it to the setup, You are running out of memory fast, with buffers that size, try smaller too.

HTH
GL :slight_smile: PJ :v:

@PJ_Glasso That worked! I hard-coded the hostname to that of my pi.

1 Like