natevw / pi-spi

Simple RasPi SPI library (node.js)
93 stars 14 forks source link

Error: SPI error: Inappropriate ioctl for device (errno 25) #19

Closed Maksims closed 7 years ago

Maksims commented 8 years ago

Running this code:

var SPI = require('pi-spi');

var spi = new SPI.initialize('/dev/spidev1.1');

var data = new Uint8Array([
    255, 0, 0,
    255, 255, 255
]);

spi.write(new Buffer(data), function(err, d) {
    console.log(err, d);
});

Gives error and exits application.

Although running test from end of this page verifies that SPI interface works as supposed to.

natevw commented 8 years ago

Can you post the error traceback? Does the user you are running the code with have permission to access the SPI device? (You can try temporarily with sudo to see if that fixes it, and either keep doing that as a permanent solution, or change the permissions to something suitable for your situation.)

Maksims commented 8 years ago

Was running it with sudo in first place. Without it gave clear error message that it had no access to serial.

natevw commented 8 years ago

Ok. I wonder, do you mean to have "1.1" for the SPI device path? Usually only "0.0" and "0.1" are available.

Maksims commented 8 years ago

It was a bit weird to have one, and it looked like it was latest SPI drivers from another vendor, created such device. And it actually worked.

I've reinstalled older OS and older drivers, and got only 0.0 and 0.1 now, and it works with them now. So I guess if those new drivers is what going to be used in future, then it is good to look onto them, but for now seems like links around the places, only point to older drivers and OS version.

natevw commented 8 years ago

What alternate driver were you using? I haven't followed the RasPi distro situation very closely, so is that something they're beta testing and might release soon?

natevw commented 7 years ago

Not hearing any more followup here, I think this must have been addressed. So I'll close this, but feel free to re-open if it still needs attention.