These are chat archives for esp8266/Arduino

21st
Nov 2016
Holger Lembke
@holgerlembke
Nov 21 2016 12:04
I try to understand the mdns-stuff between arduino-IDE and esps mdns. Arduino IDE uses jmdns.
can this accept mdns multicast messages that esp mdns sends?
Holger Lembke
@holgerlembke
Nov 21 2016 13:13
so far I see my esp sending mdns updates. the arrive at my developement system, but the ide wont show them
Me No Dev
@me-no-dev
Nov 21 2016 13:23
  jmdns is actually quite shitty and the implementation in the IDE is not that great either
dfq this message came like that?
eclipse plugin suffers from the same problem
at some point they all start too many threads and shit -> fan
and you can see your ESP being bombarded with mDNS requests
I was gonna look into it and send a PR, but too much happend since :)
Holger Lembke
@holgerlembke
Nov 21 2016 13:30
I try to understand what they do in the ide. I don't get it. they create timers in their network discovery thing.... why? I would expect a thread with a listener.
Clemens Kirchgatterer
@everslick
Nov 21 2016 13:33
i guess they send mDNS "requests" periodically, to make devices respond from time to time.
Me No Dev
@me-no-dev
Nov 21 2016 13:40
they start timers every so often, which results in multiple threads running and requesting
the thread that get's the result is not the one that the IDE listens to
Holger Lembke
@holgerlembke
Nov 21 2016 13:50
in total it is very confusing. do I have to install Bonjour from Apple? As far as I see: no.
Me No Dev
@me-no-dev
Nov 21 2016 13:51
no, you should not need to
Holger Lembke
@holgerlembke
Nov 21 2016 13:52
so. I never see requests from the IDE to the esp.
I build a small announce-thingy that the esp muticasts its data into the net, but nothing.
Me No Dev
@me-no-dev
Nov 21 2016 13:52
have you tried debugging the IDE
multicast is not what the IDE is looking for
Holger Lembke
@holgerlembke
Nov 21 2016 13:53
yeah. build my onw version and added lots of prints.
Me No Dev
@me-no-dev
Nov 21 2016 13:53
and?
Holger Lembke
@holgerlembke
Nov 21 2016 13:53
nada.
Me No Dev
@me-no-dev
Nov 21 2016 13:53
like the service is not even started?
Holger Lembke
@holgerlembke
Nov 21 2016 13:54
i see that they attach something to the local ip.
and I start chasing red herings, I think. esp uses "local", ide has "local." in it.
Holger Lembke
@holgerlembke
Nov 21 2016 14:07
wireshark shows zero activity from my dev maschine going to 224.*.... shouldnt be there some?
Holger Lembke
@holgerlembke
Nov 21 2016 14:29
ok, as far as I see, there is no outgoing traffic from the ide.
Holger Lembke
@holgerlembke
Nov 21 2016 17:15
looks like it is way more productive to write my own portadd-thingy. a small broadcaster on the esp side and a listener in the arduino ide.... it starts working despite my sad java knowledge.
Holger Lembke
@holgerlembke
Nov 21 2016 19:04
so.
SimpleUDPDiscovery.java creates a basic outline of a working very very simple discovery protocol

all you need to call is

void PostMyself(void) {  IPAddress broadcastIp(WiFi.localIP() | ( ~WiFi.subnetMask()));

  WiFiUDP udp;
  udp.begin(8765);
  udp.beginPacket(broadcastIp, 8531); 
  udp.write("1\nesp8266\n");
  udp.endPacket();
}

from your sketch and your esp shows up in the Arduino IDE.

it is far away from being production ready.
the question is: any chance to get this into the IDE?
opinion?