Troubleshooting Siemens PLC Connection Issues to MQTT Broker

Question:

Hello everyone, I am currently experiencing difficulties connecting my "Siemens PLC" to an MQTT broker. The MQTT-node status in node-red continuously shows as 'connecting', while the MQTT-explorer client software indicates it is 'Disconnected from server'. My setup includes a "Siemens PLC" (S7-1200 CPU1214C DC/DC/DC) with an IP address of 192.168.0.1, TIA portal V-17, and a PC with an IP address of 192.168.0.2 serving as the MQTT broker. If you are facing similar issues with connecting Siemens PLC to MQTT broker, read on for troubleshooting tips.

Top Replies

If you're setting up a network, you'll need a broker for MQTT communication. You can choose to use popular brokers like Mosquito or opt for a publicly available option like HIVE if you're connecting via the Internet.

Have you ensured that port 1883 is open on your PC? The output status on your PLC is displaying 7004, which typically indicates that a connection has been established and is being monitored, but no data processing is currently active. This suggests that your PLC is connected to the MQTT server, but there may be an issue with Publishing or Subscribing to data. Have you checked the status of the MQTT node in node-red? Are MQTT and node-red running on the same PC? If so, have you configured it to use 'localhost' or 127.0.0.1 as the server? What is your node setup in node-red?

It sounds like you've done a thorough job with your setup process. Are you sure your MQTT broker is set up correctly and running on the expected port? You may want to verify firewall settings on your PC to ensure the port isn't being blocked which can interfere with connectivity. Also, double-check your MQTT broker's IP address in your node-red configuration is the same as your PC's IP address. Good luck with the troubleshooting process!

Hey, I faced a similar issue once, and it turned out due to a mismatch in the MQTT version on both sides. Please ensure that both your Siemens PLC and your MQTT server are using a compatible MQTT version. If they're not, you might have to upgrade or modify your server or PLC's software. Also, check your firewall settings to ensure there's no blocking happening. Lastly, verify the broker's Over-Lock settings if you are getting 'Disconnected from server' notice, it might be due to too many unsuccessful login attempts. I hope this helps!

Hi there, it sounds like this could possibly be an issue with your network settings or firewall. Firstly, ensure that both devices are on the same network and can ping each other successfully. If that's a green signal, then review your MQTT broker settings for any possible configuration mismatches. Also, it's worth checking if your MQTT port (default is 1883) is not being blocked by your PC’s firewall. Sometimes, such simple hiccups cause a lot of trouble. Let us know your findings so we can provide more specialized advice!

It sounds like you're running into a network configuration issue. First, double-check that your Siemens PLC is on the same subnet as your MQTT broker (192.168.0.x) and that there's no firewall blocking the connection between the two. Also, ensure that the MQTT broker is properly set up to accept connections, and that you're using the correct port (usually 1883 for unencrypted connections). It might also help to test the broker with a different client to rule out issues on that end. Good luck!

It sounds like you're facing a frustrating challenge! One thing to check is the firewall settings on your PC and any network configurations—make sure that the ports for MQTT (usually 1883) are open and that the PLC and PC can see each other on the network. Also, verify that your MQTT broker is correctly set up to accept connections from your PLC's IP address. Sometimes, the broker might require specific authentication settings too, so ensure those are aligned as well. Good luck, and I hope you can get it sorted soon!

More Replies →

Streamline Your Asset Management
See How Oxmaint Works!!

✅   Work Order Management

✅   Asset Tracking

✅   Preventive Maintenance

✅   Inspection Report

We have received your information. We will share Schedule Demo details on your Mail Id.

To add a comment, please sign in or register if you haven't already..   

Frequently Asked Questions (FAQ)

FAQ: 1. Why is my Siemens PLC having trouble connecting to the MQTT broker?

Answer: - The connection issue may be due to misconfigured settings, network issues, or incompatible protocols between the PLC and the MQTT broker.

FAQ: 2. How can I troubleshoot connection issues between Siemens PLC and MQTT broker?

Answer: - Check the network configurations, ensure the correct IP addresses are assigned, verify protocol compatibility, review firewall settings, and confirm MQTT client configurations.

FAQ: 3. What could be causing the MQTT-node status in node-red to continuously show as 'connecting'?

Answer: - The 'connecting' status may indicate a problem with the communication settings, authentication credentials, or connectivity between the PLC and the MQTT broker.

FAQ: 4. Why does the MQTT-explorer client software show 'Disconnected from server' when attempting to connect?

Answer: - The 'Disconnected from server' message could suggest issues with the server address, port settings, security settings, or network connectivity between the client software and the MQTT broker.

FAQ: 5. Is there a specific setup requirement for connecting Siemens PLC (S7-1200) to an MQTT broker?

Answer: - Ensure that the PLC's TIA portal is configured correctly, the IP addresses are assigned appropriately, and the necessary communication protocols (such as MQTT) are supported by both the PLC and the MQTT broker.

Ready to Simplify Maintenance?

Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.

Request Demo  â†’