
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
megapi-node-client
Advanced tools
Unofficial MegaPi Node.js client derived from the unmaintained Makeblock library.
This projects brings the following major improvements:
Works with MegaPi firmware 0e.01.016
and USB connection.
WARNING: not all functions work. Some functions were not working in the original project and haven't been fixed (PRs welcome).
Commented functions indicate the ones that have been tested.
Assuming that you are running Node.js on a Raspberry Pi connected to MegaPi via USB.
npm install megapi-node-client
/dev/ttyUSB0
port depending on where you plug the USB cable. You can also pass options to the MegaPi constuctor (not shown here, see API section for details).import MegaPi from 'megapi-node-client';
const megaPi = new MegaPi('/dev/ttyUSB0');
await megaPi.connect();
await megaPi.encoderMotorMove(1, 100, 500);
await megaPi.encoderMotorMove(3, 100, 300);
await megaPi.disconnect();
Documentation is kept in the code (JSDoc) but here's an overview of what's available.
The client is build by calling this constructor: MegaPi(port = '/dev/ttyAMA0', options = {})
.
Options are the following:
Option | Default | Description |
---|---|---|
isDebugMode: boolean | false | whether debug mode is enabled. Debug mode will output serial I/O to logs. |
logger: Object | console | class that is used to write logs. Use this to plug in a logging library like Winston. |
logWelcomeMessage: boolean | true | whether to log the welcome message that indicates the firmware version. |
Functions annotated with ✔ have been tested with hardware, are documented and are know to work. The others may or may not work.
Main
GPIO
Motion
Sensors
Display
DSLR Shutter
FAQs
Unofficial MegaPi Node.js client
The npm package megapi-node-client receives a total of 14 weekly downloads. As such, megapi-node-client popularity was classified as not popular.
We found that megapi-node-client 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.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.