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

node-addlep8

v0.3.2

Published

Connect to pakedge p8 using telent, and turn stuff on and off

Downloads

23

Readme

node-addlep8

Command the Pakedge P8 using nodejs

connection.js is the telnet wrapper. Connection.run_command("<args>") will create a telnet connection and run args on the PDU.

Use power.js <ip address> <args> to test this out

pdu.js

the psu manager can be required with node:

var Manager = require('node-addlep8');

then make a new Manager object. You will need the ip address, username and password for the p8 you are using:

var pdu = new Manager('192.168.30.210', 'pagedge', 'pakedgep');

The manager object has five public methods. Each uses standard callbacks because someone doesn't like promises yet.

Manager.run_command(command, callback)

Takes a string, command, and runs it on the p8. Use node power.js <ip_address> help to see a full list of commands.

Manager.get_status(callback)

Gets the status off all outlets. The default P8 will look like this:

[ { id: '1', name: 'Modem', status: 1 },
  { id: '2', name: 'Router', status: 1 },
  { id: '3', name: 'Switch 1', status: 1 },
  { id: '4', name: 'Switch 2', status: 1 },
  { id: '5', name: 'Aux 1', status: 1 },
  { id: '6', name: 'Aux 2', status: 1 },
  { id: '7', name: 'Aux 3', status: 1 },
  { id: '8', name: 'Aux 4', status: 1 } ]

Manager.get_power(outlet, callback)

Looks at outlet outlet and responds with 1 (on) or 0 (off). outlet can be an id number or the name of the outlet as a string.

Manager.set_power(outlet, callback)

Sets outlet(id or name) to state(1,0).

Manager.set_power_all(state, callback)

Sets all outlets to state(1,0)

Setting up your PDU

  • First, connect both your computer and the P8 in a 192.168.1.XXX network. Use your browser to navigate to http://192.168.1.210/, which is the P8’s web interface. Depending on how long ago you plugged in the P8, it may take about 3 minutes before the web interface is available.
  • Enter the Network Setup page, where you should be able to edit the Static IP.
    • Do not hit submit unless you are done changing settings, as you will be disconnected.
    • The new IP address must have the same subnet as the machine running this module.
  • After hitting submit, unplug the P8 from the current network and plug it into the network you normally will connect to it over.
    • If you had to unplug the power to do so, remember that it will take a minute or two before the P8 is up and running again.
  • You should be able to navigate to the new IP address and access the web interface again.
    • While you are changing settings, make sure to leave Enable Telnet, in System Control, turned on, as this module can't access it otherwise.

If you mess up any of these steps, don’t worry! There is a tiny reset button that may or may not set you back to the first step! I haven’t tried it, but it should be perfectly safe…

P8 Command List

command | description -------------------:|------------------------- ul | show userlist exit | end the telnet session ver | show the hw/sw version date | show current device date time | show current device time temp | read temperature sensor cura | read current sensor "a" ssn 0x12345678 | show serial num sshow | displays console ports configuration status pshow | displays power outlet status ptshow | displays power outlet timer information. *pset n v | Sets power outlet #n to v(value 1-on, 0-off) *ps v | Sets all power outlets to v(value 1-on, 0-off) *prb n | Reboot power outlet #n *prsv n | Reserve power outlet #n for current user *punrsv n mac | Unreserve power outlet #n for current user mac | show the mac addr #acl 0/1 | Disable/Enable ACL (0=disable, 1=enable) #aclset id type mask| Set up the ACL - id(1-6), type(0=Not Care/1=Permit/2=Block), mask(ip) #web 0/1 | disable/enable web access #pop3 0/1 | disable/enable pop3 access #telnet 0/1/2 | config telnet access to disable/login_only/enable #telnetEcho 0/1 | disable/enable telnet echo #dhcp | do dhcp routing #ip XXX.XXX.XXX.XXX | set network static ip #gw XXX.XXX.XXX.XXX | set network gateway #netmask 255.255.255.0 | set network netmask #ifconfig s | do network interface config (s = auto/dhcp/static) nwshow | display network status #reboot | reboot whole PDU help | show help messages *! | Repeat the last command