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

icu-connect

v1.0.5

Published

connect and run Innovative Technology ICU™ device

Downloads

7

Readme

ICU™ Connect

A npm module to allow a user to connect and use an Innovative Technology Ltd ICU Lite™ or ICU Pro™ Age/Face biometric verification device.

Features

  • Use Device 'local API' mode
  • Easy connection
  • Device events
  • Cross platform

Options

Options can be set at object run function or using the seperate set_options request.

| Option | Description | Default | |:------|:-----------|:-------:| |ip|the ip address of the ICU device|192.168.137.8| |ssl|true for HTTPS connection to ICU Device|true| |port|the localAPI port number of the ICU device|44345| |username|the localAPI username set on the ICU device|| |password|the localAPI password set on the ICU device|| |db_dir|the location directory for the database file|cwd| |db_name|the filename for the databasefile|icu.db|


Usage

The module initialises, connects, controls and reads the ICU™ device. The ICU™ device needs to be set up in Local API mode. The user can chose SSL (https) connection or http and enter a security username and password on the 'Running Mode' tab on the device Web Config page http://{ip address>}:3000


const {run,icu,enroll,set_options} = require('icu-connect')

// start the ICU device with options
run({
    'ip':'192.168.137.8',
    'ssl':true,
    'port':44345,
    'username':<icu_username>,
    'password':<icu_password>
});



/* 
    connected event - an ICU device has been connected.
    data parameter is a JSON object giving device details
*/ 
icu.on('connected',function(data){
    console.log('device connection',data)
})


/* 
    connected event - an ICU device has been connected.
    data parameter is a JSON object giving device details
*/ 
icu.on('disconnected',function(){
    console.log('device disconnected')
})

/* 
    device_state event - data parmeter shows 'initialising' or 'ready'
*/ 
icu.on('device_state',function(data){
    console.log('state',data)
})


/* 
    A face has been detected by the ICU and a detection session has started
*/ 
icu.on('sessionstart',function(){
    console.log('start')
})

/* 
    The face is no longer detected by the ICU device
*/ 
icu.on('sessionend',function(){
    console.log('end')
})

/* 
    The detected face has not been identifed and estimated age is given
*/ 
icu.on('age',function(data){
    console.log('detected age (no id)',data.estimated_age)
})

/* 
    The detected face has been identifed as matching a stored ID
*/ 
icu.on('uid',function(data){
    console.log('detected age with id',data.estimated_age,data.uid)
})

/* 
    The face parameters have been saved in the system
*/ 
icu.on('face_saved',function(data){
    console.log('face_saved')
})


output

    device connection {
    DeviceId: '045dea23a',
    DeviceName: 'ICU-Touch',
    DeviceType: 'ICU-U-1',
    HwLevel: '10002',
    SWBuildVersion: '1070',
    Cameras: [
        { Name: 'ICU-Touch-camera', Type: 'usb', Data: '', Enabled: true },
        { Name: 'camera-2', Type: 'none', Data: 'none', Enabled: false }
    ]
    }
    state { device_state: 'initialising' }
    state { device_state: 'ready' }
    start
    detected age (no id) 42
    detected age (no id) 40
    detected age (no id) 42
    end

Example

A working example using node and this module can be found on github icu-connect-example-node