felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Francesco Furfari (JIRA)" <j...@apache.org>
Subject [jira] Commented: (FELIX-642) upnp event delivery to OSGi event listeners fails on random devices after a certain period of time
Date Tue, 05 Aug 2008 21:24:44 GMT

    [ https://issues.apache.org/jira/browse/FELIX-642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12620050#action_12620050

Francesco Furfari commented on FELIX-642:

Hi Daniel,

I  should have fixed the bug. It was in the basedriver see comment on Subversion commits.
If you build the snapshot version of the basedriver you should see the difference.

I tested the UPnP subscription mechanism instantiating 100 BinaryLight on a Felix platform
and running a modified version of the tester on another one. It seems stable now, but I noticed
that with 100 devices already instantiated, launching the tester the first time almost 50
devices are discovered  and ( with the fix ) all the initial events are properly reported
for these devices. By using the menu "SEARCH/root devices"  of the UpnP Tester the rest of
the devices are discovered with the related initial state. This behavior is due to the loss
of multicast messages as Stefano discussed with you (http://sourceforge.net/forum/forum.php?thread_id=1952657&forum_id=258158).

a snippet of the code used for the tester is:

	public void doTest(){
		System.out.println("starting test");
		listener = new RootDeviceListener();
		listener.setDeviceNodeListener(new DeviceNodeListener(){
			HashMap map = new HashMap();
		    int countNotify = 1;
		    int countDevices = 1;
			public void deviceDetected(DeviceNode d) {
				String udn = d.toString();
				System.out.println("device DETECTED " + udn + " ### " + countDevices++);
			   UPnPSubscriber subscriber = new UPnPSubscriber(context, new UPnPEventListener(){
					public void notifyUPnPEvent(String arg0, String arg1, Dictionary arg2) {
						System.out.println(arg0 + " " + arg1 + arg2.toString() + "  " + countNotify++);
			   map.put(udn, subscriber);
			public void rootDeviceUnplugged(String udn) {
				System.out.println("device REMOVED " + udn + " ### " + (--countDevices));
				UPnPSubscriber subscriber = (UPnPSubscriber)map.remove(udn);
				if (countDevices==1) countNotify =1;

note that I used the RootDeviceListener class you find in the UPnP Tester code.
It will be part of the upnp.extra bundle in the future.

Best Regards,

> upnp event delivery to OSGi event listeners fails on random devices after a certain period
of time
> --------------------------------------------------------------------------------------------------
>                 Key: FELIX-642
>                 URL: https://issues.apache.org/jira/browse/FELIX-642
>             Project: Felix
>          Issue Type: Bug
>          Components: UPnP Subproject
>    Affects Versions: upnp-basedriver-0.8.0
>            Reporter: Daniel Felsing
>            Priority: Blocker
>             Fix For: upnp-basedriver-0.8.0
> Ok...overall problem is as follows:
> upnp event delivery to OSGi event listeners fails on random devices after a certain period
of time
> Overall Environment Setup
> -------------------------
> - i have two hosts A and B => A is a Bridge exporting about 20 devices at the moment
(will get more - it's a X10 like system), B acts as a central server for the devices (Smart
Home implementation)
> - A is a SensorBridge...and B a central controlpoint importing all those devices
> - both ends use upnpbasedriver 0.8 and extra bundle from felix project
> - the two hosts are connected through a Gigabit Switch (NO WIRELESS USED!)
> - all the devices on the server (so the central smart home controller) that get imported
get refined. They subscribe to the upnp device it refines to get notified on event change.
> - on the central server (Host B) i subscribe to UPnP Devices exported by Host A using
UPnPSubscriber Helper class of the extra bundle
> Issues
> ------
> - "SOMETIMES" on INITIAL subscription not all devices get notified about the initial
status (devices get found properly though)
>   ( see also http://www.mail-archive.com/users@felix.apache.org/msg01781.html for that)
> - after some time of operation random devices begin to fail - that means..they do not
get notified about event changes anymore, but devices are still present (so they are still
there as UPnPDevice instances in the central server)... 
> => i had debug enabled....and as i see i still receive the event-change notifies on
my Host B (=central server)....if i "resubscribe" to the event listener of the failed device
everything works again (i dont need to restart the whole basedriver or osgi framework to let
it work again - just my refining driver must be restarted which does the subscription to the
devices using UPnPSubscriber class) ...
> SO this STILL GETS DELIVERED, but listeners do not get notified about the change:
> ================REQUEST=====================
> NOTIFY /evetSub HTTP/1.0
> Content-Type: text/xml; charset="utf-8"
> NT: upnp:event
> NTS: upnp:propchange
> SID: uuid:956d-a11b-fe88-e08e
> SEQ: 0
> Content-Length: 165
> Connection: close
> <?xml version="1.0" encoding="utf-8"?>
> <propertyset xmlns:e="urn:schemas-upnp-org:event-1-0">
>    <property>
>       <Status>off</Status>
>    </property>
> </propertyset>
> -------------------------------------------- 
> Tests:
> -----------------
> - yes - every device exported by the upnpsensorbridge (=Host A) gets found by the central
server (=Host B) 
> - upnp tester of felix project experiences same issues
> - the REFINED devices on the SERVER themselves are using the felix helper class to subscribe
to the events:
> 		// create upnp listener - if evented is true
> 		subscriber = new UPnPSubscriber(bundleContext, this);
> 		subscriber.subscribeAllServicesOf(super.getUPnPDeviceUDN());
> - i also tried: 		EventListener test = new EventListener();
> 		                servReg = context.registerService(UPnPEventListener.class.getName(),
test, null);
> (so not using UPnPSubscriber) => same problem...so UPnPSubscriber may not be the root
of the problem
> - the upnp device implementation on the host exporting the upnp devices ( =Host A, sensorbridge)
are using the following line to expose event notifier
> 		// setup event notifier
> 		notify_switch = new UPnPEventNotifier(context, this, switchdevswitchservice, switchDev);
> ================================================================================
> Is it possible that my issue is connected to this one mentioned in the cyberlink forum?
> Stefano answered to it in the cyberlink forum!!
> http://sourceforge.net/forum/forum.php?thread_id=1952657&forum_id=258158
> ----------------------------------------------------------------------------------------------------------------------------
> if you need something else please contact me! :)

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message