433mhz 中文文档教程

发布于 3年前 浏览 31 项目主页 更新于 3年前

433MHz

使用 433MHz 发送器在 Raspberry Pi 上传输数据的节点包。

注意:我为便宜的远程插座制作了这个,我不知道这对其他设备是否真的有用哈哈。

注意命令注入:您传递给 transmitCode 的二进制代码直接传递给 exec(没有清理)!

Installation

npm install 433MHz

Usage

const { transmitCode } = require('433MHz');

// Input the code that you want to be transmitted
transmitCode('1111111111111111111010111');

// You have multiple options to customize the transmission
transmitCode('1111111111111111111010111', {
  transmitPin: 18,
  shortDelay: 0.001,
  longDelay: 0.005,
  packetDelay: 0.05,
});

Options

transmitPin

这是 pin,发送器的数据引脚连接到 GPIO 上。 默认值: 18

shortDelay

引脚输出状态变化之间的短暂延迟。 默认值: 0.00037

longDelay

引脚输出状态变化之间的较长延迟。 默认值: 0.00101

packetDelay

代码数据传输尝试(数据包)之间的延迟。 默认值: 0.01102

Changelog

Version 2.0.0

  • transmitCode now returns a Promise and the callback option has been removed
  • transmitCode is no longer the exported default, use const { transmitCode } = require('... instead

Version 1.1.0

  • Legacy version

由 Lukas von Mateffy 制造 (@Capevace)

433MHz

A Node package to transmit data on a Raspberry Pi using a 433MHz sender.

Note: I made this for my cheap remote outlets, I don't know if this is actually useful with other devices lol.

Be aware of command injection: the binary code you pass to transmitCode is passed directly into exec (no sanitization)!

Installation

npm install 433MHz

Usage

const { transmitCode } = require('433MHz');

// Input the code that you want to be transmitted
transmitCode('1111111111111111111010111');

// You have multiple options to customize the transmission
transmitCode('1111111111111111111010111', {
  transmitPin: 18,
  shortDelay: 0.001,
  longDelay: 0.005,
  packetDelay: 0.05,
});

Options

transmitPin

This is the pin, the data pin of the transmitter is connected to on the GPIO. Default: 18

shortDelay

The short delay between pin output state changes. Default: 0.00037

longDelay

The longer delay between pin output state changes. Default: 0.00101

packetDelay

The delay between attempts (packets) of code data transmitted. Default: 0.01102

Changelog

Version 2.0.0

  • transmitCode now returns a Promise and the callback option has been removed
  • transmitCode is no longer the exported default, use const { transmitCode } = require('... instead

Version 1.1.0

  • Legacy version

Made by Lukas von Mateffy (@Capevace)

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文