Code Monkey home page Code Monkey logo

Comments (22)

robert-virkus avatar robert-virkus commented on June 16, 2024 1

The problem occurred after discovery when connecting to the device. I cannot share details about it - the important thing is, that in my case nsd is just working fine on Android 12.

from nsd.

sebastianhaberey avatar sebastianhaberey commented on June 16, 2024

If you are on macOS, try this:

dns-sd -B _http._tcp local

Replace _http._tcp with your own type. You should see the services being discovered on the local network like this:

20:58:48.149  Add        3   1 local.               _http._tcp.          e532c25b-128a-4a75-adbe-9aafc4614280 56360
20:58:48.155  Add        3   1 local.               _http._tcp.          e532c25b-128a-4a75-adbe-9aafc4614280 56361
20:58:59.164  Rmv        1   1 local.               _http._tcp.          e532c25b-128a-4a75-adbe-9aafc4614280 56360
20:58:59.164  Rmv        1   1 local.               _http._tcp.          e532c25b-128a-4a75-adbe-9aafc4614280 56361

Do you see your services (all 10)? Do they appear instantly?

from nsd.

kostadin24 avatar kostadin24 commented on June 16, 2024

I'm on windows :(

from nsd.

sebastianhaberey avatar sebastianhaberey commented on June 16, 2024

The same tool is available for Windows as a small download from Apple. It works fine and it's quite useful - I used it to debug the windows version of the plugin. Unfortunately you need an Apple ID to download it.

from nsd.

kostadin24 avatar kostadin24 commented on June 16, 2024

dns-sd -B _dvl-plcnetapi._tcp local
Browsing for _dvl-plcnetapi._tcp.local
Timestamp A/R Flags if Domain Service Type Instance Name
16:23:40.247 Add 2 18 local. _dvl-plcnetapi._tcp. Magic 2 LAN 1-1 #2
16:23:40.391 Add 3 18 local. _dvl-plcnetapi._tcp. Magic 2 LAN 1-1
16:23:40.392 Add 2 18 local. _dvl-plcnetapi._tcp. Magic 2 LAN 1-1 #3
16:23:40.457 Add 2 18 local. _dvl-plcnetapi._tcp. Magic 2 WiFi 2-1
All 4 devices discovered.


Second attempt:
dns-sd -B _dvl-plcnetapi._tcp local
Browsing for _dvl-plcnetapi._tcp.local
Timestamp A/R Flags if Domain Service Type Instance Name
16:25:48.087 Add 3 18 local. _dvl-plcnetapi._tcp. Magic 2 WiFi 2-1
16:25:48.087 Add 2 18 local. _dvl-plcnetapi._tcp. Magic 2 LAN 1-1 #2
2 of 4 discovered.

One disappear and appear later:
16:26:58.949 Rmv 0 18 local. _dvl-plcnetapi._tcp. Magic 2 LAN 1-1 #2
16:27:36.378 Add 2 18 local. _dvl-plcnetapi._tcp. Magic 2 LAN 1-1 #2

But Magic 2 LAN 1-1 #3 didn't appear.
Same for Magic 2 LAN 1-1

from nsd.

sebastianhaberey avatar sebastianhaberey commented on June 16, 2024

Since you can observe the behavior using the tool, I'd rule out a bug on the discovery side of things. It may be worth to look at the registering / unregistering process. Are your services unregistered unintentionally? For example the app being paused or shut down by the Android OS may have something to do with it.

Does the problem still appear if you keep the app active and in the foreground on all four devices?

from nsd.

sebastianhaberey avatar sebastianhaberey commented on June 16, 2024

Also, why do your services have numbers such as #2 or #3 ? I am asking this because from what I've seen on my machines, I'd expect Android's NsdManager to append numbers in parentheses like Magic 2 LAN 1-1 (2) and Magic 2 LAN 1-1 (3).

from nsd.

kostadin24 avatar kostadin24 commented on June 16, 2024

Hi, I forgot to provide some details.

  1. Flutter app is using plugin to discover services.
  2. Magic 2 xxxx services are on network hardware - powerline devices.
  3. Plugin discover services in 90-95% of cases for Android 9. Rest till 100% are device issues for sure ;)
  4. Plugin discover services in 20-30% of cases for Android 12. Same app, same conditions.

Recent observations:
a) Starting app on Android 12 without Wi-Fi connection and after that I connect to WiFi - nothing discovered. Even added restart => stop/start whole mDNS stuff from scratch, but not helping until not kill and start app. Like mobile device itself stays in broken state until app is not killed.
b) Kill app and start it again - it discover all services. Sometimes for about 5 seconds. Sometimes after 1-2 minutes.

from nsd.

sebastianhaberey avatar sebastianhaberey commented on June 16, 2024

Ah ok that clears it up. And just to be sure - while the plugin on Android 12 only discovers 20-30% of the services, the dns-sd tool would discover 95% (or more) of the services at the same time?

from nsd.

kostadin24 avatar kostadin24 commented on June 16, 2024

At moment they behave same Android 9, 12 and dns-sd -B _dvl-plcnetapi._tcp local
All of them discover small part of services.

from nsd.

sebastianhaberey avatar sebastianhaberey commented on June 16, 2024

If what you're seeing in the plugin discovery is identical to dns-sd discovery, it means the plugin is working fine on the discovery side. And you're saying the plugin isn't involved in registration (because that's done by the Powerline devices), so I'm not sure this is an issue with the plugin.

Or did I misunderstand you somewhere?

from nsd.

kostadin24 avatar kostadin24 commented on June 16, 2024

Reason to start issue was - Android 12 didn't discover them always, but Android 9 with same plugin discovers them always.

from nsd.

sebastianhaberey avatar sebastianhaberey commented on June 16, 2024

But later you're saying "they behave same". So which is it?

from nsd.

kostadin24 avatar kostadin24 commented on June 16, 2024

I see both. Sometimes discovery on Android 12 and Android 9 show same number of devices. But sometimes Android 9 shows all services, but Android 12 only part of devices. Killing app and starting it again helps in half of cases.

In general after several days repeating tests one thing is sure - number of services found in Android 12 is always less than 9.

from nsd.

robert-virkus avatar robert-virkus commented on June 16, 2024

A client reported a similar issue on Android 12 to me. The particular service is disovered fine on my Android 11 and Android 10 test devices, but on Android 12 it is not showing up.

from nsd.

sebastianhaberey avatar sebastianhaberey commented on June 16, 2024

Interesting... I'll try to get my hands on an Android 12 device and see if I can reproduce the issue (unfortunately I'll need a real device since the emulator has an isolated network).

from nsd.

kostadin24 avatar kostadin24 commented on June 16, 2024

There were a lot of such reports earlier when Android 12 was beta only. May be mDNS in this OS version is hmmm 'different'.

from nsd.

robert-virkus avatar robert-virkus commented on June 16, 2024

Digging deeper into my client's problem we found out that nsd is actually working fine in our case. Our Android 12 problem was unrelated to nsd.

from nsd.

kostadin24 avatar kostadin24 commented on June 16, 2024

Any info about this android 12 problems?

from nsd.

sebastianhaberey avatar sebastianhaberey commented on June 16, 2024

@robert-virkus yes, did you find out anything that could help other users?

from nsd.

sebastianhaberey avatar sebastianhaberey commented on June 16, 2024

@kostadin24 just a thought, can you try registering local services manually via dns-sd and see if they are discovered correctly by the plugin:

dns-sd -R foo _http._tcp local 35000

It should show up in the plugin and should be removed when you stop the command. You can start multiple of these, for example in multiple terminal windows.

from nsd.

sebastianhaberey avatar sebastianhaberey commented on June 16, 2024

@kostadin24 I'm still not sure whether this is a problem in your system or a general problem. Especially since @robert-virkus said the plugin is working fine on Android 12 for him.

So I'm closing this for now, but I promise to re-open it if more people report the same issue!

from nsd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.