Kwaadpepper / msi-keyboard-CLI

Just a nodejs cli to control https://github.com/stevelacy/msi-keyboard
http://freethepepper.com
GNU General Public License v2.0
64 stars 13 forks source link

Could not send feature report to device #1

Closed JuanCAlpizar closed 8 years ago

JuanCAlpizar commented 9 years ago

Hello, I tried to use this repo as the readme specifies, but when I try to run node msi-keyboard-CLI.js or adding any params returns the following message:

/home/jc/.msi-klm/msi-keyboard-CLI/node_modules/msi-keyboard/lib/setColor.js:24
keyboard.sendFeatureReport(activate);
         ^

Error: could not send feature report to device
at Error (native)
at module.exports (/home/jc/.msi-klm/msi-keyboard-CLI/node_modules/msi-keyboard
/lib/setColor.js:24:11)
at HID.board.color (/home/jc/.msi-klm/msi-keyboard-CLI/node_modules/msi-keyboard/lib/findKeyboard.js:12:3)
at /home/jc/.msi-klm/msi-keyboard-CLI/msi-keyboard-CLI.js:251:16
at FSReqWrap.cb [as oncomplete] (fs.js:212:19)

I have the msi-keyboard installed from the other repository, I'm running the commands as root and I'm using an MSI-GT72 steelseries keyboard. Am I missing something?

Kwaadpepper commented 9 years ago

Did you use npm install to get dependencies from this project ? Also i see you are using node, maybe its version is too old, on ubuntus there are node and nodejs, which aren’t the same. you could try

sudo apt-get remove node
sudo apt-get install nodejs
sudo ln -s /usr/bin/nodejs /usr/bin/node
msibacklight -k on

I'm using nodejs v0.10.25 and npm 1.4.21, it is working fine here

Please let me know if your if your issue get solved

JuanCAlpizar commented 9 years ago

Do you mean npm install over this module or over msi-keyboard module? I did under msi-keyboard one, if I make a npm install under this directory I get the following ouput

npm WARN package.json led-manager@ No repository field.
npm WARN package.json led-manager@ No license field.

I'm using opensuse 13.2, I'll check if there's also a node and nodejs here, if I type npm version I get the following output:

{ npm: '2.14.2',
  ares: '1.10.1-DEV',
  http_parser: '2.5.0',
  modules: '46',
  node: '4.0.0',
  openssl: '1.0.2d',
  uv: '1.7.3',
  v8: '4.5.103.30',
  zlib: '1.2.8' }

EDIT: after checking the nodejs package form my distro it says it provides the following:

Version:
4.0.0-2.3.1
Provides:
nodejs = 4.0.0-2.3.1
nodejs(abi) = 0.10
nodejs(engine) = 4.0.0
npm = 2.14.2
nodejs(x86-64) = 4.0.0-2.3.1
/usr/bin/node
Kwaadpepper commented 9 years ago

I updated the installation instructions in this github. You shoud just download this repo and do npm install in it, there is no need t handle msi-keyboard separatly as this project use it as a dependency with the help of npm which is a dependency handler.

so just use this as needed (starting with git clone in your case), and do the npm install in the cloned project

sudo apt-get install npm nodejs
sudo ln -s `which nodejs` /usr/bin/node
git clone https://github.com/Kwaadpepper/msi-keyboard-CLI.git ~/.msi-klm
cd ~/.msi-klm
npm install
msibacklight -k on
(OR)
sudo nodejs msi-keyboard-CLI.js -k on

EDIT: indeed npm install was missing in the installation instructions, it is needed nevertheless.

JuanCAlpizar commented 9 years ago

I wasn't home, I'll check it out and update as soon as possible :+1:

JuanCAlpizar commented 9 years ago

Back: just two things on the new instructions:

Is there a way to add an option for node as well? How can I tweak it on my own?.

After uninstalling msi-keyboard via the following command:

 sudo npm -g uninstall msi-keyboard
root's password:
unbuild msi-keyboard@0.0.4

to make a clean install, type npm install under the folder and attempt to run it as node msi-keyboard-CLI.js -k on I still get this error:

jc@linux-dbvn:~/.msi-klm> node msi-keyboard-CLI.js -k on
/home/jc/.msi-klm/node_modules/msi-keyboard/lib/setColor.js:24
    keyboard.sendFeatureReport(activate);
             ^

Error: could not send feature report to device
    at Error (native)
    at module.exports (/home/jc/.msi-klm/node_modules/msi-keyboard/lib/setColor.js:24:11)
    at HID.board.color (/home/jc/.msi-klm/node_modules/msi-keyboard/lib/findKeyboard.js:12:3)
    at /home/jc/.msi-klm/msi-keyboard-CLI.js:251:16
    at FSReqWrap.cb [as oncomplete] (fs.js:212:19)

I've heard this works for GT70 Keyboard, just in case you missed it and that matters mine is the next model, a GT72 MSI laptop with the steelseries keyboard.

A very interesting fact however is they keyboard has a button to turn the lights on, and whenever I reboot from windows and boot in openSUSE, the keyboard lights work with just turning on the button, but if I'm turning the laptop on straight from openSUSE some of the leds are not recognized and the colors are all set to white.

Kwaadpepper commented 9 years ago

Is there a way to add an option for node as well? How can I tweak it on my own?.

I just made a quick change so it would work now with both node and nodejs

When you type git clone https://github.com/Kwaadpepper/msi-keyboard-CLI.git it will create a new folder msi-keyboard-CLI and put the files inside, so just typing npm install under .msi-klm will fail because it won't find pakage.json in the current folder, when I copied the content of the msi-keyboard-CLI into .msi-klm it worked after sudo

Thank you for pointing this out i just corrected on the README

Now you've installed properly this looks pretty sure it is a issue with msi-keyboard itself.

Just two thing before, did you have any error during npm install ? Have you installed libusb-dev or equivalent in opensuse (using redhat i think) so could be libusb-1_0-0 libusb-devel or something like that This is a development package so you may have to do an extra move like described here https://forums.opensuse.org/showthread.php/435722-about-installing-development-packages

Now regarding this open issue https://github.com/wearefractal/msi-keyboard/issues/9 on the msi lib it should be working on GT72.

EDIT: i just found this package https://build.opensuse.org/package/show?project=hardware%3Alibusb0&package=libusb maybe

JuanCAlpizar commented 9 years ago

Yes, I have libusb-1_0-0 libsub-1_0-devel and some compatibility libraries. About node I don't remember having any issues, I use other modules like ripple-emulator and they work. I was going to escalate this to msi-keyboard package because it looks an issue over there to be honest and not your fault but looks like you already did, thanks :+1: hopefully we'll find out what's going on soon

Kwaadpepper commented 9 years ago

Agreed, you may also open a new thread anyway i think on msi-keyboard. I just link this one and it wasn't intentional (some automatic behaviour of github)

JuanCAlpizar commented 8 years ago

With the new instructions and some updates since this was written, the commands are working flawlessly now, so I'm closing this issue. The only thing not working are some two lights of the keyboard has in front of the laptop, one to the right side on the power, cpu and battery indicators and the other one at the left side of the laptop, I'm not sure if that's because of the original project not recognizing that region from the G72 keyboard. or if it needs to be added to the cli

Kwaadpepper commented 8 years ago

FIY the cli is using all the orignal lib possibilities, it may evolve or you may point out on the lib the possibilities of your own laptop. Then this could be updated. Glad it is working for you now.

jcplu commented 8 years ago

Same thing for me.

npm install -g ny ny 0.10.25 npm 1.4.21

working