FHEM Forum

FHEM => English Corner => Thema gestartet von: Zaleo am 20 Juli 2019, 21:22:15

Titel: Not getting a "gassistantFHEM.loginURL"
Beitrag von: Zaleo am 20 Juli 2019, 21:22:15
Hello all,

It has been some time that I worked with FHEM, and my Pi3 with CCD (v1.1) really needed an update.
My German is not great, as I am Dutch, however I have tried to follow the instructions on: https://wiki.fhem.de/wiki/Google_Assistant_FHEM_Connect#Installation

Zitat von: Installation documentationCa. 30s warten bis ein Reading gassistantFHEM.loginURL erscheint. Wenn der Link nicht erscheint, dann bitte in der Konsole einmal "gassistant-fhem" ausführen und die Fehlermeldung beachten. Gerne diese im Forum posten.

So here I am with my problem, I do not get a google login URL, and I did notice an error in the gassistant log file.

Code (gassistant log) Auswählen
/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:40723
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1104:14)
Emitted 'error' event at:
    at emitErrorNT (internal/streams/destroy.js:82:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:50: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:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
Loading cli.js...
Loading version.js...
Loading server.js...
Loading user.js...
Loading logger.js...
Loading fhem.js...
Loading database.js...


OS:Raspbian GNU/Linux 10 (buster)

# npm -v
6.10.1

# node -v
v10.15.2

Fhem version 5.9.19853

gassistant-fhem@2.0.0
sync-rpc@1.3.4

Did check netstat too see if node was lisseinging on ports in the higher ranges, and yes this seems the case, but on different ports numbers.

Zitat von: netstatroot@Domotica:/opt/fhem/log# netstat -tulpn | grep LISTEN
tcp        0      0 0.0.0.0:7072            0.0.0.0:*               LISTEN      390/perl
tcp        0      0 0.0.0.0:8083            0.0.0.0:*               LISTEN      390/perl
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      389/sshd
tcp6       0      0 :::36127                :::*                    LISTEN      663/node
tcp6       0      0 :::46729                :::*                    LISTEN      976/node
tcp6       0      0 :::22                   :::*                    LISTEN      389/sshd

Please do you have any advice?

With kind regards,
Zeo
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: dominik am 21 Juli 2019, 14:25:38
Hi,
do you have any special security settings on your system? It looks like the internal rpc communication isn't working.

Cheers
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: Zaleo am 21 Juli 2019, 16:58:30
Thanks dominik for the effort.

Zitat von: dominikdo you have any special security settings on your system?

Not that I am aware, basic Raspbian Buster Lite image and followed the instructions on the busware.de (ccdv1) and FHEM website to get things running.
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: amenomade am 21 Juli 2019, 17:25:15
What does ip asay?
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: Zaleo am 21 Juli 2019, 19:54:49
Zitat von: amenomadeWhat does
ip a
say?

Code (ip a) Auswählen
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:ba:b0:68 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.175/24 brd 192.168.1.255 scope global noprefixroute eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::f6fe:57df:320f:6262/64 scope link
       valid_lft forever preferred_lft forever
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: Zaleo am 21 Juli 2019, 19:58:28
The answer from dominik got me thinking  ???
I installed the light image of Raspbian, so thing I needed to start the portmapper.

# sudo service portmap start

This did supress the error in the gassistant log...

Made it permanent
# sudo systemctl enable portmap

But after a quick reboot, still I get an errormessage (Never got a loginURL).

Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: dominik am 21 Juli 2019, 21:00:04
Can you post the output from the gassistant-fhem log after the portmapper change?
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: Zaleo am 21 Juli 2019, 21:18:44
Yes I can.

After a reboot, or a "set gassistant restart" I get an errors....

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:45327
    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...

When I do "sudo service portmap start" in the console and then a "set gassistant restart" the logging looks like:

Zitat von: gassistant logLoading cli.js...
Loading version.js...
Loading server.js...
Loading user.js...
Loading logger.js...
Loading fhem.js...
Loading database.js...

No error....

So I think the portmap service is started at boot or after FHEM, or is not related.

# sudo systemctl is-active portmap
active


However in both situations I do not get a loginURL.  :'(

Hope this is clear?
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: dominik am 21 Juli 2019, 21:25:32
Even after a minute or so nothing more appears in the log after the restart? Can you please check FHEM log as well in that case.
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: Zaleo am 21 Juli 2019, 21:36:38
Waited 10 minutes now... Still no URL

Code (FHEM log) Auswählen
2019.07.21 21:24:56 1: Including fhem.cfg
2019.07.21 21:24:59 3: WEB: port 8083 opened
2019.07.21 21:24:59 3: telnetPort: port 7072 opened
2019.07.21 21:25:00 3: Opening CCD device /dev/ttyAMA0
2019.07.21 21:25:00 3: Setting CCD serial parameters to 38400,8,N,1
2019.07.21 21:25:00 3: CCD: Possible commands: mbCFiAZGMRTVWXefltux
2019.07.21 21:25:00 3: CCD device opened
2019.07.21 21:25:02 2: eventTypes: loaded 32 events from ./log/eventTypes.txt
2019.07.21 21:25:02 1: Including ./log/fhem.save
2019.07.21 21:25:02 2: gassistant: starting gassistant-fhem: /usr/local/bin/gassistant-fhem -c ./gassistant-fhem.cfg
2019.07.21 21:25:02 3: gassistant: starting
2019.07.21 21:25:02 3: gassistant: using logfile: ./log/gassistant-2019-07-21.log
2019.07.21 21:25:02 0: Featurelevel: 5.9
2019.07.21 21:25:02 0: Server started with 27 defined entities (fhem.pl:19805/2019-07-09 perl:5.028001 os:linux user:fhem pid:374)
2019.07.21 21:25:41 3: gassistant: read: end of file reached while sysread


Here I got the error, and restarted gassistant - No more error.

Code (FHEM log) Auswählen

2019.07.21 21:26:49 3: gassistant: stopped
2019.07.21 21:26:49 2: gassistant: starting gassistant-fhem: /usr/local/bin/gassistant-fhem -c ./gassistant-fhem.cfg
2019.07.21 21:26:49 3: gassistant: starting
2019.07.21 21:26:49 3: gassistant: using logfile: ./log/gassistant-2019-07-21.log
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: dominik am 21 Juli 2019, 21:42:54
Stop gassistant again and try to start it in the console. Just type gassistant-fhem, nothing more. I hope you get some more log messages there.
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: Zaleo am 21 Juli 2019, 21:59:07
Code (console) Auswählen
root@Domotica:/opt/fhem# /usr/local/bin/gassistant-fhem -c ./gassistant-fhem.cfg
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:/opt/fhem#


Illegal instruction  :o ???
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: dominik am 21 Juli 2019, 22:02:28
Looks like a grpc issue.
Try
npm rebuild --build-from-source --unsafe-perm grpc
It can take 2 hours to compile.
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: Zaleo am 21 Juli 2019, 22:10:24
Cooking  ;D

Code (console) Auswählen
root@Domotica:/usr/local/lib/node_modules/gassistant-fhem#  npm rebuild --build-from-source --unsafe-perm grpc

> grpc@1.20.0 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
make: Entering directory '/usr/local/lib/node_modules/gassistant-fhem/node_modules/grpc/build'
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
etc. etc.




@dominik thanks for all the help this far!!!! It is appreciated.

Will come back when finished.
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: Zaleo am 21 Juli 2019, 23:14:43
The rebuild failed....  :(

Zitat von: rebuild
<-- snip-->
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.o
../deps/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc: In function 'grpc_grpclb_request* grpc_grpclb_request_create(const char*)':
../deps/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc:70:10: error: 'char* strncpy(char*, const char*, size_t)' specified bound 128 equals destination size [-Werror=stringop-truncation]
   strncpy(req->initial_request.name, lb_service_name,
   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           GRPC_GRPCLB_SERVICE_NAME_MAX_LENGTH);
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make: *** [grpc.target.mk:482: Release/obj.target/grpc/deps/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.o] Error 1
make: Leaving directory '/usr/local/lib/node_modules/gassistant-fhem/node_modules/grpc/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 4.19.57+
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/usr/local/lib/node_modules/gassistant-fhem/node_modules/grpc/src/node/extension_binary/node-v64-linux-arm-glibc/grpc_node.node" "--module_name=grpc_node" "--module_path=/usr/local/lib/node_modules/gassistant-fhem/node_modules/grpc/src/node/extension_binary/node-v64-linux-arm-glibc" "--napi_version=4" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v64"
gyp ERR! cwd /usr/local/lib/node_modules/gassistant-fhem/node_modules/grpc
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/usr/local/lib/node_modules/gassistant-fhem/node_modules/grpc/src/node/extension_binary/node-v64-linux-arm-glibc/grpc_node.node --module_name=grpc_node --module_path=/usr/local/lib/node_modules/gassistant-fhem/node_modules/grpc/src/node/extension_binary/node-v64-linux-arm-glibc --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/gassistant-fhem/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:982:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
node-pre-gyp ERR! System Linux 4.19.57+
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/gassistant-fhem/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/gassistant-fhem/node_modules/grpc
node-pre-gyp ERR! node -v v10.16.0
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/usr/local/lib/node_modules/gassistant-fhem/node_modules/grpc/src/node/extension_binary/node-v64-linux-arm-glibc/grpc_node.node --module_name=grpc_node --module_path=/usr/local/lib/node_modules/gassistant-fhem/node_modules/grpc/src/node/extension_binary/node-v64-linux-arm-glibc --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc@1.20.0 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the grpc@1.20.0 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!     /root/.npm/_logs/2019-07-21T21_01_37_769Z-debug.log

Zitat von: debug.log
<-- snip-->
75 info lifecycle grpc@1.20.0~install: Failed to exec install script
476 verbose stack Error: grpc@1.20.0 install: `node-pre-gyp install --fallback-to-build --library=static_library`
476 verbose stack Exit status 1
476 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
476 verbose stack     at EventEmitter.emit (events.js:198:13)
476 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
476 verbose stack     at ChildProcess.emit (events.js:198:13)
476 verbose stack     at maybeClose (internal/child_process.js:982:16)
476 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
477 verbose pkgid grpc@1.20.0
478 verbose cwd /usr/local/lib/node_modules/gassistant-fhem
479 verbose Linux 4.19.57+
480 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "rebuild" "--build-from-source" "--unsafe-perm" "grpc"
481 verbose node v10.16.0
482 verbose npm  v6.9.0
483 error code ELIFECYCLE
484 error errno 1
485 error grpc@1.20.0 install: `node-pre-gyp install --fallback-to-build --library=static_library`
485 error Exit status 1
486 error Failed at the grpc@1.20.0 install script.
486 error This is probably not a problem with npm. There is likely additional logging output above.
487 verbose exit [ 1, true ]
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: dominik am 21 Juli 2019, 23:17:49
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.
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: Zaleo am 22 Juli 2019, 00:01:35
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)
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: dominik am 22 Juli 2019, 00:06:07
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?
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: Zaleo am 22 Juli 2019, 00:19:46
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.
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: dominik am 22 Juli 2019, 21:51:09
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.
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag 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');
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: Zaleo am 22 Juli 2019, 22:09:59
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?
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: Zaleo am 22 Juli 2019, 22:13:42
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.
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: dominik am 23 Juli 2019, 18:05:31
Can you do a require('cli') in node console within the gassistant-fhem/lib folder?
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: Zaleo am 23 Juli 2019, 18:41:02
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' }
>_
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: dominik am 23 Juli 2019, 18:59:01
Please do it in the lib folder, not gassistant-fhem folder.
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: Zaleo am 23 Juli 2019, 19:04:49
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)
>_
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: dominik am 23 Juli 2019, 19:55:11
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.
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: Zaleo am 23 Juli 2019, 20:03:34
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..
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: Zaleo am 23 Juli 2019, 21:27:36
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
Titel: Antw:Not getting a "gassistantFHEM.loginURL"
Beitrag von: bmaehr am 02 November 2019, 21:07:46
Zitat von: Zaleo am 21 Juli 2019, 23:14:43
The rebuild failed....  :(

I was only able to solve this by editing my package.json:

  "dependencies": {

.....

    "@firebase/firestore": "1.6.4",
    "grpc": "1.24.2",
  },
  "resolutions": {
    "@firebase/firestore": "1.6.4",
    "grpc": "1.24.2"
  }