Hi!
In order to make two Photons in the same local WiFi to connect I concluded that there is no other way than TCP or UDP connection (no WiFi direct yet Sample Code for Connecting 2 Photons (Wifi Direct)). At the same time I would like to have it dynamic i.e I do not want to hardcode any static IP since different WiFi networks can have different setups and it may result in a conflict.
-
I found mDNS solution https://github.com/mrhornsby/spark-core-mdns which works fine, I can ping the device and make a request at the ports 80 and 8080 using defined URL.
-
I wanted to integrate same functionality to another Photon using TCPClient (Thanks for the ideas from the threads TCPServer() usage and bandwidth issue and Sending large data off Photon using TCPClient). The problem I stumbled upon is that the API from TCPClient
virtual int connect(const char *host, uint16_t port, network_interface_t=0);
Cannot succeed to connect when using URL (connect() returns -4). When I use the manual IP address it connects fine
virtual int connect(IPAddress ip, uint16_t port, network_interface_t=0);
Is it possible at all using URL to connect to another Photon which is running the self-assembled mDNS? Should I need to implement some kind of address resolving inside the code or trigger some DNS cache functionality?