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

pcepbn

v0.1.3

Published

PCE Instruments PB-N scale command line interface (CLI), UNIX, LINUX, Mac OS X, Windows support

Downloads

10

Readme

Command Line Interface (CLI) for PCE-PB N-series scales

This program allows you to auto-discover and read PCE-PB N-scale devices attached to your computer. It currently supports to read weight measurement values (positive, negative) in various units, one-time and continuously for one or many scales at the same time.

It is tested to be working flawless on LINUX and Mac OS X. If you are interested in Windows or UNIX support, please see the "Untested" notice below. There is a chance to manage this, without code changes.

This software is primarily being developed and used by the BeeMon - Automated BeeHive monitoring project (https://github.com/kyr0/beemon)

The development team likes to thank PCE Deutschland GmbH a lot for supporting us actively!

Pre-requirements

Please note that you need to install the SILABS (SILICON LABS) CP210x USB to UART Bridge VCP Drivers to ensure this program is able to detect your PCE PB-N scale.

Please install the CP210x driver suitable for your operating system:

https://www.silabs.com/products/mcu/Pages/USBtoUARTBridgeVCPDrivers.aspx

Driver installation test: Mac OS X

Connect the PCE PB-N scale to your computer. Open a terminal (Cmd+Space, type "Terminal", hit "ENTER") and execute:

sudo kextstat | grep "CP210x"

If the output is somewhat like:

0 0xffffff7f82fc4000 0x7000     0x7000     com.silabs.driver.CP210xVCPDriver64 (3.1.0d1) <124 39 4 3>

The CP210x driver has been already/successful installed.

Driver installation test: LINUX/UNIX

Connect the PCE PB-N scale to your computer. Open a shell and execute:

sudo lsmod | grep "cp210x"

If the output is somewhat like:

cp210x                  8389  0
usbserial              26684  1 cp210x

The cp210x kernel driver for LINUX has been already/successful installed.

Installation

Runtime environment: Node.js

In order to run this command line tool you need install Node.js, the runtime environment, this program relies on. Node.js is a blazing fast, open source and free JavaScript runtime. It requires only minimal system resources:

http://nodejs.org/

Linux users may want to use the distributions package manager of choice. To do so, please follow the installation instructions on the following wiki page:

https://github.com/joyent/node/wiki/installing-node.js-via-package-manager

The "pcepbn" command line interface

After you've successfully installed Node.js, open a terminal and execute the following command:

sudo npm install -g pcepbn

This will automatically download and install the most recent version of the PCE PB N command line interface and install it globally (-g) so that you can execute the following command from now on, everywhere:

pcepbn

It should print the help screen of the program, like:

PCE Instruments PB-N scale CLI -- v 0.1.0

Lists of commands available in this version:

  help      Prints this help message
  discover  Detects PCE PB-N scales, outputs the device file(s)
  listen    Fetches the scales latest measurement value

Installation Special Cases

If you see some error occurring like "EACCES", please ensure that you didn't miss the "sudo" command at the beginning of the command line! (You need to be root to install kernel drivers and "pcepbn" globally!)

Installation Special Cases: Mac OS X

Please ensure that you have at a minimum the Xcode and Xcode Command Line Tools installed appropriate for your system configuration. If you recently upgraded the OS, it probably removed your installation of Command Line Tools, please verify before submitting a ticket.

To install xCode, open a terminal window (Cmd+Space, type "Terminal", hit "ENTER") and execute the following command:

gcc

If a installation prompt shows up, proceed with the installation of xCode and the xCode Command Line Tools by clicking the "Install" button. Re-run the "pcepbn" CLI installation.

Installation Special Cases: LINUX/UNIX

Please ensure that you have at a minimum the build environment essentials installed like GCC, make, etc. pp.

For Debian/Ubunu system you can install these tools via a single command:

sudo apt-get install build-essential

Untested: Support for Microsoft Windows and UNIX. Please get involved! :)

The under-laying implementation, runtime and libraries should allow this program to also run on platforms like Microsoft Windows 7, 8, 8.1 and a lot of UNIXes out there.

For Windows:

  • After the CP210x driver install has been finished...
  • Install Visual Studio Express 2013 for Windows Desktop.
  • Install node.js 0.10.x matching the bitness (32 or 64) of your operating system.
  • Install Python 2.7.6 matching the bitness of your operating system. For any questions, please refer to their FAQ. Default settings are perfect.
  • Open the 'Visual Studio Command Prompt' and add Python to the path.

For UNIX:

  • After the CP210x driver install has been finished...
  • Setup a build environment featuring gcc, make etc. pp.
  • Download the sources of Node.js and compile them

Then proceed with the installation of "pcepbn" using npm, but locally (without the -g option; this will install the CLI tool in the current working directory)

npm install pcbpbn
 

After all, you should find a file like: node_modules/pcepbn/bin/pcepbn.js.

Try to call it using "node" or "nodejs" (depends on the OS):

node node_modules/pcepbn/bin/pcepbn.js

It should print the help screen. Just append any option available to that command (like discover, listen).

We would be happy to hear from you, if you managed to run this tool on a non-officially-supported operating system/architecture! :-)

License

Copyright (c) 2015, Aron Homberg and the BeeMon development team. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.