Git Product home page Git Product logo

pycoap's Introduction

pycoap

CoAP Python Client

Dependencies

Installation

Client Side

Install :

git clone https://github.com/gzsierra/pycoap/

Configuration

In the file coapSender.py, you have to edit one line:

request.opt.uri_host = '[INSERT_YOUR_SERVER_IP]'

If you want to send data to another specific endpoint, you can edit this line (DON'T FORGET TO ADD THE RESSOURCE IN SERVER SIDE) :

request.opt.uri_path = ("[INSERT_ORGANISATIONAL_FOLDER]", "[FINAL_ENDPOINT_NAME]")

Usage

python3 pycoap.py [FILENAME]

Server Side

Install :

git clone https://github.com/gzsierra/pycoap/

Configuration

In the file pyServer.py, if you want to add more ressource, you have to add another line like this :

root.add_resource(('[INSERT_ORGANISATIONAL_FOLDER]', '[FINAL_ENDPOINT_NAME]'), BlockResource())

Usage

python3 pyServer.py

OpenHAB

For installation of OpenHAB, please refer to the doc

Script needed pyGet.py :

git clone https://github.com/gzsierra/pycoap/

Additional addon needed :

apt install openhab-addon-binding-exec

Configuration

  • File to edit 1 items/demo.items, for more details, please refer to the doc :
Number coapsw1                  "temp [%.1f °C]" (Temperature) {exec="<[/usr/bin/python3 /home/openhab/Documents/pycoap/pyGet.py:60000:REGEX((.*?))]"}
  • File to edit 2 sitemap/demo.sitemap:
sitemap demo label="Main Menu"
{
      Frame label="CoAP" {
              Text item=coapsw1
      }
}

LICENCE

MIT

pycoap's People

Contributors

gzsierra avatar

Stargazers

 avatar Maxime Connolly avatar

Watchers

 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.