Git Product home page Git Product logo

api-mqtt's Introduction

API para controlar dispositivos mediante MQTT

Esta aplicación basada en Node.js permite recibir y enviar información a traves del protocolo MQTT, para controlar dispositivos conetados a internet por medio de alguna placa de desarrollo.

Calls

Controla las llamadas a la API para publicar los estados de los pines digitales en las placas de desarrollo.

Status:

[GET] http://localhost:3002/api


Mostrando todos los registros:

[GET] http://localhost:3002/api/devices

[Respuesta]

  {
      "_id": "5e87a6501df56d53253e6556",
      "name": "Regador Jardín",
      "type": "plant",
      "pin": 14,
      "status": 1,
      "topic": "costanera1980/devices/ESP32/ESP32-001/",
      "device": "ESP32",
      "timeon": "10:00",
      "timeoff": "11:30",
      "days": "all",
      "__v": 0
   }

Crear nuevo registro:

[POST] http://localhost:3002/api/devices/write

Parametros

"name" > String

"type" > String [gpio,temperature,plant,light]

"pin" > Number

"status" > Number [0,1]

"topic" > String

"device" > String

"timeon" > String

"timeoff"> String

"days" > String [all,week,none]


Mostrando registro por ID:

[POST] http://localhost:3002/api/device/:deviceId


Actualizando registro por ID:

[PUT] http://localhost:3002/api/device/:deviceId

Parametros


Actualizando status de registro por ID:

[POST] http://localhost:3002/api/update/:deviceId/:status

"status" > Number > 0 or 1


Obteniendo datos de Temperatura:

[GET] http://localhost:3002/api/temperature


Delete registro:

[DELETE] http://localhost:3002/api/delete/:deviceId


Diagrama de comunicación

Screenshot

api-mqtt's People

Contributors

animaskazo avatar framirezgarrido1 avatar titoluyo 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.