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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@airiot/opcda

v4.0.62

Published

AIRIOT OPCDA 驱动安装程序 - 自动下载、配置和运行 OPCDA 驱动

Readme

@airiot/modbus

AIRIOT Modbus 驱动安装程序 - 自动下载、配置和运行 Modbus 驱动

快速开始

使用 npx(推荐)

# 自动安装并运行驱动
npx @airiot/modbus

# 传递数据配置
npx @airiot/modbus -d '{"id":"设备ID","name":"modbus","groupId":"分组ID","driverType":"modbus","runMode":"one","device":{"settings":{"interval":60,"ip":"设备IP","port":502,"unit":1}},"autoReload":{"disable":true},"autoUpdateConfig":true,"tables":[{"id":"modbus2","device":{"settings":{"autoAddr":true,"interval":5,"ip":"设备IP"},"tags":[{"area":3,"dataType":"Int32BE","id":"p1","name":"p1","offset":1,"policy":"save"}],"commands":[{"name":"cmd1","ops":[{"area":"coil","dataType":"Boolean","offset":1,"param":"cmd1"}]}]},"devices":[{"id":"modbus21","name":"modbus21","settings":{"unit":7}}]}]}'

# 强制更新到最新版本
npx @airiot/modbus --update

安装后使用

# 全局安装
npm install -g @airiot/modbus

# 运行驱动
@airiot/modbus

命令参数

| 参数 | 简写 | 说明 | |------|------|------| | --data <json> | -d | 传递 data.json 配置数据 | | --update | -u | 强制重新下载并更新驱动 |

运行方式

驱动会根据平台自动选择运行方式:

  • macOS/Windows: 使用 PM2 运行二进制文件
  • Linux: 使用 Docker 运行容器

前置要求

macOS/Windows:

npm install -g pm2

Linux:

# 安装 Docker
curl -fsSL https://get.docker.com | sh

配置文件

驱动启动时会自动生成 etc/config.yaml 配置文件:

http:
  host: 0.0.0.0
  port: 8080

driverGrpc:

mq:
  type: local
  local:
    logPublish: true
    logConsume: true
    showPayload: false

driver:
  id: modbus
  name: Modbus-TCP
  timeout: 10
  idle: 30

目录结构

airiot/lib/driver/modbus/
├── .version          # 当前安装版本
├── archive/          # 下载缓存
└── extracted/        # 驱动文件
    ├── etc/
    │   └── config.yaml
    └── modbus        # 二进制文件

故障排除

端口被占用

如果 8080 端口被占用,驱动会自动使用下一个可用端口(8081、8082...)。

PM2 相关问题

# 查看 PM2 运行状态
pm2 list

# 查看 PM2 日志
pm2 logs modbus-driver

# 停止驱动
pm2 stop modbus-driver

# 重启驱动
pm2 restart modbus-driver

# 删除驱动
pm2 delete modbus-driver

Docker 相关问题

# 查看运行中的容器
docker ps

# 查看容器日志
docker logs modbus-driver

# 停止容器
docker stop modbus-driver

# 删除容器
docker rm modbus-driver

版本管理

驱动会自动检测版本更新:

  • 首次运行:自动下载对应平台版本
  • 版本相同:使用已缓存的文件
  • 版本不同:提示使用 --update 参数升级

许可证

MIT

支持