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

On Android, fails to connect to peer over offline Wifi #829

Closed
rjcorwin opened this issue Jul 23, 2017 · 11 comments
Closed

On Android, fails to connect to peer over offline Wifi #829

rjcorwin opened this issue Jul 23, 2017 · 11 comments

Comments

@rjcorwin
Copy link

rjcorwin commented Jul 23, 2017

Setup

I'm currently running Dat v13.7.0 on two Macs (masOS 10.12.3 and 10.12.5) with node v8.1.3 on both and one Nexus 5x (Android 7.1.2) running Termux (v0.53) which I installed Node v6.11.1 into (see https://medium.freecodecamp.org/building-a-node-js-application-on-android-part-1-termux-vim-and-node-js-dfa90c28958f) and Dat v13.7.0 (the usual npm install -g dat). Lastly, I have a two routers set up, one with an Internet connection and one without.

Reproduce it

When the three devices are connected to the router that has an Internet connection, doing dat share, dat clone, dat sync back and forth between all the devices everything works as expected. When using the router without Internet and doing a dat share/dat clone between the two Macs, it takes a while to resolve but eventually everything works as expected. 👍

However while still on the offline router, when trying to dat share from the Android and then dat clone from one of the Macs or the other way around, the device trying to clone gets stuck on "Connecting to dat network...". The funny thing is I see on the sharing device that "connections" count is increasing as expected, bet then it drops, and then comes back up, over and over without files being transferred.

@rjcorwin
Copy link
Author

I'm hoping this bug doesn't have to do with Android's rocky past with mDNS and more to do with an issue with the Termux environment that can more readily be resolved.

@joehand
Copy link
Collaborator

joehand commented Jul 24, 2017

May be related to the native modules missing on Android. Mafintosh is getting those built, so we can try again once those are working.

We should also add an --offline or --local option to only use local connections. That will make it easier to debug this as well.

@ralphtheninja
Copy link
Contributor

@rjsteinert Maybe try doing DEBUG=dat* dat share etc on all your devices for more information?

@joehand
Copy link
Collaborator

joehand commented Jul 24, 2017

@rjsteinert Maybe try doing DEBUG=dat* dat share etc on all your devices for more information?

👍

Also, DEBUG=discovery* will give all discovery info which is pretty verbose. You can also do just dns by setting it to DEBUG=dns-discovery.

@okdistribute
Copy link
Collaborator

Yeah maybe itd be great to have an option on the cli for which connections to use:

Default would be something like
--discovery=dns,local,dht
also supporting
--discovery=local

@rjcorwin
Copy link
Author

@ralphtheninja @joehand @Karissa Thanks sooooo much! I'll have to wait to give it a try this weekend as I'm heads down working on deadline. It's an app we'll be distributing to Android devices via dat! This issue in particular is important for our use case of distributing the app to the thousands of devices we have offline in Africa.

@rjcorwin
Copy link
Author

@mafintosh If you have builds of Dat for Android you'd like me to test this weekend, this is a great place to get my attention on that matter.

@rjcorwin
Copy link
Author

@mafintosh If it helps, termux has some scripts to help with publishing a termux package.

@rjcorwin
Copy link
Author

Hi folks, another test with a different build of node and Android using Bunsen Browser failed. It's the same device and same Wifi network so it could still be me? Either way, I created an issue over in the Bunsen Browser issue queue with a list of my theoretical issues that I'll also share here.

Possible culprits:

  • Something about various builds of nodejs for Android we have tried is somehow broken.
  • Something about our prebuilt version of Dat on Android is broken.
  • Something in the Dat code is doing something bad when offline on Android.
    • Could be something about Android's mDNS support is tripping up Dat's discovery mechanism. Yet, Mac peers do see Android trying to connect, something about Android not able to receive responses?
  • Something fishy about the Wifi we've tested on.
  • Evil cats.

@rjcorwin
Copy link
Author

Related issue in Bunsen Browser issue queue: bunsenbrowser/bunsen#27

@rjcorwin rjcorwin changed the title Stuck on "Connecting to dat network..." when Mac connecting through offline LAN to Android On Android, fails to connect to peer over offline Wifi Aug 25, 2017
@joehand joehand added Backlog and removed Backlog labels Nov 13, 2017
@okdistribute
Copy link
Collaborator

See if this is still an issue on node 12 with the latest dat.

Also, see https://github.com/JaneaSystems/nodejs-mobile-react-native

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

No branches or pull requests

4 participants