npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

damage-report-client-dht

v1.1.0-alpha.2

Published

Reports temperature & humidity data of a DHT sensor to the damage-report service.

Downloads

6

Readme

damage-report-client-dht

License: MIT Build Status npm

Reports temperature & humidity data of a DHT sensor in a Raspberry Pi to the damage-report service.

Quick Start

This is a single standalone CLI script. I recommend installing it globally:

npm i -g damage-report-client-dht

Start a simulation:

TYPE=22 PIN=4 API_URL=http://locahost:8000 LOCATION_ID=kitchen LOCATION_NAME=Kitchen SIMULATE=1 damage-report-client-dht

Start monitoring sensors (tested on Raspberry Pi only):

TYPE=22 PIN=4 API_URL=http://locahost:8000 LOCATION_ID=kitchen LOCATION_NAME=Kitchen damage-report-client-dht

Environment Variables

  • TYPE - (required) - One of 11 or 22 for the DHT11 or DHT22/AM2302 respectively.
  • PIN - (required) - The GPIO pin that the sensor is connected to.
  • API_URL - (required) - The URL to the damage-report API.
  • LOCATION_ID - (required) - ID of the location of the sensor.
  • LOCATION_NAME - (optional) - Name of the location of the sensor. Defaults to the location ID.
  • TIMEOUT - (optional) - The time (ms) to wait for a signal until starting a new try. Defaults to 5000.
  • CRON_PATTERN - (optional) - A cron pattern describing when to update. Defaults to "* * * * *" (every minute).
  • SIMULATE - (optional) - Set to "true" to skip reading sensors and send random data instead. Defaults to false.
  • LOGGLY_SUBDOMAIN - (optional) - The loggly.com sub domain to log to. If falsy logs go to stdout only.
  • LOGGLY_TOKEN - (optional) - A loggly.com access token. If falsy logs go to stdout only.
  • CONFIG_PATH - (optional) - Path to a .env-style file to load environment variables from. Defaults to ".env".

.env

Use CONFIG_PATH to specify a .env-style file to be used:

CONFIG_PATH=~/.config/dht-env damage-report-client-dht

Cron Pattern

Cron patterns can be standard unix 5 column or non-standard 6 column. When using 6 columns, the first describes seconds.

See https://en.wikipedia.org/wiki/Cron for reference.

Changelog

See CHANGELOG for a list of changes.