Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"MQTT is not connected" reason: "TCP disconnected #780

Closed
17 tasks
kriebsam opened this issue Mar 16, 2023 · 13 comments
Closed
17 tasks

"MQTT is not connected" reason: "TCP disconnected #780

kriebsam opened this issue Mar 16, 2023 · 13 comments
Assignees
Labels
question Further information is requested stale closed to no response / progress

Comments

@kriebsam
Copy link

Hardware

  • [x ] ESP8266
  • ESP32
  • Raspberry Pi

Modelname: ______
Retailer URL: ______

nRF24L01+ Module

  • nRF24L01+ you verified this is a Plus model capable of the required 256kBit/s mode
  • square dot indicates original Nordic Semicon chip
  • round dot indicates copy-cat / counterfeit SI labs chip

Antenna:

  • [ x] circuit board
  • external antenna

Power Stabilization:

  • 100uF Electrolytic Capacitor
    connected between +3.3V and GND (Pin 1 & 2) of the NRF Module
  • Voltage stabilizing motherboard

Connection diagram:

  • Image of the your wiring attached

Connection diagram I used:

nRF24L01+ Pin ESP8266 GPIO
Pin 1 GND [*] GND
Pin 2 +3.3V +3.3V
Pin 3 CE GPIO2 CE D4
Pin 4 CSN GPIO15 CS D8
Pin 5 SCK GPIO14 SCLK D5
Pin 6 MOSI GPIO13 MOSI D7
Pin 7 MISO GPIO12 MISO D6
Pin 8 IRQ GPIO0 IRQ D3
nRF24L01+ Pin ESP32 GPIO
Pin 1 GND [*] GND
Pin 2 +3.3V +3.3V
Pin 3 CE GPIO4 CE D4
Pin 4 CSN GPIO5 CS D5
Pin 5 SCK GPIO18 SCLK D18
Pin 6 MOSI GPIO23 MOSI D23
Pin 7 MISO GPIO19 MISO D19
Pin 8 IRQ GPIO0 IRQ D0

Note: [*] GND Pin 1 has a square mark on the nRF24L01+ module

Software

  • AhoyDTU
  • OpenDTU

Version / Git SHA:

Version: ..__
Github Hash: _______

Build & Flash Method:

  • Arduino
  • ESP Tools
  • [x ] Platform IO

Desktop OS:

  • Linux
  • Windows
  • Mac OS

Debugging:

  • [x ] USB Serial Log (attached)
  • Setup settings (use our templates ... to be added)

Die AhoyDTU ist aktiv und erhält Daten vom Inverter. Inverter #0: Ba51-Inverter (v10018) is available and is producing; ABER es wird keine Verbindung zum MQTT-Broker aufgebaut. Daten für MQTT gesetzt; IP des Brokers, Port: 1833;
Im "Serial"-Monitor erscheint neben den Abfragewerten aus dem Inverter die Meldung: "MQTT disconnected, reason: TCP disconnect"

Im MQTT-Explorer taucht nur die IP von Home Assistant (.178.79) auf, nicht aber die IP der AhouDTU (.178.80)

Home Assistant und läuft auf einer VM meiner Synology 2018+

Meine Ideen sind mir ausgegangen. Kann jemand helfen?
Klaus

@lumapu
Copy link
Owner

lumapu commented Mar 16, 2023

ist das schon immer so oder erst in neuen Versionen?
Geht es nach dem Start oder nie?
Eine Ahoy Versionsnummer wäre noch hilfreich

@kriebsam
Copy link
Author

Ich hatte vor ca. 2 Wochen erstmalig über den Online Installer (ahoydtu.de) den ESP programmiert und dann den Inverter (Hoymiles) in Betrieb genommen. Die Kommunikation hat aber erst funktioniert, nachdem ich die voreingestellte Wemos PIN-Belegung in der Ahoy-Konfig angepasst hatte. Eingestellt ist jetzt:
CS => D8(GPIO15)
CE => D3(GPIO0)
IRQ => D4(GPIO02)

Die MQTT hat auch nach vielen Neustarts der AHOYDTU noch nie eine Verbindung aufgebaut.

AHOYDTU_Serial-Output

Beiliegend ein Auszug aus der: AHOYDTU (Serial/Control) sowie AhoyDTY (Systemdaten)
AhoyDTU_Systemdaten.txt

@lumapu
Copy link
Owner

lumapu commented Mar 23, 2023

bitte mal die Developmentversion 0.5.105 testen, hier geht es um 0.5.66

@lumapu
Copy link
Owner

lumapu commented Mar 27, 2023

Es gibt bald eine neue MqTT Lib Verison, habe die Änderung schon erfolgreich getestet und löst bei mir das Problem:

bertmelis/espMqttClient#86

hier unsere Schritte zur Lösung:
bertmelis/espMqttClient#85

lumapu added a commit that referenced this issue Mar 27, 2023
* MQTT fix reconnection by new lib version #780
* display 'failed' if no Update was selected #813
lumapu added a commit that referenced this issue Mar 27, 2023
* MQTT fix reconnection by new lib version #780
* add `about` page
lumapu added a commit that referenced this issue Mar 27, 2023
* MQTT fix reconnection by new lib version #780
* add `about` page
* improved documentation regarding SPI pins #814
* improved documentation (getting started) #815 #816
* improved MI 4-ch inverter #820
@rmayergfx
Copy link

rmayergfx commented Mar 29, 2023

@kriebsam
Bitte mal auf einem Rechner den MQTT Eplorer laufen lassen, aber nicht in der VM!
Ist es wirklich eine VM oder ein Docker Container? In welchem Netz läuft die VM? Wo läuft der MQTT Service?
Nutzt du den Mosquitto MQTT Broker? Ist in der Config anonymous erlaubt?
So wie es sich anhört sind Ahoy DTU und VM, MQTT Broker in unterschiedlichen Netzwerkbereichen und können sich deshalb nicht sehen.

@kriebsam
Copy link
Author

kriebsam commented Mar 29, 2023 via email

@GallusMax
Copy link

GallusMax commented Apr 3, 2023

Es gibt bald eine neue MqTT Lib Verison, habe die Änderung schon erfolgreich getestet und löst bei mir das Problem:

bertmelis/espMqttClient#86

hier unsere Schritte zur Lösung: bertmelis/espMqttClient#85

MeToo: in der Version 0.6.0 hatte ich gestern einen Verbindungsabbruch MQTT "TCP disconnected".
<ahoyIP/serial war weiter aktiv
/reboot brachte es wieder in die Spur

[GIT SHA: 9c7d7a0 :: 0.6.0](https://github.com/lumapu/ahoy/commits/9c7d7a0)
Board: ESP8266

@lumapu
Copy link
Owner

lumapu commented Apr 4, 2023

komisch, kommt das TCP disconnected immer wieder?

@matze19999
Copy link

Ich hab das gleiche Problem. Ich hab noch überhaupt nicht geschafft eine MQTT Verbindung herzustellen. Im Log taucht die Fehlermeldung TCP disconnected alle paar Sekunden auf.

@rmayergfx
Copy link

@matze19999
Ohne Info mit welchem Broker und welchen Einstellungen du arbeitest wird es schwierig. Bitte mehr Infos. Ist anonymous aktiviert? Bitte mal einen Screenshot der AhoyDTU MQTT Settings hochladen. ServerIP kannst du gerne schwärzen.

@matze19999
Copy link

matze19999 commented Jul 19, 2023

@matze19999 Ohne Info mit welchem Broker und welchen Einstellungen du arbeitest wird es schwierig. Bitte mehr Infos. Ist anonymous aktiviert? Bitte mal einen Screenshot der AhoyDTU MQTT Settings hochladen. ServerIP kannst du gerne schwärzen.

Sorry. Broker ist Mosquitto als Addon in Home Assistant installiert. Funktioniert aber auch nicht wenn Mosquitto direkt unter Linux installiert ist oder als Docker Container läuft.

Authentifizierung per Username / Password ohne Sonderzeichen.

Ahoy DTU EInstellungen:

image

Server IP fand ich sinnlos zu schwärzen bei einer privaten IP :)

Hier noch der Log von der AhoyDTU

image

@rmayergfx
Copy link

rmayergfx commented Jul 19, 2023

Starte doch mal den MQTT Explorer http://mqtt-explorer.com/ und prüfe ob der Broker überhaupt erreichbar ist.
Dann probiere mal das ganze ohne Username und Passwort, d.h. setze im Broker die dafür notwendigen optionen das er auf anonymous reagiert. username und password mal im Broker geändert und probiert ob es dann geht?
Ganz wichtig wäre das protokoll vom Broker, da könntest du sehen woran der Login scheitert, ich denke das dies das eigentliche Problem ist.
https://mosquitto.org/man/mosquitto_passwd-1.html

Password File wurde auch richtig erstellt?
http://www.steves-internet-guide.com/mqtt-username-password-example/

@lumapu lumapu self-assigned this Aug 5, 2023
@lumapu lumapu added the question Further information is requested label Aug 5, 2023
@lumapu
Copy link
Owner

lumapu commented Aug 5, 2023

das Problem sollte nicht exisitieren, bitte aktuelles Release 0.7.25 testen

@lumapu lumapu added the stale closed to no response / progress label Sep 16, 2023
@lumapu lumapu closed this as completed Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested stale closed to no response / progress
Projects
None yet
Development

No branches or pull requests

5 participants