Git Product home page Git Product logo

python-upnp-ssdp-example's People

Contributors

zewaren avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

python-upnp-ssdp-example's Issues

sources?

Hey, I this is extremely useful, thank you so much for creating this, but there is a lot of low level programming in here, and I'm just wondering what exactly was your reference when you created this, so that maybe I can sort of trace the logic a little better, because I've never really programmed a webserver at this low of a level.

Thanks for creating this!

Early launch of ssdp_server.py (from rc.local) will fail on Pi

Hi, I thank you a lot for the code you wrote.
I adapted it for my needs in my SmartThings porting to add UPNP detection of my Pi (see https://github.com/philippeportesppo/AirMentorPro2_SmartThings).

I found your original code in main.py had a problem to be launched when the system is early in booting, meaning the network interface is not yet available.

Since I modified your code too much to fork a version of it, I just snap the code below.
The idea is to have a waiting stage till the network interface shows up.

Thanks again (ou merci si vous etes en France).

def get_network_interface_ip_address(interface='wlan0'):

"""

Get the first IP address of a network interface.

:param interface: The name of the interface.

:return: The IP address.

"""


while interface not in ni.interfaces():

    print('Could not find interface %s.' % (interface,))

    sleep(10)



while True:
    interfacestring = ni.ifaddresses(interface)

    if (2 not in interfacestring) or (len(interfacestring[2]) == 0):

        print('Could not find IP of interface %s. Sleeping.' % (interface,))

        sleep(10)

        continue
    else:
        break
return interfacestring[2][0]['addr']

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.