This library provides the functionality to implement a UPnP/DLNA device and control point in Arduino.
The Digital Living Network Alliance (DLNA) aims to establish the interoperability among PCs, consumer appliances, and mobile devices in wireless networks and wired networks. The purpose is to provide a solution for sharing between digital media and content services.
Reference Documentation is hard to find. Therfore I am providing some valuable links:
I was struggling quite a bit to choose the right approach to implement something like this in Arduino. On the desktop the the functionality can be provided with the help of the following projects:
- pupnp A Portable SDK for UPnP* Devices
- gmrender-resurrect: A headless UPnP/DLNA media renderer based on pupnp
A DLNA device uses UDP, Http, XML and Soap to discover and manage the services, so there is quite some complexity involved.
I decided to implement the functionality from scratch using the basic Arduino Network API and I do not rely on any external libraries.
The DLNAControlPointMgr is setting up a control point and lets you execute actions. The DLNADeviceMgr class provides the setup of a Basic DLNA Device service. Devices are represented by the DLNADevice class. The device registers itself to the network and answers to the UDP DLNA queries and requests:
- We handle the UDP communication via a Scheduler and a Request Parser
- We handle the Http requests with the help of my TinyHttp Server
- The XML service descriptions can be stored as char arrays in progmem or generated dynamically with the help of the XMLPrinter class.
Developping and debugging on a microcontroller is quite tedious: therefore this project can also be compiled and run on a linux desktop.