-->
Page 1 of 3

extra mDNS services in combination with ArduinoOTA?

PostPosted: Sun Jun 26, 2016 2:22 pm
by Stu
Hi,

I'm using ArduinoOTA, and I notice that I am not able to start a mDNS service. I am thinking it is because the ArduinoOTA is also using a mDNS service ("esp8266-deviceID.local:8266").

Question here is, how can I use that mDNS service to add my own services? I like to make my Telnet server on my esp available via the easy mDNS hostname also.

Thanks!

Re: extra mDNS services in combination with ArduinoOTA?

PostPosted: Sun Jun 26, 2016 2:33 pm
by martinayotte
Simply don't instantiate any mDNS service in your sketch, but still include the header file.
Then, in your setup() add "MDNS.addService("telnet", "tcp", 23);" after the ArduinoOTA.begin();

Re: extra mDNS services in combination with ArduinoOTA?

PostPosted: Mon Jun 27, 2016 2:18 pm
by Stu
Ah, wow that easy. Didn't expect the MDNS object from ArduinoOTA to be available. And yes, that works .. sort of..
Technically it works, only somehow adding mDNS services is not actually working. The service doesn't show up in my Bonjour browser (the OTA service is shown). And connecting to it using telnet doesn't work.

I noticed that ArduinoOTA doesn't use the .addService method, but binds to MDNS in a way that I don't fully comprehend.. :?

I should really be digging deeper into mDNS here, I feel I'm just bearly scratching the surface.. Just of the bat, any pointers anyone?

Re: extra mDNS services in combination with ArduinoOTA?

PostPosted: Mon Jun 27, 2016 4:51 pm
by martinayotte
I don't know why it is not working for you, maybe it is a bug related only with Bonjour, on Linux using Avahi, the Telnet service is shown :

Code: Select all+   eth0 IPv4 MyESPAP-0B612D                                _arduino._tcp        local
+   eth0 IPv4 MyESPAP-0B612D                                Web Site             local
+   eth0 IPv4 MyESPAP-0B612D                                Telnet Remote Terminal local


As you can see, the OTA, HTTPServer and Telnet are present.

BTW, even if your didn't have added the MDNS.addService() for Telnet, you should be able to connect to it since the name resolution is already done. So, maybe your TCP Telnet server code is not working, or you don't have such code at all (simply adding the service in mDNS doesn't give you the service, but only advertising it).