Siemens Logo 8.4 → MQTT
Complete tutorial for configuring a Siemens Logo PLC to publish data via MQTT. Based on a real training session — includes important troubleshooting insights and lessons learned.
Prerequisites
Hardware
- ☐ Siemens Logo 8.4 PLC
- ☐ 24V power supply
- ☐ Ethernet cable
- ☐ USB to Ethernet adapter (if needed)
- ☐ Jumper wires for testing inputs
Software
- ☐ Siemens Logo Soft Comfort (programming software)
- ☐ Windows PC with administrator rights
- ☐ Eclipse Mosquitto MQTT broker
- ☐ Visual Studio Code
Network Configuration
Step 1 — Configure PC Network AdapterSet a Static IP on Your PC
Open Network and Sharing Center, click Change adapter settings, then right-click your Ethernet adapter → Properties.
Select Internet Protocol Version 4 (TCP/IPv4) → Properties, and configure:
IP Address: 10.1.10.1 Subnet Mask: 255.255.255.0 Default Gateway: 10.1.10.1
Click OK to save.
Set the Logo's IP
On the Logo device screen, navigate to:
Setup → Network → IP Address 010.001.010.002
This translates to 10.1.10.2. Confirm the settings.
Ping the Logo
Open Command Prompt and test the connection:
ping 10.1.10.2
Logo Configuration
Step 4 — Open Logo Soft ComfortGo Online
Launch Logo Soft Comfort, go to View → Network Project, and click Go Online.
Step 5 — Add Logo DeviceRegister the PLC
Click Add New Device, select Logo 8.4, and configure:
IP Address: 10.1.10.2 Subnet Mask: 255.255.255.0 Gateway: 10.1.10.1
Click OK.
Establish Connection
Right-click on the Logo device → Properties, go to the Online Settings tab, and click Connect.
Turn On MQTT Connectivity
In Properties, go to Cloud Connection Settings. Click Enable Cloud Access → Apply.
When prompted, choose Disable all unsecure ports → Continue. Click Yes when asked if the device should stop.
Configure the MQTT Connection
Click Register Thing, select MQTT from the dropdown → Next. Configure:
Broker URL: 10.1.10.1 Port: 1883 Client ID: logo # or any unique identifier Username: (leave empty) Password: (leave empty)
Click Next.
Select TCP (Unencrypted)
For this tutorial, select TCP (not TLS). Click Next.
Step 10 — Set MQTT TopicsDefine Publish Topic
Published Topic: /logo/test QoS: 0 Subscribed Topic: (leave empty — we're only publishing)
Click Next → Finish.
Data Mapping
Step 11 — Configure Data TransferMap Input to MQTT
Right-click Logo → Properties, go to Cloud Data Transfer Settings, and click + to add a new data point:
Name: Input1 # or descriptive: "DoorSensor" Range: I # Input Type: Bit Address: I1 Length: 1
Set transmission conditions:
- ✓ On Change — Sends when value changes
- ✓ Periodically — Send interval: 60 seconds (1 minute)
Leave Writable unchecked. Click Write to Logo → OK.
Creating the PLC Program
Step 12 — Create Basic ProgramWire Input to Output
In Logo Soft Comfort, switch to Diagram view. From the Digital section on the left:
- Drag an Input block to the workspace
- Drag an Output block to the workspace
- Connect Input to Output (click and drag from output pin to input pin)
What this does: When Input I1 receives 24V, it activates Output Q1. This creates a simple pass-through program — the Logo will now process and transmit input states.
Save and Transfer
File → Save As → Name: Logo_MQTT_Test
Click the Download button (white down arrow) or right-click Logo → Download. Select your saved program and click OK.
When prompted:
- ✓ Overwrite IP and Device Name
- ✓ Change to RUN mode
Click Yes.
Switch from Admin to OP
On the Logo device, press ESC repeatedly, navigate to Setup, scroll down to Switch to OP (Operating Mode), and confirm.
| Mode | Screen | Purpose |
|---|---|---|
| Admin Mode | Orange screen | Configuration access |
| Operating Mode (OP) | White screen | Runtime with I/O status display |
MQTT Broker Installation
With the Logo configured and running, we now set up the MQTT broker on the PC so the Logo has somewhere to publish its data.
Step 15 — Download Eclipse MosquittoGet the Installer
Go to mosquitto.org, navigate to the Download section, and download the Windows 64-bit installer (e.g., mosquitto-2.x.x-install-windows-x64.exe).
If your browser warns about the download, click the dots → Keep → Keep Anyway.
Step 16 — Install MosquittoRun the Installer
Use default/standard installation options. Install to the default location:
C:\Program Files\mosquittoClick Finish.
Edit the Config File
Navigate to the installation folder and open mosquitto.conf with Notepad or VS Code:
C:\Program Files\mosquitto\mosquitto.confAdd these lines at the top of the file:
bind_address 0.0.0.0 allow_anonymous true listener 1883
Save the file (may require administrator rights).
bind_address 0.0.0.0— Allows external connections (not just localhost)allow_anonymous true— Permits connections without username/passwordlistener 1883— Standard MQTT port (non-encrypted)
Allow MQTT Traffic
Open Windows Defender Firewall with Advanced Security.
Inbound Rule:
- Click Inbound Rules → New Rule
- Select Port → Next
- Select TCP → Specific local ports:
1883→ Next - Select Allow the connection → Next
- Check all network types → Next
- Name: MQTT Broker → Finish
Outbound Rule: Repeat the same steps under Outbound Rules.
Apply the Configuration
Open Services (Windows key + R → services.msc), find Mosquitto Broker, right-click → Restart.
VS Code MQTT Client Setup
Now we set up a client to subscribe to the Logo's MQTT messages and verify everything is working.
Step 20 — Install Visual Studio CodeDownload VS Code
Download from code.visualstudio.com and install with default options.
Step 21 — Install MQTT ExtensionAdd VSMQTT
Open VS Code, click the Extensions icon (left sidebar — four squares), search for MQTT, and install the VSMQTT extension. Click Trust Publisher and Install.
Set Up a Folder
In VS Code: File → Open Folder. Create a new folder (e.g., MQTT), select it, and trust the authors.
Connect to the Broker
Click the MQTT icon in the left sidebar, then Add Profile:
Profile Name: localhost Host: localhost # or 127.0.0.1 Port: 1883
Click the Connect icon.
Subscribe and Verify
Subscribe to topics: In the MQTT tab, click Subscribe and add:
/logo/# # wildcard — catches all subtopics
Publish a test message (optional): Click Publish, set the topic and payload:
Topic: /logo/test Payload: Hello MQTT!
Testing
Step 25 — Test Input SignalHardware Setup
Use a jumper wire to connect P1 (24V power) to I1 (Input 1).
Method 1: Screw Terminal
- Unplug Logo (safety)
- Unscrew P1 terminal
- Insert jumper wire alongside power cable
- Screw down securely
- Plug in Logo
Method 2: Quick Test
Touch exposed copper wire to the top of the screw heads — P1 screw → I1 screw. You should hear a small relay click.
Verify in Logo Soft Comfort
Right-click Logo → I/O Status. Click Yes to change to RUN mode. Watch the status list.
Verify in VS Code MQTT Client
Ensure you're subscribed to /logo/#. When the input changes, you'll see JSON messages like:
{
"timestamp": "...",
"I1": true
}Network Architecture & Topic Structure
Network Diagram
MQTT Topic Structure
Recommended Format (UNS Framework):
# Full UNS hierarchy /{site}/{area}/{line}/{cell}/{device}/{datapoint} # Example /filton/hydraulics/pipebender/logo01/input1 /filton/hydraulics/pipebender/logo01/status
Simple Format (Used in This Tutorial):
/logo/test /logo/demo
Troubleshooting
Connection Issues
Logo not found on network:
- ☐ Check Ethernet cable connection
- ☐ Verify PC IP:
10.1.10.1 - ☐ Verify Logo IP:
10.1.10.2 - ☐ Test with:
ping 10.1.10.2 - ☐ Ensure Logo is powered on
"Server Connection Error":
- ☐ Check Mosquitto service is running
- ☐ Verify
mosquitto.confhasbind_address 0.0.0.0 - ☐ Check firewall rules for port 1883
- ☐ Restart Mosquitto service
"Not Authorized":
- ☐ Add
allow_anonymous truetomosquitto.conf - ☐ Restart Mosquitto service
Logo Configuration Issues
"Unable to access remote device":
- ☐ Logo must be in Stop mode before downloading programs
- ☐ Click Stop button (red square) in Logo Soft Comfort
- ☐ Then attempt download again
"No programme exists in Logo":
- ☐ This is expected! The Logo requires a program
- ☐ Create the basic I/O program as described in Step 12
- ☐ Download the program to the Logo
Logo screen stays orange:
- ☐ Logo is in Admin mode
- ☐ Navigate to: Setup → Switch to OP
- ☐ Screen should turn white in Operating mode
Input not triggering:
- ☐ Ensure wire has good contact with screw terminals
- ☐ Verify you're connecting to P1 (positive 24V), not P2 (ground)
- ☐ Check Logo is in RUN mode (not STOP)
- ☐ Verify program has been downloaded
MQTT Data Issues
No messages in VS Code:
- ☐ Check Logo shows "Connected" status
- ☐ Verify subscription topic matches publish topic
- ☐ Use
#wildcard:/logo/#to catch all messages - ☐ Check Cloud Data Transfer Settings configured correctly
Messages only sent once:
- ☐ Ensure both "On Change" AND "Periodically" are checked
- ☐ This provides redundancy
Important Discoveries & Lessons Learned
These insights came directly from the training session — they're the things that aren't obvious from the documentation.
1. Logo Requires a Program
Even for simple data collection, the Logo must have a program loaded. An empty Logo will not process inputs correctly. Create a minimal program connecting inputs to outputs or memory bits.
2. Admin vs Operating Mode
The Logo has two distinct modes: Admin Mode (orange screen, configuration access) and Operating Mode (white screen, runtime with I/O display). Always switch to OP mode for normal operation.
3. External Connection Config
Mosquitto defaults to localhost-only connections. You must explicitly set bind_address 0.0.0.0, allow_anonymous true, and configure firewall rules.
4. IP Address Format
Logo uses 3-digit format: 010.001.010.002. Software uses standard format: 10.1.10.2. Don't let this trip you up.
5. Transmission Redundancy
Configure both transmission methods: On Change for real-time updates, and Periodic to ensure data is sent even if "on change" messages were lost.
6. Stop Before Download
The Logo must be in Stop mode before you can download a new program. If you get "Unable to access remote device", click the Stop button first.
Security Considerations
Current Setup (Dev/Testing)
- ✅ Unencrypted TCP
- ✅ Anonymous access
- ✅ No authentication
Production Recommendations
- 🔒 Use TLS encryption (port 8883)
- 🔒 Certificate-based authentication
- 🔒 Username/password authentication
- 🔒 Certificate management system
- 🔒 Network VLANs and DMZ
Next Steps
| Step | Description |
|---|---|
| Multiple Inputs | Map I2, I3, etc. to additional MQTT data points |
| Memory Bits | Use M bits for calculated values within the Logo program |
| Node-RED | Process MQTT data for dashboards and automation flows |
| UNS Topics | Adopt the UNS Framework topic hierarchy for production |
| Production Security | Implement TLS, authentication, and certificate management |
| fn-uns Integration | Connect to the fn-uns data pipeline for KPIs and analytics |
Quick Reference
Network
# Test connection ping 10.1.10.2 ipconfig
Mosquitto Config
# Location C:\Program Files\mosquitto\mosquitto.conf # Required lines bind_address 0.0.0.0 allow_anonymous true listener 1883 # Restart Services → Mosquitto Broker → Restart
IP Addresses
| Device | IP Address | Role |
|---|---|---|
| PC | 10.1.10.1 | MQTT Broker + Client |
| Logo 8.4 | 10.1.10.2 | MQTT Publisher |
Tutorial Version: 1.0 · Tested On: Siemens Logo 8.4, Windows 10/11, Mosquitto 2.x
Based on training session transcript. Last updated March 2026.