Installations
npm install @woifes/node-yasdi
Developer Guide
Typescript
Yes
Module System
CommonJS
Node Version
18.18.2
NPM Version
9.8.1
Score
58.7
Supply Chain
94.5
Quality
76.4
Maintenance
100
Vulnerability
79
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
C (90.76%)
TypeScript (5.19%)
C++ (1.69%)
CMake (0.92%)
Python (0.78%)
JavaScript (0.66%)
Developer
woifes
Download Statistics
Total Downloads
383
Last Day
1
Last Week
8
Last Month
32
Last Year
301
GitHub Statistics
9 Commits
1 Watching
1 Branches
1 Contributors
Bundle Size
49.39 kB
Minified
13.49 kB
Minified + Gzipped
Package Meta Information
Latest Version
1.2.0
Package Id
@woifes/node-yasdi@1.2.0
Unpacked Size
1.09 MB
Size
235.95 kB
File Count
181
NPM Version
9.8.1
Node Version
18.18.2
Publised On
17 Jun 2024
Total Downloads
Cumulative downloads
Total Downloads
383
Last day
0%
1
Compared to previous day
Last week
60%
8
Compared to previous week
Last month
966.7%
32
Compared to previous month
Last year
267.1%
301
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
@woifes/node-yasdi
Why?
This package binds the yasdi library to a nodeJS package which may be used for other projects. The yasdi library is a open source library provided by SMA, which enables the connection to SMA products. This package was only used for/used with:
- Reading the data of inverters via RS485
- A cheap USB-RS485 converter via a raspberry pi
On windows I only succeeded to compile the bindings but did not try it
Please check the source code before using this package
Installation
1npm install @woifes/node-yasdi
Quick start
Using node-yasdi in your program
1import { NodeYasdi } from "@woifes/node-yasdi"; 2 3const nodeYasdi = new NodeYasdi("myPlant", { 4 expectedDeviceCount: 3, 5 //serialPorts: ["path/to/serialDevice"] //on linux you can also use a link as a device like "/dev/serial/by-path/<usbDeviceLink>" 6 //iniFileDir: "path/to/dir/where/iniFile/may/be/created 7}, "path/to/iniFile.ini"); //either provide 'serial ports' and 'iniFileDir' in config, or the ini file directly 8await once(nodeYasdi, "deviceSearchEnd"); //the yasdi library can not fetch data before this event 9 10let inverter01 = nodeYasdi.getInverterBySerial(nodeYasdi.handles[0]); 11 12let values = await inverter01.getData(5);
Using node-yasdi shell
1pnpm run createIni 2> my.ini #follow instructions to create a yasdi compatible ini file 2 3pnpm run shell <path/to/my.ini> #run the shell with a given ini file
Remarks regarding yasdi and its LGPL
Here are the instructions how one can build a custom version of the yasdi library into this package (according to LGPL v2.1 with statically linked libraries). (It is assumed that the nodeJS related development is known.)
The following list describes where you find the different parts involved in the build:
- The yasdi source code lies in the bin folder
- The bindings (glue code) also lies in the bin folder
This file was created by investigating the cmakefile delivered with yasdi, some time with trial and error - The build is configured via the bindings.gyp file
- Additionally there is an interface of the bindings for TypeScript defined in src
Changes made to yasdi
- in
bin/yasdi-1.8.1build9-src/os/os_linux.h
: changed include from#include <termio.h>
to#include <termios.h>
so that it compiles on alpine linux
For running the build see the following section.
Running the build
Build yasdi library and bindings:
1pnpm run build
TypeScript build:
1pnpm run compile
Run tests:
1pnpm test
No vulnerabilities found.
No security vulnerabilities found.