Skip to content
This repository has been archived by the owner on Dec 29, 2019. It is now read-only.

WiFi connection required for discovery? #19

Open
danielrearden opened this issue Nov 29, 2016 · 9 comments
Open

WiFi connection required for discovery? #19

danielrearden opened this issue Nov 29, 2016 · 9 comments

Comments

@danielrearden
Copy link

I created a simple app using the code in the readme to try out the library. It works great and I'm able to send messages between my two devices. However, I noticed the service discovery only works when the host device is connected to a WiFi network.

It doesn't matter if the client device is connected to the same network, a different one, or not at all. However, when the host device isn't connected to some network, it's not discoverable by the client device (even though WiFi is still turned on!). In either case, I receive a "successfully created service" message but it's like the host is not advertising the service unless it's connected to an existing WiFi network.

I have not used WiFi Direct outside of this library, so I'm not sure what the expected behavior is but I thought the API is supposed to allow devices to connect even without an access point.

Any advice on this would be greatly appreciated!

@relevante
Copy link

I ended up not using Salut, but I've just encountered this in my own WifiP2p implementation. It seems to only affect some devices. The Nexus 4 works without being connected to WiFi, but the Galaxy S5 I'm using seems to require a WiFi connection to properly establish a group. The interesting thing is that the other device will still connect to it, but it can never get a groupOwnerAddress unless the S5 is on a WiFi network.

@neatorobito
Copy link
Owner

neatorobito commented Jan 18, 2017 via email

@relevante
Copy link

Thanks! That seems to fix it.

@neatorobito
Copy link
Owner

neatorobito commented Jan 18, 2017 via email

@relevante
Copy link

I'm just connecting to a device that I get in the WIFI_P2P_PEERS_CHANGED_ACTION intent after starting peer discovery. It seems that a group is created automatically though, as I'm getting its info and removing it to disconnect. But somehow me not explicitly creating it in advance appears to have fixed the initial problem. I'm not 100% sure as there's a enough flakiness in the overall system that it's hard to be completely certain, but it seems to be working well now, at least on these phones.

@neatorobito
Copy link
Owner

neatorobito commented Jan 18, 2017 via email

@relevante
Copy link

Sure thing, I'll let you know if anything becomes clearer as I proceed.

@ManasviniGanesh
Copy link

ManasviniGanesh commented Apr 24, 2017

The log says I successfully received a message, but the message is not being parsed. Used every code the way you described. yet no remedy.
onDataReceived(Object o) {} is never getting executed !

@abselt
Copy link

abselt commented Apr 25, 2017

@ManasviniGanesh for me, sometimes it works sometime no... have you found a solution please?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants