Der Fehler passiert immer nach Mitternacht, so zwischen 1 und 3 Uhr. Manchmal läuft es einige Tage ohne Probleme. Ist der Fehler da, so hilft nur ein Neustart des Raspi.
sudo systemctl restart mosquitto oder auch ein Neustart des Sonoff Pow R2 bringen nichts.
In der Tasmota-Konsole (Tasmota 9.3.1) erscheint beim Fehler:
10:42:22.987 MQT: Verbindungsversuch...
10:42:23.199 MQT: Verbindung fehlgeschlagen aufgrund von 192.168.178.53:1883, rc -2. Wiederversuch in 120 s
Hier die aktuellen Softwarestände:
pi@solaranzeige:~ $ uname -a
Linux solaranzeige 5.10.25-v7+ #1408 SMP Mon Mar 22 12:47:11 GMT 2021 armv7l GNU/Linux
Solaranzeige: Software Version 4.7.1d update März 2021
Mosquitto 2.0.6 - den Fehler hatte ich auch schon mit Mosquitto 1.6.12
Im Folgenden Auszüge aus den Log-Dateien
/var/www/log/solaranzeige.log
/var/www/log/php.log
Code: Alles auswählen
/var/www/log/solaranzeige.log
=======================
06.04. 02:33:58 -OK. Datenübertragung erfolgreich.
06.04. 02:33:58 |---------------- Stop sonoff_mqtt.php --------------------
06.04. 02:34:01 |---------------- Start sonoff_mqtt.php ---------------------
06.04. 02:34:01 -Zentraler Timestamp: 1617669241
06.04. 02:34:01 + -Die Daten werden ausgelesen...
06.04. 02:34:01 -Topic: tele/sonoff/LWT
06.04. 02:34:09 -Es handelt sich um ein Sonoff POW R2 Modul Nr.: 43
06.04. 02:34:10 * -Daten zur entfernten InfluxDB [ datasolar ] gesendet.
06.04. 02:34:10 * -Daten zur lokalen InfluxDB [ solaranzeige ] gesendet.
06.04. 02:34:57 -OK. Datenübertragung erfolgreich.
06.04. 02:34:57 |---------------- Stop sonoff_mqtt.php --------------------
06.04. 02:35:01 |---------------- Start sonoff_mqtt.php ---------------------
06.04. 02:35:01 -Zentraler Timestamp: 1617669301
06.04. 02:35:01 + -Die Daten werden ausgelesen...
06.04. 02:35:01 -Topic: tele/sonoff/LWT
06.04. 02:35:09 -Keine Daten vom Sonoff Modul empfangen.
06.04. 02:35:09 !! -Keine gültigen Daten empfangen.
06.04. 02:35:09 |---------------- Stop sonoff_mqtt.php --------------------
06.04. 02:36:01 |---------------- Start sonoff_mqtt.php ---------------------
06.04. 02:36:01 -Zentraler Timestamp: 1617669361
06.04. 02:36:01 + -Die Daten werden ausgelesen...
06.04. 02:36:09 -Keine Daten vom Sonoff Modul empfangen.
06.04. 02:36:09 !! -Keine gültigen Daten empfangen.
06.04. 02:36:09 |---------------- Stop sonoff_mqtt.php --------------------
...
...schnipp
...
06.04. 10:42:01 |---------------- Start sonoff_mqtt.php ---------------------
06.04. 10:42:01 -Zentraler Timestamp: 1617698521
06.04. 10:42:01 + -Die Daten werden ausgelesen...
06.04. 10:42:09 -Keine Daten vom Sonoff Modul empfangen.
06.04. 10:42:09 !! -Keine gültigen Daten empfangen.
06.04. 10:42:09 |---------------- Stop sonoff_mqtt.php --------------------
#Raspi reboot <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
06.04. 10:43:01 |---------------- Start sonoff_mqtt.php ---------------------
06.04. 10:43:01 -Zentraler Timestamp: 1617698581
06.04. 10:43:01 + -Die Daten werden ausgelesen...
06.04. 10:43:12 -
T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 1
D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=1d6b ProdID=0002 Rev=05.10
S: Manufacturer=Linux 5.10.25-v7+ dwc_otg_hcd
S: Product=DWC OTG Controller
S: SerialNumber=3f980000.usb
C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I: If#=0x0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=480 MxCh= 4
D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=02 MxPS=64 #Cfgs= 1
P: Vendor=0424 ProdID=2514 Rev=0b.b3
C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=2mA
I: If#=0x0 Alt= 1 #EPs= 1 Cls=09(hub ) Sub=00 Prot=02 Driver=hub
T: Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=480 MxCh= 3
D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=02 MxPS=64 #Cfgs= 1
P: Vendor=0424 ProdID=2514 Rev=0b.b3
C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=2mA
I: If#=0x0 Alt= 1 #EPs= 1 Cls=09(hub ) Sub=00 Prot=02 Driver=hub
T: Bus=01 Lev=03 Prnt=03 Port=00 Cnt=01 Dev#= 4 Spd=480 MxCh= 0
D: Ver= 2.10 Cls=ff(vend.) Sub=00 Prot=ff MxPS=64 #Cfgs= 1
P: Vendor=0424 ProdID=7800 Rev=03.00
C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=2mA
I: If#=0x0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=ff Driver=lan78xx
T: Bus=01 Lev=03 Prnt=03 Port=01 Cnt=02 Dev#= 5 Spd=480 MxCh= 0
D: Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=152d ProdID=0578 Rev=03.01
S: Manufacturer=USB 3.0 Device
S: Product=USB 3.0 Device
S: SerialNumber=000000004D18
C: #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA
I: If#=0x0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
06.04. 10:43:13 -Daten:
array (
17 => 'SCSI 00.0: 10600 Disk',
'' => '[Created at block.245]',
'Unique ID' => 'xtlt.DkTkx_X9bM2',
'Parent ID' => '3t9U.TAOITtdfnIE',
'SysFS ID' => '/class/block/sda',
'SysFS BusID' => '0:0:0:0',
'SysFS Device Link' => '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/1-1.1.2/1-1.1.2:1.0/host0/target0:0:0/0:0:0:0',
'Hardware Class' => 'disk',
'Model' => '"FM-25S2I -64GBFII"',
'Vendor' => 'usb 0x152d "FM-25S2I"',
'Device' => 'usb 0x0578 "-64GBFII"',
'Revision' => '"0301"',
'Serial ID' => '"00000000457C"',
'Driver' => '"usb-storage", "sd"',
'Driver Modules' => '"usb_storage"',
'Device File' => '/dev/sda (/dev/sg0)',
'Device Files' => '/dev/sda, /dev/disk/by-path/platform-3f980000.usb-usb-0:1.1.2:1.0-scsi-0:0:0:0, /dev/disk/by-id/usb-FM-25S2I_-64GBFII_000000004D18-0:0',
'Device Number' => 'block 8:0-8:15 (char 21:0)',
'Geometry (Logical)' => 'CHS 61057/64/32',
'Size' => '125045424 sectors a 512 bytes',
'Capacity' => '59 GB (64023257088 bytes)',
'Speed' => '480 Mbps',
'Module Alias' => '"usb:v152Dp0578d0301dc00dsc00dp00ic08isc06ip50in00"',
'Driver Info #0' => '',
'Driver Status' => 'uas is active',
'Driver Activation Cmd' => '"modprobe uas"',
'Config Status' => 'cfg=new, avail=yes, need=no, active=unknown',
'Attached to' => '#1 (USB Controller)',
)
06.04. 10:43:13 -Daten:
array (
18 => 'None 00.0: 11300 Partition',
'' => '[Created at block.434]',
'Unique ID' => 'bdUI.SE1wIdpsiiC',
'Parent ID' => 'xtlt.DkTkx_X9bM2',
'SysFS ID' => '/class/block/sda/sda1',
'Hardware Class' => 'partition',
'Model' => '"Partition"',
'Device File' => '/dev/sda1',
'Device Files' => '/dev/sda1, /dev/disk/by-partuuid/8978ce14-01, /dev/disk/by-id/usb-FM-25S2I_-64GBFII_000000004D18-0:0-part1, /dev/disk/by-label/boot, /dev/disk/by-uuid/0C61-73F5, /
dev/disk/by-path/platform-3f980000.usb-usb-0:1.1.2:1.0-scsi-0:0:0:0-part1',
'Config Status' => 'cfg=new, avail=yes, need=no, active=unknown',
'Attached to' => '#17 (Disk)',
)
06.04. 10:43:13 -Daten:
array (
19 => 'None 00.0: 11300 Partition',
'' => '[Created at block.434]',
'Unique ID' => '2pkM.SE1wIdpsiiC',
'Parent ID' => 'xtlt.DkTkx_X9bM2',
'SysFS ID' => '/class/block/sda/sda2',
'Hardware Class' => 'partition',
'Model' => '"Partition"',
'Device File' => '/dev/sda2',
'Device Files' => '/dev/sda2, /dev/disk/by-label/rootfs, /dev/disk/by-partuuid/8978ce14-02, /dev/disk/by-id/usb-FM-25S2I_-64GBFII_000000004D18-0:0-part2, /dev/disk/by-uuid/43f2d0bb-8
3be-464f-94d0-9a751f376c64, /dev/disk/by-path/platform-3f980000.usb-usb-0:1.1.2:1.0-scsi-0:0:0:0-part2',
'Config Status' => 'cfg=new, avail=yes, need=no, active=unknown',
'Attached to' => '#17 (Disk)',
)
06.04. 10:43:13 -Daten:
array (
25 => 'USB 00.0: 0200 Ethernet controller',
'' => '[Created at usb.122]',
'Unique ID' => 'Vl7j.8_I5RcIC_05',
'Parent ID' => 'lfzD.YCWTDwYJz_B',
'SysFS ID' => '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/1-1.1.1/1-1.1.1:1.0',
'SysFS BusID' => '1-1.1.1:1.0',
'Hardware Class' => 'network',
'Model' => '"Standard Microsystems Ethernet controller"',
'Hotplug' => 'USB',
'Vendor' => 'usb 0x0424 "Standard Microsystems Corp."',
'Device' => 'usb 0x7800',
'Revision' => '"3.00"',
'Driver' => '"lan78xx"',
'Driver Modules' => '"lan78xx"',
'Device File' => 'eth0',
'Speed' => '480 Mbps',
'HW Address' => 'b8:27:eb:35:49:b2',
'Permanent HW Address' => 'b8:27:eb:35:49:b2',
'Link detected' => 'no',
'Module Alias' => '"usb:v0424p7800d0300dcFFdsc00dpFFicFFisc00ipFFin00"',
'Config Status' => 'cfg=new, avail=yes, need=no, active=unknown',
'Attached to' => '#28 (Hub)',
)
06.04. 10:43:13 -Daten:
array (
26 => 'USB 00.0: 10a00 Hub',
'' => '[Created at usb.122]',
'Unique ID' => 'k4bc.D6ER+lJeRh3',
'Parent ID' => '3t9U.TAOITtdfnIE',
'SysFS ID' => '/devices/platform/soc/3f980000.usb/usb1/1-0:1.0',
'SysFS BusID' => '1-0:1.0',
'Hardware Class' => 'hub',
'Model' => '"Linux Foundation 2.0 root hub"',
'Hotplug' => 'USB',
'Vendor' => 'usb 0x1d6b "Linux Foundation"',
'Device' => 'usb 0x0002 "2.0 root hub"',
'Revision' => '"5.10"',
'Serial ID' => '"3f980000.usb"',
'Driver' => '"hub"',
'Driver Modules' => '"usbcore"',
'Speed' => '480 Mbps',
'Module Alias' => '"usb:v1D6Bp0002d0510dc09dsc00dp01ic09isc00ip00in00"',
'Config Status' => 'cfg=new, avail=yes, need=no, active=unknown',
'Attached to' => '#1 (USB Controller)',
)
06.04. 10:43:13 -Daten:
array (
28 => 'USB 00.0: 10a00 Hub',
'' => '[Created at usb.122]',
'Unique ID' => 'lfzD.YCWTDwYJz_B',
'Parent ID' => 'ADDn.YCWTDwYJz_B',
'SysFS ID' => '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/1-1.1:1.0',
'SysFS BusID' => '1-1.1:1.0',
'Hardware Class' => 'hub',
'Model' => '"Standard Microsystems USB 2.0 Hub"',
'Hotplug' => 'USB',
'Vendor' => 'usb 0x0424 "Standard Microsystems Corp."',
'Device' => 'usb 0x2514 "USB 2.0 Hub"',
'Revision' => '"b.b3"',
'Driver' => '"hub"',
'Driver Modules' => '"usbcore"',
'Speed' => '480 Mbps',
'Module Alias' => '"usb:v0424p2514d0BB3dc09dsc00dp02ic09isc00ip02in00"',
'Config Status' => 'cfg=new, avail=yes, need=no, active=unknown',
'Attached to' => '#29 (Hub)',
)
06.04. 10:43:13 -Daten:
array (
29 => 'USB 00.0: 10a00 Hub',
'' => '',
'Unique ID' => 'ADDn.YCWTDwYJz_B',
'Parent ID' => 'k4bc.D6ER+lJeRh3',
'SysFS ID' => '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1:1.0',
'SysFS BusID' => '1-1:1.0',
'Hardware Class' => 'hub',
'Model' => '"Standard Microsystems USB 2.0 Hub"',
'Hotplug' => 'USB',
'Vendor' => 'usb 0x0424 "Standard Microsystems Corp."',
'Device' => 'usb 0x2514 "USB 2.0 Hub"',
'Revision' => '"b.b3"',
'Driver' => '"hub"',
'Driver Modules' => '"usbcore"',
'Speed' => '480 Mbps',
'Module Alias' => '"usb:v0424p2514d0BB3dc09dsc00dp02ic09isc00ip02in00"',
'Config Status' => 'cfg=new, avail=yes, need=no, active=unknown',
'Attached to' => '#26 (Hub)',
)
06.04. 10:43:13 -USB Devices:
array (
1 =>
array (
'Device' => '0x7800',
'File' => 'eth0',
'Vendor' => 'usb 0x0424 "Standard Microsystems Corp."',
'Model' => 'Standard Microsystems Ethernet controller',
'Driver Modules' => 'lan78xx',
'Driver' => 'lan78xx',
),
2 =>
array (
'Device' => '0x2514',
),
)
06.04. 10:43:13 -Regler: 23
06.04. 10:43:13 -Device: MQTT wird in die user.config.php geschrieben.
06.04. 10:43:13 -Zeile gefunden. Device kann ausgetauscht werden. Index: 506 $USBRegler = "MQTT";
06.04. 10:43:13 -Zeile gefunden. Device kann ausgetauscht werden. Index: 507 $USBWechselrichter = "/dev/ttyUSB1";
06.04. 10:43:13 -Zeile gefunden. Platine kann ausgetauscht werden. Index: 523 $Platine = "Raspberry Pi 3 Model B Plus Rev 1.3";
06.04. 10:44:30 |---------------- Start sonoff_mqtt.php ---------------------
06.04. 10:44:30 -Zentraler Timestamp: 1617698670
06.04. 10:44:30 + -Die Daten werden ausgelesen...
06.04. 10:44:30 -Topic: tele/sonoff/LWT
06.04. 10:44:38 -Es handelt sich um ein Sonoff POW R2 Modul Nr.: 43
06.04. 10:44:38 * -Daten zur entfernten InfluxDB [ datasolar ] gesendet.
06.04. 10:44:38 * -Daten zur lokalen InfluxDB [ solaranzeige ] gesendet.
06.04. 10:45:26 -OK. Datenübertragung erfolgreich.
06.04. 10:45:26 |---------------- Stop sonoff_mqtt.php --------------------
06.04. 10:46:01 |---------------- Start sonoff_mqtt.php ---------------------
06.04. 10:46:02 -Zentraler Timestamp: 1617698761
06.04. 10:46:02 + -Die Daten werden ausgelesen...
06.04. 10:46:02 -Topic: tele/sonoff/LWT
06.04. 10:46:09 -Es handelt sich um ein Sonoff POW R2 Modul Nr.: 43
06.04. 10:46:10 * -Daten zur entfernten InfluxDB [ datasolar ] gesendet.
06.04. 10:46:10 * -Daten zur lokalen InfluxDB [ solaranzeige ] gesendet.
06.04. 10:46:57 -OK. Datenübertragung erfolgreich.
06.04. 10:46:57 |---------------- Stop sonoff_mqtt.php --------------------
#############################################################################
/var/www/log/php.log
======================
[03-Apr-2021 10:05:01 Europe/Berlin] PHP Fatal error: Uncaught Mosquitto\Exception: The client is not currently connected. in /var/
www/html/sonoff_mqtt.php:126
Stack trace:
#0 /var/www/html/sonoff_mqtt.php(126): Mosquitto\Client->loop(100)
#1 /var/www/html/regler_auslesen.php(157): require('/var/www/html/s...')
#2 {main}
thrown in /var/www/html/sonoff_mqtt.php on line 126
[06-Apr-2021 10:43:01 Europe/Berlin] PHP Fatal error: Uncaught Mosquitto\Exception: The connection was lost. in /var/www/html/sonof
f_mqtt.php:167
Stack trace:
#0 /var/www/html/sonoff_mqtt.php(167): Mosquitto\Client->loop(100)
#1 /var/www/html/regler_auslesen.php(157): require('/var/www/html/s...')
#2 {main}
thrown in /var/www/html/sonoff_mqtt.php on line 167
Uwe