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

pimatic-ethboard

v0.0.9

Published

Control ethernet/wifi devices by tcp/ip commands

Downloads

9

Readme

#pimatic-ethboard

Plugin to control ethernet/wifi devices by tcp/ip commands. Protocol is as defined for boards from - http://www.robot-electronics.co.uk.

There are different boards with a combination of the following onboard devices:

  • Relays (16A @ 24VDC / 230VAC)
  • Digital switching I/Os (NPN OC transistor with 10k)
  • Analog inputs (0-3,3V or 0-5V with 10 bits resolution)

This plugin is only for controlling and not for configuring the devices.

Note, this is an early version of the plugin provided for testing purposes. Please provide feedback via github.

Supported devices

Basically every device which respects the protocol used for communicating is supported. Base of development are the ethernet/wifi devices from robot-electronics.

robot-electronic ethernet/wifi devices have three numbers at the end of the device name giving the amount of the different supported devices by the board. The left number is the amount of analog inputs, the middle number represents the number of digital switching I/Os and the right number gives the number of relays.

There are the following standard devices available: ETH002, ETH008, ETH484, ETH8020 WIFI002, WIFI008, WIFI484, WIFI0820

Protocol description

| Action | Command | Response | | -------------------- | --------------------- | --------------------------- | | Get hardware id | 0x10 | 3 byte HW ident | | Set device active | 0x20 devId pulseTime | 1 byte, 0=success 1=failure | | Set device inactive | 0x21 devId pulseTime | 1 byte, 0=success 1=failure | | Get device states | 0x24 | 1 bit per device, min 1 byte per type [Relays,DigitalIOs] | | Get analog value | 0x32 devId | 2 bytes integer value (high byte first) | | Send auth string | 0x79 pwdBytes | 1 byte, 1=auth ok 2=failure | | Get auth state | 0x7A | 1 byte, 0=locked, 1-XX=auth timer 0xFF=disabled | | Set auth locked | 0x7B | no response |

Restrictions

Currently only the relay feature of an ETH002 is implemented and tested. The relay feature of the other boards should work out of the box. Additionally I've implemented the analog value feature with respect to the specifications.

Configuration

You can load the plugin by editing your config.json to include the following in the plugins section. The properties host and port are used to connect to the board. If you set a TCP password in the board configuration also set this password here. The property pingInterval specifies the time interval in seconds for updating the data set. For debugging purposes you may set property debug to true. This will write additional debug messages to the pimatic log. The values set in the example config afterwards represent also the default values.

{
      "plugin": "ethboard",
      "host": "192.168.0.200",
      "port": 17498,
      "pingInterval": 60,
      "password": ""
      "debug": false
},

Then you need to add a device in the devices section. Currently, only the following device types are supported:

  • EthRelay: This type is able to switch a relay and display its current state.
  • EthAnalogSensor: This type is able to provide analog values with a resolution of 10bit

As part of the device definition you need to provide the deviceid, which is the device number on the board. For relays you can also specify a pulseTime, where each increment counts as 100ms. If pulseTime expires the relay state will toggle back, while pulseType is one of ["none", "on", "off", "both"], what configures the states for which the pulseTimer will be activated.

{
      "id": "ethrelay01",
      "class": "EthRelay",
      "name": "Ethernet Relay 01",
      "deviceid": 1,
      "pulseType": "none",
      "pulseTime": 0
},
{
      "id": "ethanalog01",
      "class": "EthAnalogSensor",
      "name": "Ethernet Analog Sensor 01",
      "deviceid": 1
}

Contributions

Contributions to the project are welcome. You can simply fork the project and create a pull request with your contribution to start with.

History

  • 20160106, V0.0.1
    • Initial Version
  • 20160107, V0.0.2
    • Updated typos in readme
  • 20160107, V0.0.3
    • Synch version of git and npm
  • 20160112, V0.0.4
    • Added protocol info to README
    • fixed some typos in README and package.json
  • 20160112, V0.0.5
    • Fixed protocol table
  • 20160213, V0.0.6
    • Improved the JS test server
  • 20160213, V0.0.7
    • Improved command handling with FIFO
    • Added board type detection
    • Added analog sensor device
  • 20160416, V0.0.8
    • Fixed typo in README.md
    • Plugin supported by pimatic 0.9 (thanks @mwittig)
  • 20160502, V0.0.9
    • Added device destroy method for pimatic 0.9 support