Closed Thisoft closed 6 years ago
While autodiscover crash the adapter if in the header the section 'USN' is not defined.
2017-12-28 12:19:25.547 - [32minfo[39m: upnp.0 ***TEST***{"HOST":"239.255.255.250:1900","CACHE-CONTROL":"max-age=5000","LOCATION":"http://192.168.137.50/upnp/basic_dev.cgi","NTS":"ssdp:alive","SERVER":"HomeMatic","NT":"upnp:rootdevice"} 2017-12-28 12:19:25.609 - [31merror[39m: upnp.0 uncaught exception: Cannot read property 'toString' of undefined 2017-12-28 12:19:25.613 - [31merror[39m: upnp.0 TypeError: Cannot read property 'toString' of undefined at SsdpServer.<anonymous> (C:\ioBroker\node_modules\iobroker.upnp\main.js:1061:14) at emitOne (events.js:96:13) at SsdpServer.emit (events.js:188:7) at SsdpServer.SSDP._notify (C:\ioBroker\node_modules\iobroker.upnp\node_modules\node-ssdp\lib\index.js:256:12) at SsdpServer.parseCommand [as _parseCommand] (C:\ioBroker\node_modules\iobroker.upnp\node_modules\node-ssdp\lib\index.js:227:12) at SsdpServer.SSDP._parseMessage (C:\ioBroker\node_modules\iobroker.upnp\node_modules\node-ssdp\lib\index.js:210:10) at Socket.onSocketMessage (C:\ioBroker\node_modules\iobroker.upnp\node_modules\node-ssdp\lib\index.js:163:10) at emitTwo (events.js:106:13) at Socket.emit (events.js:191:7) at UDP.onMessage (dgram.js:548:8) 2017-12-28 12:19:25.625 - [32minfo[39m: upnp.0 Alive and sid states cleared 2017-12-28 12:19:25.626 - [32minfo[39m: upnp.0 cleaned everything up... 2017-12-28 12:19:25.841 - [32minfo[39m: upnp.0 terminating
To log the header I've modified the code in main.js:
server.on('advertise-alive', function (headers) { var usn = JSON.stringify(headers['USN']); if (typeof(usn)=="undefined") { adapter.log.info("***TEST***" + JSON.stringify(headers)); } usn = usn.toString();
Danke für deine Meldung. Ich werde eine Fehlerbehandlung ein bauen. Dauert aber ein paar Wochen bis ich Zeit dafür habe.
Alles klar. Danke.
Should be fixed now.
While autodiscover crash the adapter if in the header the section 'USN' is not defined.
2017-12-28 12:19:25.547 - [32minfo[39m: upnp.0 ***TEST***{"HOST":"239.255.255.250:1900","CACHE-CONTROL":"max-age=5000","LOCATION":"http://192.168.137.50/upnp/basic_dev.cgi","NTS":"ssdp:alive","SERVER":"HomeMatic","NT":"upnp:rootdevice"} 2017-12-28 12:19:25.609 - [31merror[39m: upnp.0 uncaught exception: Cannot read property 'toString' of undefined 2017-12-28 12:19:25.613 - [31merror[39m: upnp.0 TypeError: Cannot read property 'toString' of undefined at SsdpServer.<anonymous> (C:\ioBroker\node_modules\iobroker.upnp\main.js:1061:14) at emitOne (events.js:96:13) at SsdpServer.emit (events.js:188:7) at SsdpServer.SSDP._notify (C:\ioBroker\node_modules\iobroker.upnp\node_modules\node-ssdp\lib\index.js:256:12) at SsdpServer.parseCommand [as _parseCommand] (C:\ioBroker\node_modules\iobroker.upnp\node_modules\node-ssdp\lib\index.js:227:12) at SsdpServer.SSDP._parseMessage (C:\ioBroker\node_modules\iobroker.upnp\node_modules\node-ssdp\lib\index.js:210:10) at Socket.onSocketMessage (C:\ioBroker\node_modules\iobroker.upnp\node_modules\node-ssdp\lib\index.js:163:10) at emitTwo (events.js:106:13) at Socket.emit (events.js:191:7) at UDP.onMessage (dgram.js:548:8) 2017-12-28 12:19:25.625 - [32minfo[39m: upnp.0 Alive and sid states cleared 2017-12-28 12:19:25.626 - [32minfo[39m: upnp.0 cleaned everything up... 2017-12-28 12:19:25.841 - [32minfo[39m: upnp.0 terminating
To log the header I've modified the code in main.js:
server.on('advertise-alive', function (headers) { var usn = JSON.stringify(headers['USN']); if (typeof(usn)=="undefined") { adapter.log.info("***TEST***" + JSON.stringify(headers)); } usn = usn.toString();