Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
An event-driven Arduino to Node.js adapter.
Support is pretty basic so far:
$ npm install eventduino
Compile and upload the sketch
in src/eventdu
. This sketch
listens for commands and watches for changes to pins via the watch
command.
The bulk of the sketch
is the parser.
The protocol is very minimal. It includes a command
, up to ten
arguments, and optional comments. Total packet size is currently limited to 1024 bytes
.
Currently defined commands and responses:
init
exception
pong
get
, arguments are the pin
and the value
pin
and the value
pin
, emits watch
with apin
and value
on changepin
<packet> ::= <command> <argument> <comment> <EOL>
<command> ::= [0-9a-zA-Z][0-9a-zA-Z]
<argument> ::= <NULL>
| ':' [0-9]+ ':' [0-9a-zA-Z]+
| <argument>
<comment> ::= <NULL>
| '#' [0-9a-zA-Z]+
The event system is pretty straightforward. On initialization an init
event is emitted, at which point further commands can executed.
var eventduino = require('eventduino');
var ardy = new eventduino({ serialport: '/dev/tty.usbmodemfa131' });
ardy.on('pong', function () {
console.log("PONG!");
});
ardy.on('init', function (args, comment) {
console.log('Eventduino init version ' + comment);
ardy.ping();
});
Getting and setting of pins
is very simple. The pin mode is changed automatically. It is possible to get
and set
both digital and analog pins.
var eventduino = require('eventduino');
var ardy = new eventduino({ serialport: '/dev/tty.usbmodemfa131' });
ardy.on('get', function (args) {
console.log("pin " + args[0] + " is set to " + args[1]);
});
ardy.on('init', function (args, comment) {
console.log('Eventduino init version ' + comment);
// get the value of analog pin 1
ardy.get(eventduino.A1);
// set the LED pin to HIGH (1)
ardy.set(13, 1);
});
Eventduino can be set into watch mode, which will check for any changes to the pin
and send a command if one occurs. A watch
can be setup on as many pins
as required. As analog pins can have a very active variance, a second parameter variance
can be passed for analog pins: an event
will only be emitted if the value read on watch
changes past the variance
.
var eventduino = require('eventduino');
var ardy = new eventduino({ serialport: '/dev/tty.usbmodemfa131' });
ardy.on('watch', function (args) {
console.log("pin " + args[0] + " is now set to " + args[1]);
// stop watching pin 5 on first change
if (args[0] === 5) {
ardy.unwatch(eventduino.A5);
ardy.set(13, 1);
}
});
ardy.on('init', function (args, comment) {
console.log('Eventduino init version ' + comment);
ardy.watch(1);
// only emit the event if +- 5 on the read
ardy.watch(eventduino.A5, 5);
});
FAQs
Evented Arduino for Node.js
The npm package eventduino receives a total of 0 weekly downloads. As such, eventduino popularity was classified as not popular.
We found that eventduino demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.