dotnet / MQTTnet

MQTTnet is a high performance .NET library for MQTT based communication. It provides a MQTT client and a MQTT server (broker). The implementation is based on the documentation from http://mqtt.org/.
MIT License
4.47k stars 1.07k forks source link

PLC S7-1200 Client disconnected with server when it received messages #1116

Closed nguyenmanhphuc closed 2 years ago

nguyenmanhphuc commented 3 years ago

Describe your question

I tried to build a simple MQTT broker for PLC s7 - 1200. the client cannot with the server and publish the messages to the broker but when another client publishes the messages to the topic PLC s7 - 1200 subscribed, It disconnects to the server. I tried another broker in docker, it worked well. Is this problem because there are differences in the algorithms at client and broker.

Thank for you help

Which project is your question related to?

chkr1011 commented 3 years ago

Please attach the trace (described in wiki) so that we get some Insights about whats happening.

SeppPenner commented 3 years ago

This can be caused from multiple issues.

  1. Please make sure that your client identifiers are unique on all devices (I assume that this is the case).
  2. Check whether there are TLS issues (in general) if you use it.
  3. It's hard to guess, but do your PLCs maybe not support TLS1.3 and you use the latest MQTTnet server on Net 5.0? (Then you would have to downgrade the client and server explicitely to TLS1.2) as described (for the client side) here: https://github.com/chkr1011/MQTTnet/issues/1085#issuecomment-788067211
  4. Something else, so we need the trace for that.
chkr1011 commented 2 years ago

Closing this due to inactivity.