(Article title)

From Embedded Lab Vienna for IoT & Security
Jump to navigation Jump to search

UPnP

The Universal Plug and Play (UPnP) Device Architecture, formerly known as the DCP Framework, provides a comprehensive set of protocols for seamless communication between controllers, known as control points, and devices within a networked environment. These protocols include essential functions such as device discovery, description, control, event notification, and presentation.

Setup

  1. Raspberry Pi as UPnP Client
  2. UPnP ready Router
  3. Internet access device (Mobile Phone)

Implementation

  1. Enable UPnP on Router
  2. Connect Raspberry Pi with Router
  3. Check external IP (curl https://ipecho.net/plain ; echo)
  4. Check internal IP on Raspberry Pi (ifconfig)
  5. Install miniupnpc client on Raspberry Pi (sudo apt-get install miniupnpc)
  6. Set up port forwarding on Router via Raspberry Pi miniupnpc Client (upnpc- a <internalIpRaspberryPi> <internalPort> <externalPort> TCP)
  7. Set up index.html on Raspberry Pi and start http server in the same directory (python3 -m http.server <internalPort>)
  8. Access external IP and Port with any Browser from outside the network (http://<externalIP>:<externalPort>)