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

es51922

v0.1.1

Published

Streaming Cyrustek ES51922 DMM data protocol implementation over serial

Downloads

32

Readme

es51922

Streaming Cyrustek ES51922 DMM data protocol implementation over serial

The Cyrustek ES51922 is an IC found in several multimeters with "data-out" capability, including the UNI-T UT61E and Wintex TD2200 (source: sigrok.org).

The es51922 module provides both Observable (RxJS) and object-mode Readable Stream APIs.

Install

$ npm install es51922

Usage

Observable API

import {fromES51922} from 'es51922';

fromES51922('/dev/ttyUSB0').subscribe(data => {
  console.log(`${data.value} ${data.range.unit}`);
});

Example output:

3.269 V
3.209 V
3.268 V
3.268 V
3.267 V

Node.js Stream API

This is equivalent to the above:

import {readES51922Stream} from 'es51922';

readES51922Stream('/dev/ttyUSB0').on('data', data => {
  console.log(`${data.value} ${data.range.unit}`);
});

Data Format

TODO (describe shape of object)

Environment

Define the ES51922_PORT environment variable to avoid needing to pass it directly to the API. This module also accepts an .env file (for dotenv).

Development

src/es51922.ksy.yml contains a Kaitai Struct format description of the data protocol. The Kaitai Struct compiler generates the parser, which lives in vendor/es51922.js.

The reference Kaitai Struct compiler is implemented in Scala, so it would be a hassle to compile as part of a build step. The Kaitai Struct team publishes a pure-JS implementation to npm, but it has not kept pace with the Scala implementation; it fails to parse our format description file.

Until the JS implementation ready for use, you can install the Kaitai Struct compiler from kaitai.io, and execute npm run compile-posix (Windows users may need to tweak the run script). This (should) update vendor/es51922.js.

Notes

  • Temperature and ADP modes are unimplemented (and will likely remain so).
  • The Python ut61e package helped immensely w/ understanding the protocol.
  • This module won't work with Hoitek HE2325U or WCH CH9325 USB/HID adapter cables.
  • I'm using a FTDI FT232R-based RS232-to-USB converter. YMMV.
  • AFAIK there's no graphical viewer which supports this format available on macOS.
  • My ultimate goal is to use this module in a nice graphical interface with real-time interactive charts and shit.

See Also

Contributing

PR's welcome! Please use the Conventional Commits specification.

License

Copyright © 2019 Christopher Hiller. Licensed Apache-2.0