fbacker / broadlink-mqtt-bridge

Bridge Broadlink RM Devices with MQTT and API for e.g. OpenHAB
41 stars 14 forks source link

Error when using AutoInstaller #27

Closed combatistor closed 4 years ago

combatistor commented 4 years ago

Hi, when I install the application using the autoInstaller I keep getting this message from node when installing dependencies

Unhandled rejection Error: Command failed: /usr/bin/git submodule update -q --init -- 
recursiveopenhab2-conf/broadlink-mqtt-bridge/node_modules/.st
fatal: Could not change back to '/root/.npm/_cacache/tmp/git-clone-8feb9b0d': Permission denied

at ChildProcess.exithandler (child_process.js:289:12)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:962:16)
at Socket.stream.socket.on (internal/child_process.js:381:11)
at Socket.emit (events.js:182:13)
at Pipe._handle.close (net.js:606:12)

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-12-02T23_48_42_196Z-debug.log
Unable to install dependencies!

I could somehow fix the problem by executing the bash script manually and modify the package.json file and changing the line
"broadlinkjs-rm": "git+https://github.com/fbacker/broadlinkjs-rm" by "broadlinkjs-rm": **"file:insert_broadlinkjs-rm_path_here"**

and run npm install --production

Is there a way to fix this issue? I'm not sure if I'm the only one having this problem...

Thank you

fbacker commented 4 years ago

Sounds like permission issue. What happens if you run the installer script with sudo ?

If not working

  1. copy commands/* and config/local.json as backup
  2. delete the broadlink folder
  3. run installer script again
  4. copy back the commands and config file
  5. restart the broadlink service
combatistor commented 4 years ago

I already tried everything you listed but it couldn't make the install properly... I don't know if it's because of something else

fbacker commented 4 years ago

Notice that sometimes frontail npm package breaks npm install. fixed in updated installer script.

Please test if this solved the installer issue.

srijansaxena11 commented 4 years ago

same issue here

fbacker commented 4 years ago

What happens if you try

npm cache cleanor npm cache verify

fbacker commented 4 years ago

I've rebuild some parts in the installer script. Please try it and see if it works. bash -c "$(curl -sL https://raw.githubusercontent.com/fbacker/broadlink-mqtt-bridge/master/installers/raspberry.sh)"

combatistor commented 4 years ago

Hi, it worked updating to the latest version. Thank you

combatistor commented 4 years ago

Let me reopen the problem. In fact I could update to the latest version without issues, but it broke everything. Now I cannot control anymore from openhab I always get the error:

[info]:     Prepare topic: broadlink/light/nec, message: power_on_preset:780f774e7d2a 
[warn]:     Failed to find file: /srv/openhab2-conf/broadlink-mqtt-bridge/commands/light/nec/power_on_preset:780f774e7d2a.bin

when I ask to play the message on the particular device it actually binds the device to the filename, so it couldn't find it.

moreover now in the UI, the topic is always wrong. If I click to the message to send it creates the topic like this: Topic broadlink/srv/openhab2-conf/broadlink-mqtt-bridge/commands/light/nec Message power_on_preset Device **** (not shown but the id is correct)

If I play from the UI I get this error:

[info]:     Prepare topic: broadlink/srv/openhab2-conf/broadlink-mqtt-bridge/commands/light/nec, message: power_on_preset 
[warn]:     Failed to find file: /srv/openhab2-conf/broadlink-mqtt-bridge/commands/srv/openhab2-conf/broadlink-mqtt-bridge/commands/light/nec/power_on_preset.bin 

The topic should be: broadlink/light/nec

Please can you help fix this problem? Another thing, is it possible to rescan the devices automatically every time the raspberry pi reboots?