@acst11/node-raspberrypi-usbboot 中文文档教程

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

node-rasbberrypi-usbboot

将 Raspberry Pi 计算模块和 Zeros 转换为大容量存储设备。

Usage

有关用法,请参阅示例

在大多数 GNU/Linux 发行版上,您需要以 root 身份运行它。

导入 UsbbootScanner,实例化它,然后在实例上附加以下事件侦听器:

  • attach: a device was connected and we started transforming it to a mass storage device;
  • detach: a device was detached, note that this could mean that it was physically detached or that it was successfully transformed into a mass storage device;
  • error: an error occured.

attachdetach 事件侦听器将获得一个 UsbbootDevice 作为参数。 此对象将发出 progress 事件,其参数是完成百分比。 当设备将自身重新连接为大容量存储设备时,进度将为 100。 这之后将是 UsbbootScannerdetach 事件(因为设备 将不再是 usbboot 设备)。

Details

这在很大程度上基于 Raspberry Pi USB 启动代码

它应该支持 Raspberry Pi Compute Modules 和 Raspberry Pi Zeros。

该模块将向 pis 上传一个比上面的原始代码稍微复杂的内核,它允许设备 以更长的准备阶段为代价达到更高的写入速度。

Troubleshooting

如果您在使用此模块时遇到任何问题,请检查它是否适用于上面的原始 USB 引导链接。

您可以通过将 DEBUG env var 设置为 node-raspberrypi-usbboot 来启用调试输出。

node-rasbberrypi-usbboot

Transforms Raspberry Pi Compute Modules and Zeros to mass storage devices.

Usage

For usage, see the example.

On most GNU/Linux distributions, you'll need to run this as root.

Import UsbbootScanner, instanciate it, then on the instance attach the following event listeners:

  • attach: a device was connected and we started transforming it to a mass storage device;
  • detach: a device was detached, note that this could mean that it was physically detached or that it was successfully transformed into a mass storage device;
  • error: an error occured.

The attach and detach event listeners will get a UsbbootDevice as parameter. This object will emit progress events which parameter is the percentage of completion. The progress will be 100 when the device reattaches itself as a mass storage device. This will be followed by a detach event from the UsbbootScanner (because the device will no longer be a usbboot device).

Details

This is heavily based on Raspberry Pi USB booting code.

It should support Raspberry Pi Compute Modules and Raspberry Pi Zeros.

This module will upload a slightly more complex kernel to the pis than the original code above, it allows the devices to reach higher write speeds at the cost of a longer preparation phase.

Troubleshooting

If you have any trouble using this module, please check if it works with the original usb boot link above.

You can enable debug output by setting the DEBUG env var to node-raspberrypi-usbboot.

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