[Gelöst]FHEM wird gestartet und beendet selber

Begonnen von JarJar, 30 November 2019, 08:57:22

Vorheriges Thema - Nächstes Thema

JarJar

Guten Morgen zusammen,

nachdem ich die SP111 ota geflasht habe musste ich feststellen das FHEM nicht mehr läuft.
Wenn ich es starte beendet es sich selber nach ca. 5 Sec.
Wenn ich den Befehl:
perl fhem.pl -d fhem.cfg
eingebe kommt (abgespeckt):
2019.11.30 08:41:18 5: Cmd: >attr global userattr alexaName alexaRoom cmdIcon devStateIcon devStateIcon:textField-long devStateStyle genericDeviceType:security,ignore,switch,outlet,light,blind,thermometer,thermostat,contact,garage,window,lock,scene homebridgeMapping:textField-long icon sortby webCmd webCmdLabel:textField-long widgetOverride<
2019.11.30 08:41:18 5: Cmd: >attr global autoload_undefined_devices 1<
2019.11.30 08:41:18 5: Cmd: >attr global autosave 0<
2019.11.30 08:41:18 5: Cmd: >attr global language DE<
2019.11.30 08:41:18 5: Cmd: >attr global latitude 00.74016<
2019.11.30 08:41:18 5: Cmd: >attr global logfile ./log/fhem-%Y-%m.log<
2019.11.30 08:41:18 5: Cmd: >attr global longitude 00.6761224<
2019.11.30 08:41:18 5: Cmd: >attr global modpath .<
2019.11.30 08:41:18 5: Loading ./FHEM/99_SUNRISE_EL.pm
2019.11.30 08:41:18 5: Loading ./FHEM/99_Utils.pm
2019.11.30 08:41:18 5: Cmd: >attr global motd none<
2019.11.30 08:41:18 5: Cmd: >attr global statefile ./log/fhem.save<
2019.11.30 08:41:18 5: Cmd: >attr global updateInBackground 1<
2019.11.30 08:41:18 5: Cmd: >attr global verbose 3<
2019.11.30 08:41:18 5: Initializing Type Library:
2019.11.30 08:41:18 1: Including fhem.cfg
2019.11.30 08:41:18 5: Cmd: >attr global userattr alexaName alexaRoom cmdIcon devStateIcon devStateIcon:textField-long devStateStyle genericDeviceType:security,ignore,switch,outlet,light,blind,thermometer,thermostat,contact,garage,window,lock,scene homebridgeMapping:textField-long icon sortby webCmd webCmdLabel:textField-long widgetOverride<
2019.11.30 08:41:18 5: Cmd: >attr global autoload_undefined_devices 1<
2019.11.30 08:41:18 5: Cmd: >attr global autosave 0<
2019.11.30 08:41:18 5: Cmd: >attr global language DE<
2019.11.30 08:41:18 5: Cmd: >attr global latitude 00.74016<
2019.11.30 08:41:18 5: Cmd: >attr global logfile ./log/fhem-%Y-%m.log<
2019.11.30 08:41:18 5: Cmd: >attr global longitude 00.6761224<
2019.11.30 08:41:18 5: Cmd: >attr global modpath .<
2019.11.30 08:41:18 5: Cmd: >attr global motd none<
2019.11.30 08:41:18 5: Cmd: >attr global statefile ./log/fhem.save<
2019.11.30 08:41:18 5: Cmd: >attr global updateInBackground 1<
2019.11.30 08:41:18 5: Cmd: >attr global verbose 3<
2019.11.30 08:41:18 5: Cmd: >define telnetPort telnet 7072 global<
2019.11.30 08:41:18 5: Loading ./FHEM/98_telnet.pm
2019.11.30 08:41:18 3: telnetPort: port 7072 opened
2019.11.30 08:41:18 5: Cmd: >define WEB FHEMWEB 8083 global<
2019.11.30 08:41:18 5: Loading ./FHEM/01_FHEMWEB.pm
2019.11.30 08:41:18 3: WEB: port 8083 opened
2019.11.30 08:41:18 5: Cmd: >attr WEB JavaScripts codemirror/fhem_codemirror.js<
2019.11.30 08:41:18 5: Cmd: >attr WEB confirmDelete 0<
2019.11.30 08:41:18 5: Cmd: >attr WEB stylesheetPrefix f18<
2019.11.30 08:41:18 5: Cmd: >define WEBphone FHEMWEB 8084 global<
2019.11.30 08:41:18 3: WEBphone: port 8084 opened
2019.11.30 08:41:18 5: Cmd: >attr WEBphone stylesheetPrefix smallscreen<
2019.11.30 08:41:18 5: Cmd: >define WEBtablet FHEMWEB 8085 global<
2019.11.30 08:41:18 3: WEBtablet: port 8085 opened
2019.11.30 08:41:18 5: Cmd: >attr WEBtablet stylesheetPrefix touchpad<
2019.11.30 08:41:18 5: Cmd: >define Logfile FileLog ./log/fhem-%Y-%m.log fakelog<
2019.11.30 08:41:18 5: Loading ./FHEM/92_FileLog.pm
2019.11.30 08:41:18 1: define Logfile FileLog ./log/fhem-%Y-%m.log fakelog: Can't open ./log/fhem-2019-11.log: Permission denied
2019.11.30 08:41:18 5: fhem.cfg line 35 returned >Can't open ./log/fhem-2019-11.log: Permission denied<
2019.11.30 08:41:18 5: Cmd: >setuuid Logfile 5c73db78-f33f-f239-7809-bd1e16e9faefa1f9<
2019.11.30 08:41:18 5: fhem.cfg line 36 returned >Please define Logfile 5c73db78-f33f-f239-7809-bd1e16e9faefa1f9 first<
2019.11.30 08:41:18 5: Cmd: >attr Logfile room 50_System<
2019.11.30 08:41:18 5: Cmd: >define autocreate autocreate<
2019.11.30 08:41:18 5: Loading ./FHEM/98_autocreate.pm
2019.11.30 08:41:18 5: Cmd: >setuuid autocreate 5c73db78-f33f-f239-06c2-21149ebcf2fc432e<
2019.11.30 08:41:18 5: Cmd: >attr autocreate autosave 1<
2019.11.30 08:41:18 5: Cmd: >attr autocreate disable 1<
2019.11.30 08:41:18 5: Cmd: >attr autocreate filelog ./log/%NAME-%Y.log<
2019.11.30 08:41:18 5: Cmd: >attr autocreate room 50_System<
2019.11.30 08:41:18 5: Cmd: >define eventTypes eventTypes ./log/eventTypes.txt<
2019.11.30 08:41:18 5: Loading ./FHEM/91_eventTypes.pm
2019.11.30 08:41:18 2: eventTypes: loaded 1532 events from ./log/eventTypes.txt
2019.11.30 08:41:18 5: Cmd: >setuuid eventTypes 5c73db78-f33f-f239-d824-566228ddd5fc3428<
2019.11.30 08:41:18 5: Cmd: >define initialUsbCheck notify global:INITIALIZED usb create<
2019.11.30 08:41:18 5: Loading ./FHEM/91_notify.pm
2019.11.30 08:41:18 5: Cmd: >setuuid initialUsbCheck 5c73db78-f33f-f239-071f-015e34e4b4654f1a<
2019.11.30 08:41:18 5: Cmd: >define allowed_WEB allowed<
2019.11.30 08:41:18 5: Loading ./FHEM/96_allowed.pm
2019.11.30 08:41:18 5: Cmd: >setuuid allowed_WEB 5c73db78-f33f-f239-5495-dde10a0b309ad0ac<
2019.11.30 08:41:18 5: Cmd: >attr allowed_WEB basicAuth <
2019.11.30 08:41:18 5: Cmd: >attr allowed_WEB validFor WEB<
2019.11.30 08:41:18 5: Cmd: >define allowed_telnetPort allowed<
2019.11.30 08:41:18 5: Cmd: >setuuid allowed_telnetPort 5c73dbb8-f33f-f239-0d13-8f45c395be30a4d9<
2019.11.30 08:41:18 5: Cmd: >attr allowed_telnetPort password <
2019.11.30 08:41:18 5: Cmd: >attr allowed_telnetPort validFor telnetPort<
2019.11.30 08:41:18 5: Cmd: >define allowed_WEBphone allowed<
2019.11.30 08:41:18 5: Cmd: >setuuid allowed_WEBphone <
2019.11.30 08:41:18 5: Cmd: >attr allowed_WEBphone basicAuth <
2019.11.30 08:41:18 5: Cmd: >attr allowed_WEBphone validFor WEBphone<
2019.11.30 08:41:18 5: Cmd: >define allowed_WEBtablet allowed<
2019.11.30 08:41:18 5: Cmd: >setuuid allowed_WEBtablet <
2019.11.30 08:41:18 5: Cmd: >attr allowed_WEBtablet basicAuth wasser<
2019.11.30 08:41:18 5: Cmd: >attr allowed_WEBtablet validFor WEBtablet<
2019.11.30 08:41:18 5: Cmd: >define CUL CUL /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A97JME41-if00-port0@38400 1234<
2019.11.30 08:41:18 5: Loading ./FHEM/00_CUL.pm
2019.11.30 08:41:18 3: Opening CUL device /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A97JME41-if00-port0
2019.11.30 08:41:19 3: Setting CUL serial parameters to 38400,8,N,1
2019.11.30 08:41:19 5: SW: V
2019.11.30 08:41:22 5: SW: V
2019.11.30 08:41:22 5: CUL/RAW (ReadAnswer): V 1.26.03 a
2019.11.30 08:41:22 5: CUL/RAW (ReadAnswer): -culfw Build: private build (unknown) nanoCUL433 (F-Band: 433MHz)

2019.11.30 08:41:22 5: SW: ?
2019.11.30 08:41:22 5: CUL/RAW (ReadAnswer): ? (? is unknown) Use one of A B C e F f G i K L
2019.11.30 08:41:22 5: CUL/RAW (ReadAnswer): l M N R T t U V W X x

2019.11.30 08:41:22 3: CUL: Possible commands: ABCeFfGiKLlMNRTtUVWXx
2019.11.30 08:41:22 5: SW: X21
2019.11.30 08:41:22 5: SW: T01
2019.11.30 08:41:22 5: CUL/RAW (ReadAnswer): 1234

2019.11.30 08:41:22 5: GOT CUL fhtid: 1234
2019.11.30 08:41:22 3: CUL device opened
2019.11.30 08:41:22 5: Starting notify loop for CUL, 1 event(s), first is CONNECTED
2019.11.30 08:41:22 5: createNotifyHash
2019.11.30 08:41:22 5: End notify loop for CUL
2019.11.30 08:41:22 5: Cmd: >setuuid CUL 5c73df5d-f33f-f239-2e1a-52ebb152f2e7f1ad<
2019.11.30 08:41:22 5: Cmd: >attr CUL devStateIcon .*:cul_cul<
2019.11.30 08:41:22 5: Cmd: >attr CUL rfmode SlowRF<
2019.11.30 08:41:22 5: Cmd: >define SD_Pyramide IT FF0F0FFF0F FF F0<
2019.11.30 08:41:22 5: Loading ./FHEM/10_IT.pm
2019.11.30 08:41:22 5: Cmd: >define Fritzbox FRITZBOX 192.168.178.1<
2019.11.30 08:41:22 5: Loading ./FHEM/72_FRITZBOX.pm
2019.11.30 08:41:22 2: FRITZBOX Fritzbox: Define.254 Modul functionality limited because of missing perl modules: Net::Telnet
2019.11.30 08:41:22 5: Cmd: >define Anrufliste FB_CALLMONITOR 192.168.178.1<
2019.11.30 08:41:22 5: Loading ./FHEM/72_FB_CALLMONITOR.pm
2019.11.30 08:41:22 3: Opening Anrufliste device 192.168.178.1:1012
2019.11.30 08:41:22 5: HttpUtils url=http://192.168.178.1:1012/
2019.11.30 08:41:22 4: IP: 192.168.178.1 -> 192.168.178.1
2019.11.30 08:41:22 5: Cmd: >setuuid Anrufliste 5c73e9ef-f33f-f239-f8bb-7d2acaa633f80528<
2019.11.30 08:41:22 5: Cmd: >attr Anrufliste devStateIcon .*:it_fax<
2019.11.30 08:41:22 5: Cmd: >attr Anrufliste local-area-code <
2019.11.30 08:41:22 5: Cmd: >attr Anrufliste reverse-search phonebook,dasoertliche.de,11880.com<
2019.11.30 08:41:22 5: Cmd: >attr Anrufliste reverse-search-cache 1<
2019.11.30 08:41:22 5: Cmd: >attr Anrufliste reverse-search-cache-file /opt/fhem/log/reverse_search.txt<
2019.11.30 08:41:22 3: FB_CALLMONITOR (Anrufliste) - loading cache file /opt/fhem/log/reverse_search.txt
2019.11.30 08:41:22 2: FB_CALLMONITOR (Anrufliste) - read 96 contacts from Cache
2019.11.30 08:41:22 5: Cmd: >attr Anrufliste room 31_Fritzbox<
2019.11.30 08:41:22 5: Loading ./FHEM/00_FBAHA.pm
2019.11.30 08:41:22 3: Opening FritzDect device 192.168.178.1:2002
2019.11.30 08:41:22 5: SW: 0003000c0000000000022005
2019.11.30 08:41:22 5: FBAHA/RAW: /010300100000002c0000002c00022005
2019.11.30 08:41:22 1: FBAHA FritzDect registered with handle: 0000002c
2019.11.30 08:41:22 5: SW: 030300100000002c0000038200000000
2019.11.30 08:41:22 3: FritzDect device opened
2019.11.30 08:41:22 5: Starting notify loop for FritzDect, 1 event(s), first is CONNECTED
2019.11.30 08:41:22 5: createNotifyHash
2019.11.30 08:41:22 5: End notify loop for FritzDect
2019.11.30 08:41:22 5: Cmd: >setuuid FritzDect 5c73ec31-f33f-f239-6398-d07c99a4326503fc<
2019.11.30 08:41:22 5: Cmd: >attr FritzDect room 50_System<
2019.11.30 08:41:22 5: Cmd: >define DECT FBDECT FritzDect:16 switch<
2019.11.30 08:41:22 5: Loading ./FHEM/10_FBDECT.pm
2019.11.30 08:41:22 5: Cmd: >setuuid DECT 5c73ec79-f33f-f239-b8b6-6b0556205f6a3b47<
2019.11.30 08:41:22 5: Cmd: >define Telegram TelegramBot<
2019.11.30 08:41:22 5: Loading ./FHEM/50_TelegramBot.pm
2019.11.30 08:41:23 3: TelegramBot_Define Telegram: called
2019.11.30 08:41:23 5: TelegramBot_readToken: Read Telegram API token from file
2019.11.30 08:41:23 4: TelegramBot_Setup Telegram: called
2019.11.30 08:41:23 5: TelegramBot_readToken: Read Telegram API token from file
2019.11.30 08:41:23 5: TelegramBot_readToken: Read Telegram API token from file
2019.11.30 08:41:23 5: TelegramBot_DoUrlCommand Telegram: called
2019.11.30 08:41:23 5: Cmd: >define Tradfri tradfri<
2019.11.30 08:41:23 5: Loading ./FHEM/30_tradfri.pm
2019.11.30 08:41:29 5: Cmd: >define alexa alexa<
2019.11.30 08:41:29 5: Loading ./FHEM/39_alexa.pm
2019.11.30 08:41:30 5: Cmd: >define myBroker MQTT2_SERVER 1883 global<
2019.11.30 08:41:30 5: Loading ./FHEM/00_MQTT2_SERVER.pm
2019.11.30 08:41:30 1: myBroker: Can't open server port at 1883: Address already in use. Exiting.
pi@raspberrypi:/opt/fhem $ 2019.11.30 08:41:39 1: BlockingInformParent (BlockingStart): Can't connect to localhost:7072: IO::Socket::INET: connect: Connection refused


Sehe ich das richtig das myBroker nicht gestartet werden kann und deswegen FHEM beendet wird?
Wie kann ich den Port 1883 myBroker wieder zuteilen?
Vielen Dank für die Hilfe!
RaspberryPi B3 B3+ / Fritz!Box 7390 / Tradfri / Arduino nano CUL 433 V 1.26.03 a-culfw

KölnSolar

ZitatWie kann ich den Port 1883 myBroker wieder zuteilen?
Scheinbar ist er ja durch etwas anderes belegt. mit z.B.sudo lsof -i | grep -e LISTEN
kannst Du Dir die Portbelegung und die Programme ansehen.

Zitat2019.11.30 08:41:18 1: define Logfile FileLog ./log/fhem-%Y-%m.log fakelog: Can't open ./log/fhem-2019-11.log: Permission denied
2019.11.30 08:41:18 5: fhem.cfg line 35 returned >Can't open ./log/fhem-2019-11.log: Permission denied<
solltest Du mal prüfen. Allgemeines Berechtigungsproblem ?
Zitatbeendet es sich selber nach ca. 5 Sec.
Sicher, dass FHEM beendet ist oder hängt es evtl nur.
Zitatdefine initialUsbCheck notify global:INITIALIZED usb create
könnte so ein Kandidat sein.
Grüße Markus
RPi3/2 buster/stretch-SamsungAV_E/N-RFXTRX-IT-RSL-NC5462-Oregon-CUL433-GT-TMBBQ-01e-CUL868-FS20-EMGZ-1W(GPIO)-DS18B20-CO2-USBRS232-USBRS422-Betty_Boop-EchoDot-OBIS(Easymeter-Q3/EMH-KW8)-PCA301(S'duino)-Deebot(mqtt2)-zigbee2mqtt

MadMax-FHEM

Das mit der Berechtigung kommt (evtl.) weil von Console NICHT als User fhem gestartet!?

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)

JarJar

Also wenn ich
sudo lsof -i | grep -e LISTEN
eingebe kommt leider nur
sudo: lsof: Befehl nicht gefunden

Hier ein Start von FHEM und jede Sekunde eine Statusabfrage:
pi@raspberrypi:~ $ sudo /etc/init.d/fhem start
Starting fhem...
pi@raspberrypi:~ $ sudo /etc/init.d/fhem status
fhem is running
pi@raspberrypi:~ $ sudo /etc/init.d/fhem status
fhem is running
pi@raspberrypi:~ $ sudo /etc/init.d/fhem status
fhem is running
pi@raspberrypi:~ $ sudo /etc/init.d/fhem status
fhem is running
pi@raspberrypi:~ $ sudo /etc/init.d/fhem status
fhem is running
pi@raspberrypi:~ $ sudo /etc/init.d/fhem status
fhem is not running

Ergo... FHEM läuft leider nicht.

"sudo lsof -i | grep -e LISTEN" ist doch ein standartbefehl... Warum kennt die Kiste den wieder nicht  :o
RaspberryPi B3 B3+ / Fritz!Box 7390 / Tradfri / Arduino nano CUL 433 V 1.26.03 a-culfw

amenomade

Nein, lsof ist nicht standardmässig installiert
sudo apt install lsof

Mit sudo netstat -tulpn | grep LISTEN kannst Du auch suchen

Was sagt die systemlog?

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

JarJar

Ah jetzt ja... Dienst gefunden und gestoppt...
FHEM gestartet und nun läuft es wieder.

1000 Dank!
RaspberryPi B3 B3+ / Fritz!Box 7390 / Tradfri / Arduino nano CUL 433 V 1.26.03 a-culfw