node-red-contrib-axeapi v1.0.5
node-red-contrib-axeapi
This package includes a set of Node-RED nodes which are designed to communicate with Axiomtek EAPI C/C++ library running on your local machine.
Update on 2022/01/12: New Node-RED nodes for RDM (Remote Device Management) are created. Native addon (src/ax-eapi-rdm.cpp
) for RDM C/C++ library is also added. This requires the new EAPI library with RDM support. The define EAPI_ID_RDM_FIRMWARE_VERSION
in the file EApi.h
is checked. If not defined, RDM's native addon will not be built. The Node-RED nodes for RDM would not work.
Requirements
- A Node-RED native addon using N-API to provide an interface to Axiomtek EAPI C/C++ library from JavaScript running in Node.js. This natvie addon is included in the package.
- The Axiomtek EAPI library must be installed.
Installation
- Copy or download the released package.
Uncompress the package.
tar xzf axiomtek-eapi-node-red.tar.gz cd node-red-contrib-axeapi
Install the node-red dependencies
npm install
Set the variable
AX_EAPI_LIB_DIR
in the binding.gyp file to thelibax_eapi
directory on your machine.Build the native addon
npm install -S node-addon-api npm run build
Run the following command in your Node-RED user directory - typically
~/.node-red
npm install
Usage
After installation you will find the nodes inside the Node-RED palette. These installed EAPI nodes include:
- ax-hwmon (HW Monitor)
- ax-dio in (DIO/GPIO Input node)
- ax-dio out (DIO/GPIO Output node)
- ax-wdt (Watchdog node)
- ax-board (Board Info node)
These installed RDM nodes include:
- rdm-edidemu (EDID Emulator node)
- rdm-system (System node)
- rdm-lan (LAN node)
- rdm-usb (USB node)
- rdm-hdmi (HDMI node)
- rdm-schedule (Display Schedule node)
- rdm-wd (Watchdog node)
Input/Output
For more information on the input/output of each node, please refer to the help text in the info tab.
Testing
Automated test scripts are created to test and verify all Node-RED nodes and
the native addon for EAPI C/C++ library. The JavaScript unit test framework
Mocha
is used. In addition, there is an option to report the test results
to Axiomtek's TestLink server.
By default, reporting to TestLink is disabled. Add the option --global testlink
to the Mocha command-line, as follows:
mocha --global testlink test/nodes/hwmon_spec.js --reporter ./test/ax_reporter.js
To run Mocha without reporting, use this command:
mocha test/nodes/hwmon_spec.js --reporter ./test/ax_reporter.js
Or to run Mocha with the default reporter spec
, use this command:
mocha test/nodes/hwmon_spec.js
Test Configuration
Before you run any automated tests with TestLink reporting enabled, you need
to modify the test configuration file ./test/_test.config.js
. In this file,
the following TestLink related parameters need to be modified:
- Tester's apiKey
- Tester's account name
If you want to report to a different TestLink project, then you need to provide the following information in this file:
- Your test plan ID
- Prefix for the test cases.
- Your build ID
- Your platform ID