Code Monkey home page Code Monkey logo

arduino-upnp's Introduction

arduino-upnp

UPnP implementation for Arduino, and on ESP 8266

This is a library containing a couple of simple classes to implement a UPnP device on an ESP8266.

The demo is a MotionSensorService class which can be detected with SSDP :


  dannylaptop% lsupnp
  ...
  Device #5 {UPnP Motion Sensor Kit}, url http://192.168.1.100:80/description.xml
    Service {urn:danny-backx-info:serviceId:sensor1}, url /scpd.xml
            type urn:danny-backx-info:service:sensor:1

and that produces (debug) output such as this when queried


  Boot version 31
  Flash chip Real size 4194304, size 4194304
  SDK version 1.3.0
  Starting WiFi... XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX IP address 192.168.1.100
  Mode: STA
  PHY mode: N
  Channel: 11
  AP id: 0
  Status: 5
  Auto connect: 1
  Starting HTTP...
  Starting SSDP...
  UPnPService::begin(), this 3ffed1e0, srv 3ffed1e0
  MotionSensorService::begin
  Ready!
  MotionSensorService::GetStateHandler
  MotionSensorService::GetStateHandler

Sample queries are provided in examples/UPnP/scripts . Note that the getVersion script invokes a function that should return XML, but I'm a bit lazy : the output isn't valid XML.

This is the output of the example that does produce sensible XML :


  Query 192.168.1.100 ...
  <?xml version="1.0" encoding="utf-8"?>
  <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  <s:body>
  <u:GetStateResponse xmlns="urn:danny-backx-info:service:sensor:1">
  <State></State>
  </u:GetStateResponse>
  </s:body>
  </s:Envelope>

The only hardware you need for this is an ESP8266 device and a motion sensor.

You can build this application via the Makefiles supplied, or from the regular Arduino IDE. Either way, you'll need to supply a file called

mywifi.h
in each application directory, with contents such as


  #define MY_SSID "my-wifi-ssid"
  #define MY_WIFI_PASSWORD "secret"

arduino-upnp's People

Contributors

dannybackx avatar

Watchers

James Cloos avatar

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.