Not getting a "gassistantFHEM.loginURL"

Begonnen von Zaleo, 20 Juli 2019, 21:22:15

Vorheriges Thema - Nächstes Thema

dominik

Ok, then try to uninstall grpc and install it with
npm install grpc --unsafe-perm
again.

If it works, it should download the grpc binary during the install process.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Zaleo

#16
Zitat von: console# npm uninstall grpc
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN gassistant-fhem@2.0.0 No repository field.

audited 349 packages in 52.8s
found 0 vulnerabilities

Zitat von: console# npm install grpc --unsafe-perm

> grpc@1.20.0 install /usr/local/lib/node_modules/gassistant-fhem/node_modules/@firebase/firestore/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp WARN Using request for node-pre-gyp https download
[grpc] Success: "/usr/local/lib/node_modules/gassistant-fhem/node_modules/@firebase/firestore/node_modules/grpc/src/node/extension_binary/node-v64-linux-arm-glibc/grpc_node.node" is installed via remote

> grpc@1.22.2 install /usr/local/lib/node_modules/gassistant-fhem/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp WARN Using request for node-pre-gyp https download
[grpc] Success: "/usr/local/lib/node_modules/gassistant-fhem/node_modules/grpc/src/node/extension_binary/node-v64-linux-arm-glibc/grpc_node.node" is installed via remote
npm WARN gassistant-fhem@2.0.0 No repository field.

+ grpc@1.22.2
added 70 packages from 27 contributors, removed 3 packages, updated 12 packages and audited 500 packages in 313.934s
found 0 vulnerabilities

I assume there is no need to rebuild the full package again, as there are new binaries?


Seems to be the same error(s):

Zitat von: console# sudo /usr/local/bin/gassistant-fhem -c ./gassistant-fhem.cfg
sudo: unable to resolve host Domotica: Name or service not known
Loading cli.js...
Loading version.js...
Loading server.js...
Loading user.js...
Loading logger.js...
Loading fhem.js...
Loading database.js...
Illegal instruction

Zitat von: gassistant log
/usr/local/lib/node_modules/gassistant-fhem/node_modules/sync-rpc/lib/index.js:80
    throw new Error(
    ^

Error: Timed out waiting for sync-rpc server to start (it should respond with "pong" when sent "ping"):

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

Error: connect ECONNREFUSED 127.0.0.1:37351
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
Emitted 'error' event at:
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)


    at waitForAlive (/usr/local/lib/node_modules/gassistant-fhem/node_modules/sync-rpc/lib/index.js:80:11)
    at start (/usr/local/lib/node_modules/gassistant-fhem/node_modules/sync-rpc/lib/index.js:40:3)
    at sendMessage (/usr/local/lib/node_modules/gassistant-fhem/node_modules/sync-rpc/lib/index.js:117:17)
    at createClient (/usr/local/lib/node_modules/gassistant-fhem/node_modules/sync-rpc/lib/index.js:157:27)
    at Object.<anonymous> (/usr/local/lib/node_modules/gassistant-fhem/node_modules/sync-request/lib/index.js:16:14)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
Loading cli.js...
Loading version.js...
Loading server.js...
Loading user.js...
Loading logger.js...
Loading fhem.js...
Loading database.js...

Zitat von: FHEM log2019.07.21 23:58:12 1: Including fhem.cfg
2019.07.21 23:58:15 3: WEB: port 8083 opened
2019.07.21 23:58:16 3: telnetPort: port 7072 opened
2019.07.21 23:58:16 3: Opening CCD device /dev/ttyAMA0
2019.07.21 23:58:17 3: Setting CCD serial parameters to 38400,8,N,1
2019.07.21 23:58:17 3: CCD: Possible commands: mbCFiAZGMRTVWXefltux
2019.07.21 23:58:17 3: CCD device opened
2019.07.21 23:58:18 2: eventTypes: loaded 32 events from ./log/eventTypes.txt
2019.07.21 23:58:18 1: Including ./log/fhem.save
2019.07.21 23:58:19 2: gassistant: starting gassistant-fhem: /usr/local/bin/gassistant-fhem -c ./gassistant-fhem.cfg
2019.07.21 23:58:19 3: gassistant: starting
2019.07.21 23:58:19 3: gassistant: using logfile: ./log/gassistant-2019-07-21.log
2019.07.21 23:58:19 0: Featurelevel: 5.9
2019.07.21 23:58:19 0: Server started with 27 defined entities (fhem.pl:19805/2019-07-09 perl:5.028001 os:linux user:fhem pid:381)

dominik

No, no need to rebuild.

This one sounds strange
sudo: unable to resolve host Domotica: Name or service not known

I think you have some issues with your network parts of your installation. Have you set the hostname properly?
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Zaleo

#18
ZitatHave you set the hostname properly?

Code (console) Auswählen
# hostname
Domotica


Yhea I have to change my DHCP server to set 192.168.1.1 as primary DNS server.
It is now using 1.1.1.1 as primary, and cloudfare does not know my local device names  ::)

Manually change the sequense in /etc/resolv.conf untill just now, but did forget it after the last boot.
Fixed it presently by adding my hostename in the /etc/hosts file.

The problem with starting and getting a loginURL by gassistantFHEM remains the same. Don't think this is related, but prove me wrong.
Would really love to control FS20 devices with my Google home.

dominik

I'm really running out of ideas. Can you please verify if the error in the gassistant-fhem log really appears before Loading cli.js? That would mean that the loading mechanism of the libraries is not working.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

dominik

Please also try to run following code in a node console:
const path = require('path');
var request = require('sync-request');
var {NodeVM} = require('vm2');
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Zaleo

Zitat von: dominik am 22 Juli 2019, 21:51:09
Can you please verify if the error in the gassistant-fhem log really appears before Loading cli.js?

Please have a look at the following..


root@Domotica:/home/pi# echo > /opt/fhem/log/gassistant-2019-07-22.log
root@Domotica:/home/pi# reboot


Waited, logged in again and this.....


root@Domotica:/home/pi# cat /opt/fhem/log/gassistant-2019-07-22.log

/usr/local/lib/node_modules/gassistant-fhem/node_modules/sync-rpc/lib/index.js:80
    throw new Error(
    ^

Error: Timed out waiting for sync-rpc server to start (it should respond with "pong" when sent "ping"):

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

Error: connect ECONNREFUSED 127.0.0.1:44257
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
Emitted 'error' event at:
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)


    at waitForAlive (/usr/local/lib/node_modules/gassistant-fhem/node_modules/sync-rpc/lib/index.js:80:11)
    at start (/usr/local/lib/node_modules/gassistant-fhem/node_modules/sync-rpc/lib/index.js:40:3)
    at sendMessage (/usr/local/lib/node_modules/gassistant-fhem/node_modules/sync-rpc/lib/index.js:117:17)
    at createClient (/usr/local/lib/node_modules/gassistant-fhem/node_modules/sync-rpc/lib/index.js:157:27)
    at Object.<anonymous> (/usr/local/lib/node_modules/gassistant-fhem/node_modules/sync-request/lib/index.js:16:14)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
Loading cli.js...
Loading version.js...
Loading server.js...
Loading user.js...
Loading logger.js...
Loading fhem.js...
Loading database.js...


Is that verified enough?

Zaleo

#22
Zitat von: dominik am 22 Juli 2019, 21:58:24
Please also try to run following code in a node console:
const path = require('path');
var request = require('sync-request');
var {NodeVM} = require('vm2');

root@Domotica:/usr/local/lib/node_modules/gassistant-fhem# node
> const path = require('path');
undefined
> var request = require('sync-request');
undefined
> var {NodeVM} = require('vm2');
undefined


But this only works if I am in the /usr/local/lib/node_modules/gassistant-fhem/ folder, not anywhere else.

root@Domotica:/home/pi# node
> const path = require('path');
undefined
> var request = require('sync-request');
Thrown:
{ Error: Cannot find module 'sync-request'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:690:17)
    at require (internal/modules/cjs/helpers.js:25:18) code: 'MODULE_NOT_FOUND' }
> var {NodeVM} = require('vm2');
Thrown:
{ Error: Cannot find module 'vm2'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:690:17)
    at require (internal/modules/cjs/helpers.js:25:18) code: 'MODULE_NOT_FOUND' }
>


So I tried something really different, just to see if nodeJs is working.
root@Domotica:/usr/local/lib/node_modules/gassistant-fhem# node
> 10+10
20


I find it really strange we only get the error once after a reboot, not when restarting gassistant/fhem-connection and not in the shell etc.
But that might just be me.

dominik

Can you do a require('cli') in node console within the gassistant-fhem/lib folder?
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Zaleo

#24
Think we are now narrowing it down:

Code (shell) Auswählen
root@Domotica:/usr/local/lib/node_modules/gassistant-fhem# node
> require('cli');
Thrown:
{ Error: Cannot find module 'cli'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:690:17)
    at require (internal/modules/cjs/helpers.js:25:18) code: 'MODULE_NOT_FOUND' }
>_

dominik

Please do it in the lib folder, not gassistant-fhem folder.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Zaleo

#26
Oeps, hope I did not mess anything up now, tried to install the cli module.

# npm install cli --unsafe-perm

But no luck, or should it be installed globally?

Anyway, now I get this:

root@Domotica:/usr/local/lib/node_modules/gassistant-fhem/lib# node
> require('cli');
Thrown:
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
    at validateString (internal/validators.js:125:11)
    at Object.basename (path.js:1289:5)
    at Object.cli.setArgv (/usr/local/lib/node_modules/gassistant-fhem/node_modules/cli/cli.js:148:31)
>_

dominik

cli is a local js file, it's not a library which can be installed.

Can you please type within the gassistant-fhem directory just bin\gassistant-fhem and see the console output.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Zaleo

#28
Zitatroot@Domotica:/usr/local/lib/node_modules/gassistant-fhem# bin\gassistant-fhem
bash: bingassistant-fhem: command not found
root@Domotica:/usr/local/lib/node_modules/gassistant-fhem# bin/gassistant-fhem
Loading cli.js...
Loading version.js...
Loading server.js...
Loading user.js...
Loading logger.js...
Loading fhem.js...
Loading database.js...
Illegal instruction
root@Domotica:/usr/local/lib/node_modules/gassistant-fhem#

No error, but yhea.. Get it only the first time around..

Zaleo

#29
After a lot of support from dominik the issue did not seem to get resolved.  :-[

We narrowed it down to a corrupt installation of nodeJS.

Seems like I am using a RPi v2 with an armv6 processor and the nodeJS package that came with npm does not support this architechture.
When I put the same SDCard in a RPi v3 I had, gassistatn-FHEM suddenly worked.

:) ;) :D