stas-demydiuk / domoticz-ewpe-smart-mqtt-plugin

Python plugin for Domoticz to control ewpe-smart powered air conditioners
MIT License
11 stars 6 forks source link

npm start problem #3

Closed wr56514 closed 5 years ago

wr56514 commented 5 years ago

hi i have some issues everytime on every installs (ubuntu, ubuntu virtualbox, rpi with raspberry). Can you guys help me with this?

ewpe-smart-mqtt@1.0.0 start /home/pi/ewpe-smart-mqtt node index.js

events.js:174 throw er; // Unhandled 'error' event ^

Error: Connection refused: Not authorized at MqttClient._handleConnack (/home/pi/ewpe-smart-mqtt/node_modules/mqtt/lib/client.js:920:15) at MqttClient._handlePacket (/home/pi/ewpe-smart-mqtt/node_modules/mqtt/lib/client.js:350:12) at work (/home/pi/ewpe-smart-mqtt/node_modules/mqtt/lib/client.js:292:12) at Writable.writable._write (/home/pi/ewpe-smart-mqtt/node_modules/mqtt/lib/client.js:302:5) at doWrite (/home/pi/ewpe-smart-mqtt/node_modules/readable-stream/lib/_stream_writable.js:428:64) at writeOrBuffer (/home/pi/ewpe-smart-mqtt/node_modules/readable-stream/lib/_stream_writable.js:417:5) at Writable.write (/home/pi/ewpe-smart-mqtt/node_modules/readable-stream/lib/_stream_writable.js:334:11) at Socket.ondata (_stream_readable.js:667:20) at Socket.emit (events.js:189:13) at addChunk (_stream_readable.js:284:12) Emitted 'error' event at: at MqttClient._handleConnack (/home/pi/ewpe-smart-mqtt/node_modules/mqtt/lib/client.js:922:10) at MqttClient._handlePacket (/home/pi/ewpe-smart-mqtt/node_modules/mqtt/lib/client.js:350:12) [... lines matching original stack trace ...] at addChunk (_stream_readable.js:284:12) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! ewpe-smart-mqtt@1.0.0 start: node index.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the ewpe-smart-mqtt@1.0.0 start 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! /root/.npm/_logs/2019-08-03T22_05_15_287Z-debug.log root@raspberrypi:/home/pi/ewpe-smart-mqtt#

root@raspberrypi:/home/pi/ewpe-smart-mqtt# cat /root/.npm/_logs/2019-08-03T22_05_15_287Z-debug.log 0 info it worked if it ends with ok 1 warn npm npm does not support Node.js v10.15.2 2 warn npm You should probably upgrade to a newer version of node as we 3 warn npm can't make any promises that npm will work with this version. 4 warn npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9. 5 warn npm You can find the latest version at https://nodejs.org/ 6 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ] 7 info using npm@5.8.0 8 info using node@v10.15.2 9 verbose run-script [ 'prestart', 'start', 'poststart' ] 10 info lifecycle ewpe-smart-mqtt@1.0.0~prestart: ewpe-smart-mqtt@1.0.0 11 info lifecycle ewpe-smart-mqtt@1.0.0~start: ewpe-smart-mqtt@1.0.0 12 verbose lifecycle ewpe-smart-mqtt@1.0.0~start: unsafe-perm in lifecycle true 13 verbose lifecycle ewpe-smart-mqtt@1.0.0~start: PATH: /usr/share/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/pi/ewpe-smart-mqtt/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 14 verbose lifecycle ewpe-smart-mqtt@1.0.0~start: CWD: /home/pi/ewpe-smart-mqtt 15 silly lifecycle ewpe-smart-mqtt@1.0.0~start: Args: [ '-c', 'node index.js' ] 16 silly lifecycle ewpe-smart-mqtt@1.0.0~start: Returned: code: 1 signal: null 17 info lifecycle ewpe-smart-mqtt@1.0.0~start: Failed to exec start script 18 verbose stack Error: ewpe-smart-mqtt@1.0.0 start: node index.js 18 verbose stack Exit status 1 18 verbose stack at EventEmitter. (/usr/share/npm/node_modules/npm-lifecycle/index.js:283:16) 18 verbose stack at EventEmitter.emit (events.js:189:13) 18 verbose stack at ChildProcess. (/usr/share/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 18 verbose stack at ChildProcess.emit (events.js:189:13) 18 verbose stack at maybeClose (internal/child_process.js:970:16) 18 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5) 19 verbose pkgid ewpe-smart-mqtt@1.0.0 20 verbose cwd /home/pi/ewpe-smart-mqtt 21 verbose Linux 4.19.58-v7l+ 22 verbose argv "/usr/bin/node" "/usr/bin/npm" "start" 23 verbose node v10.15.2 24 verbose npm v5.8.0 25 error code ELIFECYCLE 26 error errno 1 27 error ewpe-smart-mqtt@1.0.0 start: node index.js 27 error Exit status 1 28 error Failed at the ewpe-smart-mqtt@1.0.0 start script. 28 error This is probably not a problem with npm. There is likely additional logging output above. 29 verbose exit [ 1, true ]

stas-demydiuk commented 5 years ago

As I see from error Error: Connection refused: Not authorized problem is with ewpe-smart-mqtt bridge and most likely due to your MQTT server requires authorization which bridge does not support.

wr56514 commented 5 years ago

Thank you, for your answer. That was a problem with mosquitto.conf "allow_anonymous false" with "true" it's fine.