2

After connecting the USB to the raspberry pie,

I have loaded the devices with node-usb .

The desired device was found by the device's VID and PID.

Then I open the device and try to read the data.

But this._open () , error: LIBUSB_ERROR_ACCESS I get this error occured.

How do I give permission?

I did not solve it even though I tried this.

fs.chmod('/media/pi/EFD0-AA20', 511);

below is my code.

usb.on('attach', function(device) {

    var devices = usb.getDeviceList();
    var sandisk_ultrafit = usb.findByIds(1921, 21891);
    sandisk_ultrafit.open();

});
Ben Fortune
  • 31,623
  • 10
  • 79
  • 80

1 Answers1

0
  1. cd /etc/udev/rules.d
  2. Create a file named "myVender.rules"
  3. SUBSYSTEM=="usb", ATTRS{idVendor}=="--VID--", MODE="0666" SUBSYSTEM=="usb_device", ATTRS{idVendor}=="--VID--", MODE="0666"
  4. replace "--VID--" with the vender ID of your device (USB device)

In My Linux Machine

  1. enter image description here

  2. VID of my usb is 0781