Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Android device can't find remote devices
08-12-2013, 05:40 AM
Post: #1
Android device can't find remote devices
Hello,

We have the following problem:

We use the same Java code for Windows desktop app and Android app.

Code for initialization:
Code:
    InitParams initParams = new InitParams();
    initParams.setMsearchTimeSecs(5);
    initParams.setMsearchTtl(164);
    initParams.setDvServerPort(0);
    initParams.setLogOutput(new IMessageListener() {
            @Override
        public void message(String msg) {
            logger.log(Level.INFO, msg);
        }
    });
    
    library = new Library();
    library.initialise(initParams);
    library.setDebugLevel(DEBUG_LEVEL);
    
    library.startCombined(address);
        
    DeviceInfo deviceInfo = localDevice.getDeviceInfo();
        
    device = new DvDeviceStandard(deviceInfo.getDeviceID());
    device.setAttribute("Upnp.Domain", "upnp.org");
    device.setAttribute("Upnp.Type", UPNP_DEVICE_TYPE);
    device.setAttribute("Upnp.Version", ""+UPNP_DEVICE_TYPE_VERSION);
    device.setAttribute("Upnp.FriendlyName", deviceInfo.getDeviceName());
    device.setAttribute("Upnp.Manufacturer", deviceInfo.getManufacturer());
    device.setAttribute("Upnp.ModelName", deviceInfo.getModel());
        
    peerProvider = new PeerProvider(device, deviceInfo);
        
    device.setEnabled();

Code for scan:
Code:
list = new CpDeviceListUpnpAll(....);

Android Multicast lock is acquired before any ohNet calls.

address argument for library.startCombined is 192.168.2.7

Android device runnig app is visible by desktop app.
But, Android app can't find any devices in the network.

What can cause this problem?

Thanks in advance.

Best regards.
Find all posts by this user
08-12-2013, 08:04 AM
Post: #2
RE: Android device can't find remote devices
UPnP sniffing on PC show NOTIFY and BYE requests from device, but no M-SEARCH requests.

Desktop UPnP app issues M-SEARCH requests.
Find all posts by this user
08-12-2013, 09:24 AM
Post: #3
RE: Android device can't find remote devices
All is fixed.

I added library.setCurrentSubnet and now M-SEARCH requests going from device, as expected.
Find all posts by this user
09-12-2013, 10:30 AM
Post: #4
RE: Android device can't find remote devices
Glad you got it working.

Its curious that the call to library.setCurrentSubnet was required; library.startCombined should have been sufficient. The argument passed to both of these functions should be the subnet for your selected network adapter, not the adapter address. Which do you pass in your app?
Find all posts by this user
13-12-2013, 03:28 PM (This post was last modified: 13-12-2013 03:28 PM by BitGriff.)
Post: #5
RE: Android device can't find remote devices
I tried both variants.

Thanks for this clarification about subnet's address.
Find all posts by this user


Forum Jump: