[alexa-fhem | Generell] Alles zu Installation und damit verbundenen Problemen

Begonnen von prodigy7, 09 November 2016, 19:42:01

Vorheriges Thema - Nächstes Thema

Aladin222

Jep... vielen Dank MadMax !

*grummel , ich muss mich echt um das Systemd kümmern ....

Naja, habe dabei dann auch gesehen das Alexa 1.9 bei mir läuft bzw lief ... denke dann sollte ich das auch gerade ziehen und aktualisieren , oder ?
Aber erstmal muss ich das mit Systemd raffen  :-\

Aladin222

Puhhh ... also ich versuche fleißig weiter zu kommen ,was nur mit einem iPad echt mühselig ist  :)
( Nachtschicht und kein richtiger Computer )

Wenn ich im Terminal , via

/bin/alexa

Starte ,läuft alles bis das Terminal geschlossen wird !

Versuche ich es nun über systemd bekomme ich wieder :

fhem@ubuntu:/$ sudo systemctl daemon-reload
fhem@ubuntu:/$ sudo systemctl enable alexa
fhem@ubuntu:/$ sudo systemctl start alexa
fhem@ubuntu:/$ sudo systemctl status alexa
● alexa.service - Node.js Alexa Server
   Loaded: loaded (/etc/systemd/system/alexa.service; enabled; vendor preset: enabled)
   Active: active (exited) since Mon 2018-10-29 13:58:37 CET; 14h ago
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/alexa.service

Okt 29 13:58:23 ubuntu systemd[1]: Starting LSB: Start daemon at boot time for alexa...
Okt 29 13:58:23 ubuntu su[1663]: Successful su for fhem by root
Okt 29 13:58:23 ubuntu su[1663]: + ??? root:fhem
Okt 29 13:58:23 ubuntu su[1663]: pam_unix(su:session): session opened for user fhem by (uid=0)
Okt 29 13:58:24 ubuntu alexa[1497]: Alexa starting
Okt 29 13:58:24 ubuntu su[1663]: pam_unix(su:session): session closed for user fhem
Okt 29 13:58:26 ubuntu alexa[1497]: Alexa is not running
Okt 29 13:58:37 ubuntu alexa[1497]: script done
Okt 29 13:58:37 ubuntu alexa[1497]: script done
Okt 29 13:58:37 ubuntu systemd[1]: Started LSB: Start daemon at boot time for alexa.
fhem@ubuntu:/$



MadMax-FHEM

Poste doch mal die Ausgabe vom manuellen Start inkl. in welchem Pfad du stehst und mit welchem User du es ausführst...
(Hast du inzwischen auch ein Update von alexa-fhem durchgeführt? Aktuell ist 0.4.4)

Dann noch das Startscript /etc/systemd/system/alexa.service

Und evtl. noch ein paar Ausgaben aus dem alexa-fhem Log beim automatischen Start (kann aber auch nachgereicht werden, vielleicht sieht man ja bereits etwas mit den oben gewünschten Infos).
Log auslesen bei systemd geht mittels "journalcontrol": https://wiki.ubuntuusers.de/systemd/journalctl/

Gruß, Joachim
FHEM PI3B+ Bullseye: HM-CFG-USB, 40x HM, ZWave-USB, 13x ZWave, EnOcean-PI, 15x EnOcean, HUE/deCONZ, CO2, ESP-Multisensor, Shelly, alexa-fhem, ...
FHEM PI2 Buster: HM-CFG-USB, 25x HM, ZWave-USB, 4x ZWave, EnOcean-PI, 3x EnOcean, Shelly, ha-bridge, ...
FHEM PI3 Buster (Test)

Aladin222

HI @MadMax,

da ich letzte Nacht wohl so ziemlich alles verbogen habe ,was übers iPad und ssh möglich war , poste ich mal alles :

Wenn ich mich richtig erinnere hatte ich npm und node.js usw. als User fhem mit sudo installiert !

ls -la für /home/fhem/.alexa

drwxrwxrwx  2 fhem fhem 4096 Okt 29 16:40 .
drwxr-xr-x 14 fhem fhem 4096 Okt 30 04:38 ..
-rwxrwxrwx  1 fhem fhem  433 Jan 28  2017 config.json


.....Inhalt der config.json

{
        "alexa": {
                "name": "Alexa TEST",
                "keyFile": "./key.pem",
                "certFile": "./cert.pem",
                "applicationId": "amzn1.ask.skill.xxxxx-xxxx-xxxxx-xxxx-xxxxxxcb",
                "oauthClientID": "amzn1.application-oa2-client.xxxxxxxxxxxxxxxxxx"
        },

        "connections": [{
                "name": "FHEM",
                "server": "192.168.178.25",
                "port": "8083",
                "auth": {
                        "user": "xxx",
                        "pass": "xxx"
                },
                "filter": "room=alexa"
        }]
}



ls -la von /opt/fhem/Alexa-fhem


drwxrwxrwx  5 fhem  fhem     4096 Jan 28  2017 .
drwxrwxrwx 21 fhem  dialout  4096 Okt 29 16:41 ..
drwxrwxrwx  2 alexa fhem     4096 Jan 28  2017 bin
-rwxrwxrwx  1 alexa fhem     1395 Jan 28  2017 cert.pem
-rwxrwxrwx  1 alexa fhem      520 Nov 25  2016 config-sample.json
-rwxrwxrwx  1 alexa fhem      150 Nov  5  2016 createKey.sh
-rwxrwxrwx  1 alexa fhem     1675 Jan 28  2017 key.pem
-rwxrwxrwx  1 alexa fhem     1183 Dez 23  2016 lambda.js
drwxrwxrwx  2 alexa fhem     4096 Jan 28  2017 lib
drwxrwxrwx 79 alexa fhem     4096 Jan 28  2017 node_modules
-rwxrwxrwx  1 alexa fhem       33 Nov  5  2016 .npmignore
-rwxrwxrwx  1 alexa fhem      373 Jan  3  2017 package.json
-rwxrwxrwx  1 alexa fhem     2830 Nov  8  2016 README.md
-rwxrwxrwx  1 alexa fhem    35939 Nov 22  2016 server.js
-rwxrwxrwx  1 alexa fhem     1252 Dez 28  2016 TODO


alexa.service liegt unter /etc/systemd/system mit folgendem Inhalt :


[Unit]
Description=Node.js Alexa Server
After=syslog.target network-online.target

[Service]
Type=simple
User=alexa

ExecStart=/opt/fhem/alexa-fhem/bin/alexa -U /home/fhem/.alexa
Restart=on-failure
RestartSec=10
KillMode=process

[Install]
WantedBy=multi-user.target
~           


MadMax , zu deinen Fragen :
Nein ich habe noch kein update von Alexa-fhem durchgeführt ,um nicht noch eine Baustelle aufzumachen :-) ist noch Version 0.1.9
Mit dem Log aus dem automatischen start kann ich noch nicht dienen ,da das ja nicht läuft :-)
Manuell starten kann ich Alexa aus dem Pfad /opt/fhem/alexa-fhem mit

./bin/alexa


fhem@ubuntu:/opt/fhem/alexa-fhem$ ./bin/alexa
[2018-10-30 14:23:30] using /home/fhem/.alexa/config.json
[2018-10-30 14:23:30] ---
[2018-10-30 14:23:30] this alexa-fhem 0.1.9
[2018-10-30 14:23:30] Fetching FHEM devices...
[2018-10-30 14:23:30] [FHEM] Checking devices and attributes...
[2018-10-30 14:23:30] [FHEM]   executing: http://192.168.178.25:8083/fhem?cmd=%7BAttrVal(%22global%22,%22userattr%22,%22%22)%7D&XHR=1
[2018-10-30 14:23:30] [FHEM]   executing: http://192.168.178.25:8083/fhem?cmd=jsonlist2%20TYPE=alexa&XHR=1
[2018-10-30 14:23:30] [FHEM] starting longpoll: http://192.168.178.25:8083/fhem.pl?XHR=1&inform=type=status;addglobal=1;filter=.*;since=null;fmt=JSON&timestamp=1540905810852
[2018-10-30 14:23:30] [FHEM] Fetching FHEM devices...
[2018-10-30 14:23:30] [FHEM] fetching: http://192.168.178.25:8083/fhem?cmd=jsonlist2%20room=alexa&XHR=1
[2018-10-30 14:23:30] Server listening on: https://:::3000
[2018-10-30 14:23:30] [FHEM] alexa device is alexa
[2018-10-30 14:23:30] [FHEM] alexa is switch
[2018-10-30 14:23:30] [FHEM] alexa has
[2018-10-30 14:23:30] [FHEM] homebridgeMapping: #Characteristic=<name>=<value>,...
On=verb=schalte,valueOn=an;ein,valueOff=aus,valueToggle=um

Brightness=verb=stelle,valuePrefix=auf,values=AMAZON.NUMBER,valueSuffix=prozent

TargetPosition=verb=mach,articles=den,values=auf:100;zu:0
TargetPosition=verb=stelle,valuePrefix=auf,values=AMAZON.NUMBER,valueSuffix=prozent

Hue=verb=stelle,valuePrefix=auf,values=rot:0;grün:128;blau:200
Hue=verb=färbe,values=rot:0;grün:120;blau:220

TargetTemperature=verb=stelle,valuePrefix=auf,values=AMAZON.NUMBER,valueSuffix=grad

#Weckzeit=verb=stelle,valuePrefix=auf;für,values=AMAZON.TIME,valueSuffix=uhr
[2018-10-30 14:23:30] [FHEM]   executing: http://192.168.178.25:8083/fhem?cmd=%7B$defs%7Balexa%7D-%3E%7B%22active%22%7D%20=%201%7D&XHR=1
[2018-10-30 14:23:30] [FHEM]   executing: http://192.168.178.25:8083/fhem?cmd=%7B$defs%7Balexa%7D-%3E%7B%22alexa-fhem%20version%22%7D%20=%20%220.1.9%22%7D&XHR=1
[2018-10-30 14:23:30] [FHEM]   executing: http://192.168.178.25:8083/fhem?cmd=%7B$defs%7Balexa%7D-%3E%7B%22active%22%7D%20=%200%7D&XHR=1
[2018-10-30 14:23:30] { stelle: 'gestellt',
  schalte: 'geschaltet',
  'färbe': 'gefärbt',
  mach: 'gemacht' }
[2018-10-30 14:23:30] [ OnIntent: [ 'schalte' ],
  prozentIntent: [ 'stelle' ],
  TargetPositionIntent: [ 'mach' ],
  HueIntent: [ 'stelle' ],
  HueIntentB: [ 'färbe' ],
  gradIntent: [ 'stelle' ] ]
[2018-10-30 14:23:30] { OnIntent: [ 'On' ],
  prozentIntent: [ 'Brightness', 'TargetPosition' ],
  TargetPositionIntent: [ 'TargetPosition' ],
  HueIntent: [ 'Hue' ],
  HueIntentB: [ 'Hue' ],
  gradIntent: [ 'TargetTemperature' ] }
[2018-10-30 14:23:30] { OnIntent: undefined,
  prozentIntent: 'auf',
  TargetPositionIntent: undefined,
  HueIntent: 'auf',
  HueIntentB: undefined,
  gradIntent: 'auf' }
[2018-10-30 14:23:30] { OnIntent: undefined,
  prozentIntent: 'prozent',
  TargetPositionIntent: undefined,
  HueIntent: undefined,
  HueIntentB: undefined,
  gradIntent: 'grad' }
[2018-10-30 14:23:30] { light: [ 'licht', 'lampen' ],
  blind:
   [ 'rolladen',
     'rolläden',
     'jalousie',
     'jalousien',
     'rollo',
     'rollos' ] }
[2018-10-30 14:23:30] { FHEMgutenMorgenIntent: 'gutenMorgen',
  FHEMguteNachtIntent: 'guteNacht' }
[2018-10-30 14:23:30] [FHEM] got: 9 results
[2018-10-30 14:23:30] [FHEM] Esszimmer is switch
[2018-10-30 14:23:30] [FHEM] Esszimmer has
[2018-10-30 14:23:30] [FHEM]   FirmwareRevision [D-firmware]
[2018-10-30 14:23:30] [FHEM]   On [state;on,off]
  2018-10-30 14:23:30 caching: Esszimmer-D-firmware: 2.8
  2018-10-30 14:23:30 caching: Esszimmer-state: off
[2018-10-30 14:23:30] [FHEM] Fernseher is switch
[2018-10-30 14:23:30] [FHEM] Fernseher has
[2018-10-30 14:23:30] [FHEM]   On [state;on,off]
  2018-10-30 14:23:30 caching: Fernseher-state: off
[2018-10-30 14:23:30] [FHEM] FlurLed is switch
[2018-10-30 14:23:30] [FHEM] FlurLed has
[2018-10-30 14:23:30] [FHEM]   On [state;on,off]
  2018-10-30 14:23:30 caching: FlurLed-state: off
[2018-10-30 14:23:30] [FHEM] RolloAlle is switch
[2018-10-30 14:23:30] [FHEM] RolloAlle has
[2018-10-30 14:23:30] [FHEM]   On [state;on,off]
  2018-10-30 14:23:30 caching: RolloAlle-state: Auto
[2018-10-30 14:23:30] [FHEM] SchneeMannLed is switch
[2018-10-30 14:23:30] [FHEM] SchneeMannLed has
[2018-10-30 14:23:30] [FHEM]   On [state;on,off]
  2018-10-30 14:23:30 caching: SchneeMannLed-state: off
[2018-10-30 14:23:30] [FHEM] Sonoff2Led is switch
[2018-10-30 14:23:30] [FHEM] Sonoff2Led has
[2018-10-30 14:23:30] [FHEM]   On [state;on,off]
  2018-10-30 14:23:30 caching: Sonoff2Led-state: on
[2018-10-30 14:23:30] [FHEM] Wohnzimmerlampe is switch
[2018-10-30 14:23:30] [FHEM] Wohnzimmerlampe has
[2018-10-30 14:23:30] [FHEM]   FirmwareRevision [D-firmware]
[2018-10-30 14:23:30] [FHEM]   On [state;on,off]
  2018-10-30 14:23:30 caching: Wohnzimmerlampe-D-firmware: 2.8
  2018-10-30 14:23:30 caching: Wohnzimmerlampe-state: on
[2018-10-30 14:23:30] [FHEM] WzWandthermostat is thermostat
[2018-10-30 14:23:30] [FHEM] WzWandthermostat has
[2018-10-30 14:23:30] [FHEM]   StatusLowBattery [battery]
[2018-10-30 14:23:30] [FHEM]   FirmwareRevision [firmware]
[2018-10-30 14:23:30] [FHEM]   TargetTemperature [desiredTemperature]
[2018-10-30 14:23:30] [FHEM]   CurrentTemperature [temperature]
[2018-10-30 14:23:30] [FHEM]   CurrentHeatingCoolingState [undefined]
  2018-10-30 14:23:30 caching: WzWandthermostat-battery: ok
  2018-10-30 14:23:30 caching: WzWandthermostat-firmware: 1.0
  2018-10-30 14:23:30 caching: WzWandthermostat-desiredTemperature: 22.0
  2018-10-30 14:23:30 caching: WzWandthermostat-temperature: 22.3
[2018-10-30 14:23:30] [FHEM] Wz_Sturz is switch
[2018-10-30 14:23:30] [FHEM] Wz_Sturz has
[2018-10-30 14:23:30] [FHEM]   FirmwareRevision [D-firmware]
[2018-10-30 14:23:30] [FHEM]   On [state;on,off]
  2018-10-30 14:23:30 caching: Wz_Sturz-D-firmware: 2.8
  2018-10-30 14:23:30 caching: Wz_Sturz-state: off


amenomade

Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

MadMax-FHEM

Auch wenn es nicht läuft solltest du Logausgaben liefern können um eben genau zu sehen WARUM es nicht läuft... ;)

Also du startest von Console als User fhem, im Startscript steht aber User alexa drin...

Gibt es den User alexa? (ja sonst würde ls den nicht anzeigen ;)  / aber wie und warum? ;)  )
Was passiert, wenn du alexa-fhem von Console mit dem User alexa startest?

Weil nämlich wichtig: die config.json liegt/sollte normalerweise hier: /HOME-DES-STARTENDEN-USERS/.alexa

UND (normalerweise) ist das Home-Verzeichnis von fhem: /opt/fhem

Warum das bei dir /home/fhem ist, ist fraglich aber das scheint ja zu tun...
...da das auch explizit im Startscript angegeben wird sollte das auch tun bzw. nicht das Problem sein (dass es nicht gefunden wird).

Aber wie geschrieben: manueller Start auf Console der geht -> User = fhem / automatischer Start der NICHT geht (und mangels Logs unklar ist warum nicht ;)  ) -> User = alexa

EDIT: andere Variante wäre einfach mal im Startscript statt alexa eben fhem anzugeben...

Gruß, Joachim
FHEM PI3B+ Bullseye: HM-CFG-USB, 40x HM, ZWave-USB, 13x ZWave, EnOcean-PI, 15x EnOcean, HUE/deCONZ, CO2, ESP-Multisensor, Shelly, alexa-fhem, ...
FHEM PI2 Buster: HM-CFG-USB, 25x HM, ZWave-USB, 4x ZWave, EnOcean-PI, 3x EnOcean, Shelly, ha-bridge, ...
FHEM PI3 Buster (Test)

Aladin222

Zitat von: amenomade am 30 Oktober 2018, 14:54:57
Und
ls -la /opt/fhem/alexa-fhem/bin?

fhem@ubuntu:~$ ls -la /opt/fhem/alexa-fhem/bin
insgesamt 12
drwxrwxrwx 2 alexa fhem 4096 Jan 28  2017 .
drwxrwxrwx 5 fhem  fhem 4096 Jan 28  2017 ..
-rwxrwxrwx 1 alexa fhem  339 Nov  3  2016 alexa

Aladin222

Zitat von: MadMax-FHEM am 30 Oktober 2018, 14:55:38
Auch wenn es nicht läuft solltest du Logausgaben liefern können um eben genau zu sehen WARUM es nicht läuft... ;)

Also du startest von Console als User fhem, im Startscript steht aber User alexa drin...

Gibt es den User alexa? (ja sonst würde ls den nicht anzeigen ;)  / aber wie und warum? ;)  )
Was passiert, wenn du alexa-fhem von Console mit dem User alexa startest?

hmmm, das weiß ich nicht warum *schaem , wissentlich hab ich den User Alexa nicht angelegt !
Kann aber durchaus sein das ich dies in der Nachtschicht verbockt habe ...
Über init.d lief es vorher mit User fhem

Weil nämlich wichtig: die config.json liegt/sollte normalerweise hier: /HOME-DES-STARTENDEN-USERS/.alexa

UND (normalerweise) ist das Home-Verzeichnis von fhem: /opt/fhem

sorry , das ich nachfrage ! Aber das ist doch auch so , oder ?

fhem@ubuntu:/opt/fhem$ ls -la
insgesamt 912
drwxrwxrwx 21 fhem dialout   4096 Okt 29 16:41  .
drwxrwxrwx  3 root root      4096 Jan 25  2017  ..
drwxrwxrwx  5 fhem fhem      4096 Jan 28  2017  alexa-fhem
drwxrwxrwx  6 fhem fhem      4096 Jan  2  2017  alexa-fhem1.3
drwxrwxrwx  6 fhem fhem      4096 Jan 28  2017  alexa-fhem1.8
drwxrwxrwx  2 fhem fhem      4096 Jan 25  2017  backup
drwxrwxrwx  2 fhem dialout   4096 Dez 23  2016  calendar
-rwxrwxrwx  1 fhem dialout 263116 Okt 28 16:17  CHANGED
-rwxrwxrwx  1 fhem dialout  39688 Okt  4 05:50  configDB.pm
drwxrwxrwx 39 fhem dialout   4096 Nov 29  2016  contrib
drwxrwxrwx  3 fhem dialout   4096 Nov 29  2016  demolog
drwxrwxrwx  4 fhem dialout   4096 Aug 16  2017  docs
drwxrwxrwx  6 fhem dialout  24576 Okt 22 17:53  FHEM
-rw-rw-r--  1 fhem fhem     19944 Okt 28 23:11  fhem.cfg
-rwxrwxrwx  1 fhem dialout   5704 Jan 25  2017  fhem.cfg.backup
-rwxrwxrwx  1 fhem dialout  19987 Okt  4 05:50  fhem.cfg.demo
-rw-r--r--  1 fhem fhem     53140 Jul 30 18:08  fhem.cfg.heute
-rwxrwxrwx  1 fhem fhem     15703 Nov 30  2016  fhem.cfg.orig
-rwxrwxrwx  1 fhem fhem      1929 Jan 25  2017  fhem.cfg.original
-rwxrwxrwx  1 fhem dialout   8629 Jan  1  2017 'fhem?cmd=set%20FHEM.Alexa.Status%20off'
-rwxrwxrwx  1 fhem dialout   8629 Jan  1  2017 'fhem?cmd=set%20FHEM.Alexa.Status%20on'
-rwxrwxrwx  1 fhem fhem     13999 Dez 23  2016 'fhem copy.cfg'
-rwxrwxrwx  1 fhem dialout  37984 Jul 21  2016  fhem_logo.png
-rwxrwxrwx  1 fhem dialout 151220 Okt 25 15:37  fhem.pl
-rwxrwxrwx  1 fhem dialout      0 Aug 20  2015  fronthem.err
-rwxrwxrwx  1 fhem dialout   7766 Nov 30  2016  install_nvm.sh
-rwxrwxrwx  1 fhem dialout    891 Mär 18  2015  killfhem.sh
-rwxrwxrwx  1 fhem dialout     53 Mär 18  2015  killwatchdog.sh
-rwxr-xr-x  1 fhem dialout    244 Feb 28  2017  lescan.sh
drwxrwxrwx  3 fhem dialout  36864 Okt 30 00:00  log
-rw-r--r--  1 fhem fhem     38276 Okt 22 17:53  MAINTAINER.txt
-rwxrwxrwx  1 fhem dialout  12201 Nov 29  2016  nodesource_setup.sh
drwxrwxrwx  3 root root      4096 Jan 25  2017  opt.old
-rwxrwxrwx  1 fhem dialout    935 Nov 15  2015  README_DEMO.txt
-rwxrwxrwx  1 fhem fhem      6167 Mär 12  2017  regSave.cfg
drwxrwxrwx  5 fhem dialout   4096 Mär 21  2018  restoreDir
-rwxrwxrwx  1 fhem dialout    405 Aug 14  2015  runfhem.sh
-rwxrwxrwx  1 fhem dialout   1908 Mär 18  2015  runwatchdog.sh
drwxrwxr-x  2 fhem fhem      4096 Mär  1  2017  script
drwxrwxrwx  2 fhem dialout  12288 Aug 14 17:10  SonosSpeak
drwxrwxrwx  2 fhem fhem      4096 Dez  3  2016 'SonosSpeak copy'
-rwxrwxrwx  1 fhem dialout    655 Aug 14  2015  startfhem
-rwxrwxrwx  1 fhem dialout    301 Mär 18  2015  stopfhem
drwxrwxrwx  2 fhem dialout   4096 Nov 29  2016  tmp
drwxrwxrwx  2 fhem dialout   4096 Nov 29  2016  unused
-rwxrwxrwx  1 fhem fhem     12008 Okt 27 14:32  vissmann.php
-rwxrwxrwx  1 fhem dialout   4342 Aug 14  2015  watchdogloop.sh
drwxrwxrwx  3 fhem dialout   4096 Nov 29  2016  WmLsf7
drwxrwxrwx 16 fhem dialout   4096 Jul 27 16:51  www
fhem@ubuntu:/opt/fhem$



Warum das bei dir /home/fhem ist, ist fraglich aber das scheint ja zu tun...
...da das auch explizit im Startscript angegeben wird sollte das auch tun bzw. nicht das Problem sein (dass es nicht gefunden wird).

Aber wie geschrieben: manueller Start auf Console der geht -> User = fhem / automatischer Start der NICHT geht (und mangels Logs unklar ist warum nicht ;)  ) -> User = alexa

EDIT: andere Variante wäre einfach mal im Startscript statt alexa eben fhem anzugeben...



Das steht im Log wenn ich versuche automatisch zu starten : ( habe im script fhem als User eingetragen )


Okt 30 17:19:58 ubuntu systemd[1]: Started Node.js Alexa Server.
Okt 30 17:20:00 ubuntu alexa[1388]: [2018-10-30 17:20:00] using /home/fhem/.alexa/config.json
Okt 30 17:20:00 ubuntu alexa[1388]: [2018-10-30 17:20:00] ---
Okt 30 17:20:00 ubuntu alexa[1388]: [2018-10-30 17:20:00] this alexa-fhem 0.1.9
Okt 30 17:20:00 ubuntu alexa[1388]: fs.js:646
Okt 30 17:20:00 ubuntu alexa[1388]:   return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
Okt 30 17:20:00 ubuntu alexa[1388]:                  ^
Okt 30 17:20:00 ubuntu alexa[1388]: Error: ENOENT: no such file or directory, open './key.pem'
Okt 30 17:20:00 ubuntu alexa[1388]:     at Object.fs.openSync (fs.js:646:18)
Okt 30 17:20:00 ubuntu alexa[1388]:     at Object.fs.readFileSync (fs.js:551:33)
Okt 30 17:20:00 ubuntu alexa[1388]:     at Server.startServer (/opt/fhem/alexa-fhem/lib/server.js:115:15)
Okt 30 17:20:00 ubuntu alexa[1388]:     at Server.run (/opt/fhem/alexa-fhem/lib/server.js:236:8)
Okt 30 17:20:00 ubuntu alexa[1388]:     at module.exports (/opt/fhem/alexa-fhem/lib/cli.js:30:10)
Okt 30 17:20:00 ubuntu alexa[1388]:     at Object.<anonymous> (/opt/fhem/alexa-fhem/bin/alexa:17:22)
Okt 30 17:20:00 ubuntu alexa[1388]:     at Module._compile (module.js:653:30)
Okt 30 17:20:00 ubuntu alexa[1388]:     at Object.Module._extensions..js (module.js:664:10)
Okt 30 17:20:00 ubuntu alexa[1388]:     at Module.load (module.js:566:32)
Okt 30 17:20:00 ubuntu alexa[1388]:     at tryModuleLoad (module.js:506:12)
Okt 30 17:20:00 ubuntu systemd[1]: alexa.service: Main process exited, code=exited, status=1/FAILURE
Okt 30 17:20:00 ubuntu systemd[1]: alexa.service: Failed with result 'exit-code'.
Okt 30 17:20:11 ubuntu systemd[1]: alexa.service: Service hold-off time over, scheduling restart.
Okt 30 17:20:11 ubuntu systemd[1]: alexa.service: Scheduled restart job, restart counter is at 1.
Okt 30 17:20:11 ubuntu systemd[1]: Stopped Node.js Alexa Server.
Okt 30 17:20:11 ubuntu systemd[1]: Started Node.js Alexa Server.
Okt 30 17:20:11 ubuntu alexa[2132]: [2018-10-30 17:20:11] using /home/fhem/.alexa/config.json
Okt 30 17:20:11 ubuntu alexa[2132]: [2018-10-30 17:20:11] ---
Okt 30 17:20:11 ubuntu alexa[2132]: [2018-10-30 17:20:11] this alexa-fhem 0.1.9
Okt 30 17:20:11 ubuntu alexa[2132]: fs.js:646
Okt 30 17:20:11 ubuntu alexa[2132]:   return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
Okt 30 17:20:11 ubuntu alexa[2132]:                  ^
Okt 30 17:20:11 ubuntu alexa[2132]: Error: ENOENT: no such file or directory, open './key.pem'
Okt 30 17:20:11 ubuntu alexa[2132]:     at Object.fs.openSync (fs.js:646:18)
Okt 30 17:20:11 ubuntu alexa[2132]:     at Object.fs.readFileSync (fs.js:551:33)
Okt 30 17:20:11 ubuntu alexa[2132]:     at Server.startServer (/opt/fhem/alexa-fhem/lib/server.js:115:15)
Okt 30 17:20:11 ubuntu alexa[2132]:     at Server.run (/opt/fhem/alexa-fhem/lib/server.js:236:8)
Okt 30 17:20:11 ubuntu alexa[2132]:     at module.exports (/opt/fhem/alexa-fhem/lib/cli.js:30:10)
Okt 30 17:20:11 ubuntu alexa[2132]:     at Object.<anonymous> (/opt/fhem/alexa-fhem/bin/alexa:17:22)
Okt 30 17:20:11 ubuntu alexa[2132]:     at Module._compile (module.js:653:30)
Okt 30 17:20:11 ubuntu alexa[2132]:     at Object.Module._extensions..js (module.js:664:10)
Okt 30 17:20:11 ubuntu alexa[2132]:     at Module.load (module.js:566:32)
Okt 30 17:20:11 ubuntu alexa[2132]:     at tryModuleLoad (module.js:506:12)
Okt 30 17:20:11 ubuntu systemd[1]: alexa.service: Main process exited, code=exited, status=1/FAILURE
Okt 30 17:20:11 ubuntu systemd[1]: alexa.service: Failed with result 'exit-code'.
Okt 30 17:20:21 ubuntu systemd[1]: alexa.service: Service hold-off time over, scheduling restart.
Okt 30 17:20:21 ubuntu systemd[1]: alexa.service: Scheduled restart job, restart counter is at 2.
Okt 30 17:20:21 ubuntu systemd[1]: Stopped Node.js Alexa Server.
Okt 30 17:20:21 ubuntu systemd[1]: Started Node.js Alexa Server.
Okt 30 17:20:21 ubuntu alexa[2191]: [2018-10-30 17:20:21] using /home/fhem/.alexa/config.json
Okt 30 17:20:21 ubuntu alexa[2191]: [2018-10-30 17:20:21] ---
Okt 30 17:20:21 ubuntu alexa[2191]: [2018-10-30 17:20:21] this alexa-fhem 0.1.9
Okt 30 17:20:21 ubuntu alexa[2191]: fs.js:646
Okt 30 17:20:21 ubuntu alexa[2191]:   return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
Okt 30 17:20:21 ubuntu alexa[2191]:                  ^
Okt 30 17:20:21 ubuntu alexa[2191]: Error: ENOENT: no such file or directory, open './key.pem'
Okt 30 17:20:21 ubuntu alexa[2191]:     at Object.fs.openSync (fs.js:646:18)
Okt 30 17:20:21 ubuntu alexa[2191]:     at Object.fs.readFileSync (fs.js:551:33)
Okt 30 17:20:21 ubuntu alexa[2191]:     at Server.startServer (/opt/fhem/alexa-fhem/lib/server.js:115:15)
Okt 30 17:20:21 ubuntu alexa[2191]:     at Server.run (/opt/fhem/alexa-fhem/lib/server.js:236:8)
Okt 30 17:20:21 ubuntu alexa[2191]:     at module.exports (/opt/fhem/alexa-fhem/lib/cli.js:30:10)
Okt 30 17:20:21 ubuntu alexa[2191]:     at Object.<anonymous> (/opt/fhem/alexa-fhem/bin/alexa:17:22)
Okt 30 17:20:21 ubuntu alexa[2191]:     at Module._compile (module.js:653:30)
Okt 30 17:20:21 ubuntu alexa[2191]:     at Object.Module._extensions..js (module.js:664:10)
Okt 30 17:20:21 ubuntu alexa[2191]:     at Module.load (module.js:566:32)
Okt 30 17:20:21 ubuntu alexa[2191]:     at tryModuleLoad (module.js:506:12)
Okt 30 17:20:21 ubuntu systemd[1]: alexa.service: Main process exited, code=exited, status=1/FAILURE
Okt 30 17:20:21 ubuntu systemd[1]: alexa.service: Failed with result 'exit-code'.



MadMax-FHEM

Jetzt musste ich erst mal finden "was du willst"... ;)

Das ist hier eher nebensächlich und vermutlich nicht der Grund warum es nicht geht...

...aber:

alexa-fhem nutzt beim Start von Console /home/fhem/.alexa/config.json

Da die config.json bei dieser Startart normalerweise aus dem Home des startenden Users (in dem Fall fhem) und dort dann in .alexa genommen wird "glaubt" alexa-fhem, dass das Homeverzeichnis von fhem eben /home/fhem ist...
(und wird vermutlich so sein)

Und nur weil die Dateien eines Verzeichnisses einem bestimmten User "gehören" heißt das noch lange nicht, dass es dann auch das Homeverzeichnis ist...

Beim Start per systemd wird das dann explizit angegeben und daher nicht "gesucht" daher ist/sollte das nicht das Problem sein.

Bei Standard-Fhem-Installation ist das Homeverzeichnis von fhem aber /opt/fhem

Dort gibt es aber eben kein Verzeichnis .alexa mit config.json

Warum das bei dir so ist wie es ist weiß ich nicht...
Ich kann nur beurteilen was ich sehe...


Wichtiger als dieser "Kleinkram" (der wie geschrieben wohl nicht das Problem ist und eine Änderung demnach wohl auch keine Verbesserung bringt / evtl. eher das Gegenteil)...
...wären Logs vom automatischen Start (jaja es startet ja nicht aber ohne Logs weiß man auch nicht warum nicht)...
...oder ein Startversuch von der Console mit dem User alexa oder eben mal fhem statt alexa in die Startdatei eintragen...

Gruß, Joachim
FHEM PI3B+ Bullseye: HM-CFG-USB, 40x HM, ZWave-USB, 13x ZWave, EnOcean-PI, 15x EnOcean, HUE/deCONZ, CO2, ESP-Multisensor, Shelly, alexa-fhem, ...
FHEM PI2 Buster: HM-CFG-USB, 25x HM, ZWave-USB, 4x ZWave, EnOcean-PI, 3x EnOcean, Shelly, ha-bridge, ...
FHEM PI3 Buster (Test)

Aladin222

Log hab ich einen Beitrag drüber eingefügt [edit]

Sry fix per Handy geantwortet ...Regierung schickte mich einkaufen :-)

MadMax-FHEM

Ah ok..
Auch nur mit dem Handy drüber geflogen und übersehen... ;)

Grad noch mal ins Startscript geschaut es fehlt der Eintrag Working Directory...

Ich vermute mal: /opt/fhem/alexa-fhem

Oder in der config.json die Pfade bei key.pem und cert.pem angeben...
...aber besser Working Directory setzen, wer weiß was sonst noch nicht gefunden wird...

Irgendwo in den letzten 5 Seiten oder so ist bestimmt ein funktionierendes Startscript zu finden...

Das mit Working Directory gab es schon ein paar mal...

Gruß, Joachim
FHEM PI3B+ Bullseye: HM-CFG-USB, 40x HM, ZWave-USB, 13x ZWave, EnOcean-PI, 15x EnOcean, HUE/deCONZ, CO2, ESP-Multisensor, Shelly, alexa-fhem, ...
FHEM PI2 Buster: HM-CFG-USB, 25x HM, ZWave-USB, 4x ZWave, EnOcean-PI, 3x EnOcean, Shelly, ha-bridge, ...
FHEM PI3 Buster (Test)

Aladin222

Hallo @all ,
  hallo Joachim :-)

So , erstmal vielen Dank für Eure/Deine Hilfe !

Es lüppt ! Es war wohl ein Mix aus Working Directory setzen & User .... denke hauptsächlich ging das konfigurieren mittels iPad auf Nachtschicht in die Hose !
Das werde ich nie wieder versuchen :-) Aber die Frau nervte und wollte Alexa wie gewohnt nutzen .....


Also nochmals vielen Dank an alle

MadMax-FHEM

FHEM PI3B+ Bullseye: HM-CFG-USB, 40x HM, ZWave-USB, 13x ZWave, EnOcean-PI, 15x EnOcean, HUE/deCONZ, CO2, ESP-Multisensor, Shelly, alexa-fhem, ...
FHEM PI2 Buster: HM-CFG-USB, 25x HM, ZWave-USB, 4x ZWave, EnOcean-PI, 3x EnOcean, Shelly, ha-bridge, ...
FHEM PI3 Buster (Test)

Robby

Hallo liebes Forum,
ich bin neu hier und habe mir dank eurer Anleitung nun schonmal FHEM auf der PI2B unter Rasberian stretch eingerichtet und das ganze mit der Alexa verkoppelt.

Nach vielen Unklarheiten habe ich es nun auch zum Autostart unter systemd geschafft. (warum auch immer ist die Install bei mit unter /home/pi/alexa-fhem geschehen ::) )

Soweit läuft alles. An der Stelle  Vielen Dank an alle Beteiligten

Eine Unklarheit habe ich dennoch.
Unter dem von node.js bereit gestellten Server https://<IP-Adresse des Servers>:3000 kommt immer auch wie im Wiki beschrieben die Zeile

{"header":{"name":"UnsupportedOperationError","payloadVersion":"2","namespace":"Alexa.ConnectedHome.Control","messageId":"13d01ddc-a422-4853-b0f5-ad7ad82c06f8"},"payload":{}}

Warum UnsupportedOperationError ???

Und was wird mit dem Log von  " journalctl -u alexa"  ist da die Größe begrenzt oder müsste ich die ab und an löschen?

Grad in der Bootlog gesehen:

[    2.187350] systemd[1]: Configuration file /etc/systemd/system/alexa.service                                                             is marked executable. Please remove executable permission bits. Proceeding anywa                                                            y.
[    2.188595] systemd[1]: [/etc/systemd/system/alexa.service:7] Invalid user/gr                                                            oup name or numeric ID, ignoring: pi #oder ein anderer Benutzer wie fhem

wie bügel ich das aus?





hugo

Hallo,
sitze schon wieder Stunden vor dem BS und habe keinen Erfolg mit alexa.  :(
Ich habe einen Custom Skill am laufen und möchte zusätzlich noch einen smart home skill aktivieren. Leider schaffe ich es nicht.
Ich erhalte in der Devoloper Console folgenden Fehler:

Please make sure that "Alexa Smart Home" is selected for the event source type, for provided arn [Invalid value] : arn:aws:lambda:eu-west-1:64...................0:function:FHEM

Problem lag in der Verknüpfung mit AWS


Raspi 3 mit CUL HM-MOD-UART; nanoCUL
Homematic: HM-SEC-SCo 5x;HM-LC-SW1-BA-PCB 3x;HM-Dis-EP-WM55; HM-LC-SW4-PCB; ARLO;
Somfy RTS Rollo 14x; Alexa; GardenaSmartDevice; Stromzähler(GPIO); shelly1; shelly2.5;Wasserzähler(GPIO);Brennerstuhlsteckdosen;