I am trying to get a Nodejs program I wrote for my Raspberry Pi 2 to run on my BPi-M64. The program uses fivdi/onoff library to read and write to the GPIO of my RPi2 w/o issue. But when I try to run the program on my BPi-M64 I get the error;
Unable to parse revision information in /proc/cpuinfo
Unknown board revision , assuming Raspberry Pi Zero/2/3 pinout. Unless you are running a compute module or very old RPi this should work fine. Please report this board revision in a GitHub issue at https://github.com/nebrius/raspi-board.
fs.js:646
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: EACCES: permission denied, open '/sys/class/gpio/export'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.writeFileSync (fs.js:1299:33)
at new Gpio (/home/pi/reefbuddy-server/node_modules/onoff/onoff.js:96:10)
at Object.<anonymous> (/home/pi/reefbuddy-server/reefbuddy.js:9:22)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function.Module.runMain (module.js:694:10)
I’ve seen some on the Raspberry Pi forums report similar issues and say that they were able to resolve them by adding rules to the udev
directory but I haven’t had success with this.
How can I grant permission non root user to access the GPIO on the BPI-M64?
OS:Debian 9(Stretch) Node version: 8.16.1 kernel: 3.10.105