Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't resolve hostname. #19

Open
playaspec opened this issue Aug 23, 2021 · 0 comments
Open

Can't resolve hostname. #19

playaspec opened this issue Aug 23, 2021 · 0 comments

Comments

@playaspec
Copy link

playaspec commented Aug 23, 2021

First off, thanks for writing such a great library. I looked around at everything out there, and this one is by far the most complete.

I'm working on a power logger that simultaneously reads two 12-bit ADCs at a time, applies true RMS to the stream of data, and sends it to a host over OSC. I'm using the Teensy4's NativeEthernet lib. I renamed NativeEthernet's mDNS class to avoid any namespace conflicts. I updated the includes in the .cpp and the example sketch to point to the NativeEthernet* libs, and it builds fine.

Announcement works with no further modification, however, name lookups fail. I suspect it's in part to the NativeEthernet library using the Arduino's IPAddress.h which defines a class which holds an IP address, rather than the four byte[4] array.

Here's what I've done for testing so far. I'm running a Linux/Ubuntu 20.04 desktop, avahi-daemon 0.7, Arduino 1.8.15. The Teensy4 is attached directly to the second ethernet port. I'm running dnsmasq as a DHCP and DNS server, logs tailed in console. Wireshark capturing traffic for that interface.

Running the stock ResolvingHostNames sketch, I can see the mDNS query go out, and the response come back from the Linux box. I did some tracing, and verified that the response packet is indeed being grocked by _processMDNSQuery(), however when it calls _finishedResolvingName(), for whatever reason, the IP it returns is NULL, and the demo sketch claims resolution has timed out. It does this for every response (as if it's trying to report the address it was sent in each reply), not just when the timeout expires.

The interface the Teensy is attached to only has one IPv4 address, no IPv6. I did eliminate one bug which may or may not make a difference. The Arduino IDE's serial console defaults to sending a linefeed (NL) even when you click the 'send' button. This character gets sent in the mDNS query, which is visible in Wireshark as remotehost\n.local. I added a simple fix, which I'll send along as a patch in a little bit.

Lastly, I intend to eventually call .run() from a thread using the TeensyThreads library. Are there any parts of this code I have to worry about thread safety? Thanks for taking a look!

per1234 added a commit to per1234/ArduinoMDNS that referenced this issue Nov 9, 2023
…t/github_actions/carlosperate/download-file-action-2

Bump carlosperate/download-file-action from 1 to 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant