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

chainway-rfid

v1.0.3

Published

A Node.js library for seamless integration with Chainway UHF RFID readers. Supports UR4, R3, and R6 devices for easy communication, scanning, and data retrieval. Ideal for building custom RFID applications

Downloads

5

Readme

Chainway UHF RFID API Gateway (Unofficial)

Welcome to the unofficial API gateway for Chainway UHF RFID readers, designed to facilitate communication with various Chainway products using Node.js. This repository provides a streamlined interface for integrating with Chainway's UHF RFID readers, making it easier to build custom applications.

Supported Devices

This library supports the following Chainway UHF RFID readers:

  • UR4: Connect via IP (Ready) ✅
  • R3: Connect via USB-C (On-going)
  • R6: Connect via USB-C (On-going)

Features

  • Seamless Integration: Easily connect and communicate with Chainway UHF readers using Node.js.
  • Multi-Device Support: Handle multiple types of readers with a single API.
  • Customizable: Extend and customize the gateway to fit your specific needs.

Installation

To install the library, run the following command:

npm install chainway-rfid

Basic Usage

Here's an example of how to use the `chainway-rfid` library:

const { chainwayApi } = require('chainway-rfid');

const example = async () => {
    try {
        await chainwayApi.connect("192.168.99.202", 8888); // Replace with your reader's IP and port
        await chainwayApi.startScan();
        chainwayApi.received((data) => {
            console.log('EPC:', data.epc);
            console.log('TID:', data.tid);
            console.log('Antenna:', data.ant);
            console.log('RSSI:', data.rssi);
        });
    } catch (e) {
        console.error("An error occurred:", e);
    }
};

example();

Connecting to a Reader

To connect to a Chainway reader, use the `connect` method:

await chainwayApi.connect(ipAddress, port);
  • `ipAddress`: The IP address of the Chainway reader (e.g., `"192.168.99.202"`).
  • `port`: The port to connect to (e.g., `8888`).

Starting a Scan

To start scanning for UHF RFID tags:

await chainwayApi.startScan();

Receiving Data

To handle incoming data from the RFID reader, use the `received` method:

chainwayApi.received((data) => {
    console.log('EPC:', data.epc);
    console.log('TID:', data.tid);
    console.log('Antenna:', data.ant);
    console.log('RSSI:', data.rssi);
});

The `data` object contains the following fields:

  • `epc`: Electronic Product Code of the tag.
  • `tid`: Tag Identifier.
  • `ant`: Antenna number that detected the tag.
  • `rssi`: Signal strength indicator of the tag.

API Reference

`chainwayApi.connect(ipAddress: string, port: number): Promise`

Connects to the Chainway UHF RFID reader.

`chainwayApi.startScan(): Promise`

Starts scanning for UHF RFID tags.

`chainwayApi.received(callback: (data: { epc: string, tid: string, ant: number, rssi: number }) => void): void`

Registers a callback function to handle data received from the reader.

`chainwayApi.stopScan(): Promise`

Stops scanning for UHF RFID tags.

`chainwayApi.disconnect(): Promise`

Disconnects from the Chainway UHF RFID reader.

Error Handling

Ensure you handle errors in your application by using `try...catch` blocks around asynchronous operations:

try {
    await chainwayApi.connect("192.168.99.202", 8888);
    await chainwayApi.startScan();
} catch (e) {
    console.error("Connection failed:", e);
}

Customization & Commercial Support

If you require additional customization or commercial support for integrating Chainway UHF RFID readers with your applications, I offer personalized services. Whether it's adding new features, optimizing performance, or adapting the library to your specific needs, I'm here to help.

Contact For more information, custom solutions, or to discuss your project requirements, feel free to contact me:

Email: [[email protected]]