UPnP node - looking for alpha tester

30 views
Skip to first unread message

cin...@gmail.com

unread,
Apr 25, 2017, 5:49:51 PM4/25/17
to Node-RED
Hi!

I created an upnp control point node for node-red. At the moment, I would say it is in an early alpha state. I'm using it with all of my UPnP devices that I have for over a week now and its working fine. However, since I could not find a reasonable nodejs implementation of an UPnP control point satisfying my needs, I had to first create a nodejs upnp library (https://github.com/cinhcet/node-upnp-control-point) from scratch. Since this turned out to be a more complex topic (especially (at least) trying to adhere to the upnp specification, which most implementations do not) than I thought in the beginning, I think it is worth getting some feedback from other users with different UPnP devices in order to find bugs etc.

Therefore, if you have some UPnP devices around and are interested in controlling these, maybe you could test the current state of this node. 
As a small appetizer, 

you can for example create an upnp media browser and then send the selected media to your media renderer with this node.

Ok, lets start: I assume you know a little bit of UPnP. If not, read the upnp specification, for example http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf for a general overview and then the specific ones for your device.
Installation as with normal node-red modules:
npm install sbarwe/node-red-contrib-upnp
(its not yet published on npm)

This will install three nodes to your palette:
- Discovery node
- Action node
- Event node

The first step is to find the UUID of the device you want to control or receive events. In order to do this, you can use the exampleDiscovery.flow flow provided by the node in its folder. When pressing the inject button, you will receive probably many entries in your debug tab (this part is to be improved, however, this has to be done only once per device). In the "header" key you will find a property "USN", which may looks like 
USN"uuid:23e5e66-243c-461e-9dqw-24534ffsa"
or
USN"uuid:23e5e66-243c-461e-9dqw-24534ffsa::urn:schemas-upnp-org:device:MediaServer:1"
or similar. If you found the right one (the "SERVER" and "LOCATION" property will help you identifying), then copy the raw UUID, i.e. in the example above
23e5e66-243c-461e-9dqw-24534ffsa
to some place (you will need it later).

This was the tedious part, now for the fun part. Import the exampleAction.flow flow (also from the node folder), open the UPnP Invoke Action node and create a new configuration node where you specify the UUID you just have found out.  If you press deploy, then, if everything goes right, a green status should indicate that node-red has found the device. This flow assumes that you control a media renderer. If not, adjust the function nodes accordingly by looking at the upnp specifications (really read them!!!). The "device description" inject should (hopefully) always work. 

The event node should be self-explanatory. 

At the moment, the outputs/inputs are quite low-level and require pre/post processing.
Sebastian Barwe will improve the usability within node-red. 

As I said, this is in alpha status, so do not blame me for node-red crashes. The API also might change.
Feedback is appreciated. Also with respect to the API. 
 

Nate Damm

unread,
Apr 25, 2017, 11:11:37 PM4/25/17
to Node-RED
Nice if I could push my UI page to a TV with a trigger, I'll try and check this out this weekend.
Reply all
Reply to author
Forward
0 new messages