GithubHelp home page GithubHelp logo

bontiv / iot-upnp Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 6.0 268 KB

Python library to annonce UPnP device on network (can be shown on Windows Explorer)

Home Page: https://bontiv.github.io/iot-upnp/

License: GNU General Public License v3.0

Python 100.00%
upnp python3 ssdp

iot-upnp's People

Contributors

bontiv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

iot-upnp's Issues

Add more use-case examples to the documentation

I'm building an IoT system that is controlled via a webapp served from the device itself, and I want to publish the URL using uPnP. I tried to use your module, but I'm unable to see it from the uPnP programs I used. Currently I tried VLC under a PC and DMS Explorer in Android, but neither of them shows my device.

The problem is that I don't know if they are those programs who are filtering my device, or if it is me, configuring incorrectly your module.

Could you add some "classic" examples to the documentation? Specifically it would be great to have how to publish an URL with the web control of the device.

Thanks.

asyncio related TypeError seen with python3.7

Bonjour, the following proposed commit fixes the following issue seen with python3.7:

    iot-upnp/upnp/HTTP.py:170: RuntimeWarning: coroutine 'StreamReader.readline' was never awaited
      header = yield from reader.readline()
    Task exception was never retrieved
    future: <Task finished coro=<HttpServer.InConnection() done, defined at /Users/divy/workareas/iot-upnp/upnp/HTTP.py:169> exception=TypeError("cannot 'yield from' a coroutine object in a non-coroutine generator")>
commit 8d2b97fee71dab2fd15206459fae22a61e6ffcf7 (HEAD -> asyncio_decorator)
Author: Divy Le Ray <[email protected]>
Date:   Sun Sep 9 11:52:02 2018 -0700

    Add a asyncio decorator to avoid the following error seen with python3.7:
    iot-upnp/upnp/HTTP.py:170: RuntimeWarning: coroutine 'StreamReader.readline' was never awaited
      header = yield from reader.readline()
    Task exception was never retrieved
    future: <Task finished coro=<HttpServer.InConnection() done, defined at /Users/divy/workareas/iot-upnp/upnp/HTTP.py:169> exception=TypeError("cannot 'yield from' a coroutine object in a non-coroutine generator")>

    Signed-off-by: Divy Le Ray <[email protected]>

diff --git a/upnp/HTTP.py b/upnp/HTTP.py
index 3044777..11eb2cd 100644
--- a/upnp/HTTP.py
+++ b/upnp/HTTP.py
@@ -166,6 +166,7 @@ class HttpServer:
     def __init__(self, config):
         self.config = config

+    @asyncio.coroutine
     def InConnection(self, reader, writer):
         header = yield from reader.readline()
         cheaders = header.decode('latin1').strip()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.