Socket
Socket
Sign inDemoInstall

dht-express

Package Overview
Dependencies
76
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    dht-express

Express webserver serving DHT11/ DHT22 sensor data build for https://github.com/lucacri/homebridge-http-temperature-humidity


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

dht-express

A simple express webserver serving data of the DHT11/ DHT22 temperature and humidity sensors.

Installation

You need to install the Broadcom BCM 2835 libary first.

After that clone the repository.

git clone https://github.com/edjopato/dht-express.git
cd dht-express
npm install

If you want to include the endpoint in your existing Express webserver take a look in the topic at the end of the README

Configuration

Remember to configure the webserver in the standalone.js after the comment

// add more sensors on routes here
app.use( '/', sensor( 11, 4 ) );

You have to configure the express route, the sensor type (11 or 22 for DHT11/ 22) and the pin.

Run

This module uses the BCM2835 library through node-dht-sensor that requires access to /open/mem. Because of this, you will typically run node with admin privileges.

npm start

After that you can configure and run homebridge with the homebridge-http-temperature-humidity plugin.

Include in existing express webserver

Install in your project

npm install --save dht-express

use in your project

you can use every other express router

var sensorRouter = requires('dht-express');
...
app.use( '/my/super/route', sensor( type, pin ) );

Don't forget the admin privileges of this module (run with sudo)

FAQs

Last updated on 14 Aug 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc