I decided to try to make my first plugin and I have little problem. Maybe because I’m beginner I cant solve it but when I want to install npm module I get this:
volumio@volumio:~$ sudo npm install onoff
[sudo] password for volumio:
> epoll@4.0.1 install /home/volumio/node_modules/epoll
> node-gyp rebuild
gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/8.11.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/volumio/node_modules/epoll/.node-gyp"
gyp WARN EACCES user "root" does not have permission to access the dev dir "/home/volumio/node_modules/epoll/.node-gyp/8.11.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/volumio/node_modules/epoll/.node-gyp"
gyp WARN EACCES user "root" does not have permission to access the dev dir "/home/volumio/node_modules/epoll/.node-gyp/8.11.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/volumio/node_modules/epoll/.node-gyp"
gyp WARN EACCES user "root" does not have permission to access the dev dir "/home/volumio/node_modules/epoll/.node-gyp/8.11.1"
Hello.
First, never SSH as root but use user Volumio instead.
Second, you have to work in your plugin folder. The file package json include the list for npm package.
You don’t need sudo from there.
Have a look at the doc and at other plugins.
volumio@volumio:~/volumio-plugins/plugins/system_controller/test$ npm i onoff
> epoll@1.0.2 install /home/volumio/volumio-plugins/plugins/system_controller/test/node_modules/epoll
> node-gyp rebuild
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack at getNotFoundError (/lib/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack at F (/lib/node_modules/npm/node_modules/which/which.js:68:19)
gyp ERR! stack at E (/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack at /lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack at /lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:42:5
gyp ERR! stack at /lib/node_modules/npm/node_modules/which/node_modules/isexe/mode.js:8:5
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Linux 4.19.118-v7l+
gyp ERR! command "/bin/node" "/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/volumio/volumio-plugins/plugins/system_controller/test/node_modules/epoll
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN test@1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! epoll@1.0.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the epoll@1.0.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/volumio/.npm/_logs/2021-07-30T07_55_15_839Z-debug.log
Running into the same problem with the Volumio 3 beta (image 3.129). Loving the Buster part btw, I’m now trying to check “my” plugins for compatibility issues.
The same problem being: trying to install onoff, which triggers epoll to be rebuilt and node-gyp failing to do so.
Any tips? Also, is it ‘good practice’ to use bundled modules rather than fetch your own module per plugin? From a re-usability I’d say yes, but this also means Volumio should always pack those from a compability point of view
Update: fun fact! All of a sudden everything works. Possibly required a reboot after installing build-essential (and a few failed attempts)
I spent quite some time pruning all the unused module, only to later find out that modules were consciously pre bundled for other closed parts of the Volumio eco system…
But considering the age of the modules bundled, probably not the best idea to depend on them
This is also good to know, thanks for clarifying. On the other hand, I can also imagine a central repo for all plugins could be considered beneficial. Oh well, there’s plenty of stuff that’s “nice to have”, I’ll focus on getting stuff up-and-running on Buster first
Can I trouble you for some help.
I am trying to get Saiyato’s rotary encoder working.
Ive followed your method of getting the GPIO plugin to work and that does work OK. But the rotary encoder, goes through the same motions then the plugin fails to start and also upon reboot something stops volumio webpage from loading at all.
this is how I tried
sudo apt-get update
sudo apt-get -y install build-essential
cd ~
wget http://plugins.volumio.org/plugins/volumio/armhf/user_interface/rotaryencoder/rotaryencoder.zip
mkdir ./rotary
miniunzip rotaryencoder.zip -d ./rotary
cd rotary
volumio plugin install
cd /data/plugins/user_interface/rotaryencoder
npm install --save onoff@6.0.0
I Have already, tried that plugin. Which as you say can be installed OK and also loads up fine.
Although I just cannot get it working correctly, It seems very flaky. the push button if set to play/pause when clicked plays sometimes but 90% of the time instanly goes straight back to pause. The rotary part just doesnt work at all in V3. Even in volumio 2 the rotary was very erratic.
Yet Saiyato’s rotary plugin works perfectly for me in V2.
Did you do anything other than you wrote above to get Rotary Encoder II working in V3
I just spent some time getting it up and running with Volumio 2, changed a few component values to fine tune the hardware debouncing. Rotary encoder II now works spot on on volumio 2.
But still nothing with the rotary in V3, button works fine though to play and pause. seems strange.
in the live log every time i press save for the encoder settings, at the bottom is always Process '/usr/sbin/th-cmd --socket /var/run/thd.socket --passfd --udev' failed with exit code 1.
so im guessing this is the issue, which is starting to get beyond me.