Hardware MQTT Siemens Logo 8.4 ~60 min

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

Software

📷
Photo: Siemens Logo 8.4 PLC with power supply and Ethernet cable connected

Network Configuration

Step 1 — Configure PC Network Adapter

Set 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.

i
Why Static IP? The Logo doesn't have DHCP capabilities, so you need a static IP to communicate directly with it.
📷
Screenshot: Windows TCP/IPv4 properties dialog with static IP configured
Step 2 — Configure Logo IP Address

Set the Logo's IP

On the Logo device screen, navigate to:

SetupNetworkIP Address
010.001.010.002

This translates to 10.1.10.2. Confirm the settings.

i
IP Format: The Logo uses a 3-digit format for each octet — 010 for 10, 001 for 1, 002 for 2.
📷
Photo: Logo device screen showing IP address configuration in 3-digit format
Step 3 — Verify Connectivity

Ping the Logo

Open Command Prompt and test the connection:

ping 10.1.10.2
You should see successful replies confirming the Logo is reachable on the network.
📷
Screenshot: Command Prompt showing successful ping replies from 10.1.10.2

Logo Configuration

Step 4 — Open Logo Soft Comfort

Go Online

Launch Logo Soft Comfort, go to View → Network Project, and click Go Online.

Step 5 — Add Logo Device

Register 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.

📷
Screenshot: Logo Soft Comfort — Add New Device dialog with IP configuration
Step 6 — Connect to Logo

Establish Connection

Right-click on the Logo device → Properties, go to the Online Settings tab, and click Connect.

You should now be connected to the Logo.
Step 7 — Enable Cloud Access

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.

📷
Screenshot: Logo Soft Comfort — Cloud Connection Settings with Enable Cloud Access
Step 8 — Register MQTT Thing

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.

i
Note: The broker URL points to your PC's IP. The broker doesn't need to be running yet — we'll set that up in the MQTT Broker section. The Logo will retry the connection automatically.
📷
Screenshot: Logo Soft Comfort — MQTT Thing registration with broker URL and port
Step 9 — Configure Security

Select TCP (Unencrypted)

For this tutorial, select TCP (not TLS). Click Next.

i
Production Note: In production environments, use TLS with certificates. This requires a broker CA certificate, device certificate, and device key. Managing certificate renewals (typically annual or quarterly) across many devices requires proper certificate management infrastructure.
Step 10 — Set MQTT Topics

Define Publish Topic

Published Topic:   /logo/test
QoS:               0
Subscribed Topic:  (leave empty — we're only publishing)

Click Next → Finish.

📷
Screenshot: Logo Soft Comfort — MQTT topic configuration

Data Mapping

Step 11 — Configure Data Transfer

Map 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:

Leave Writable unchecked. Click Write to Logo → OK.

i
Transmission Strategy: Using both methods provides redundancy. On Change gives immediate updates when input state changes. Periodic acts as a backup — useful if the broker was temporarily offline.
📷
Screenshot: Logo Soft Comfort — Cloud Data Transfer Settings with Input1 mapped

Creating the PLC Program

CRITICAL STEP: The Logo must have a program loaded, even if it's minimal! This was the key discovery from the training session. The Logo will not function properly without a program.
Step 12 — Create Basic Program

Wire Input to Output

In Logo Soft Comfort, switch to Diagram view. From the Digital section on the left:

  1. Drag an Input block to the workspace
  2. Drag an Output block to the workspace
  3. 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.

📷
Screenshot: Logo Soft Comfort — Diagram view with Input block connected to Output block
Step 13 — Download Program to Logo

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:

Click Yes.

The Logo screen should change from orange to white.
📷
Screenshot: Logo Soft Comfort — Download dialog with overwrite and RUN mode options
Step 14 — Set Logo to Operating Mode

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.

ModeScreenPurpose
Admin ModeOrange screenConfiguration access
Operating Mode (OP)White screenRuntime with I/O status display
📷
Photo: Logo device screen — white Operating Mode display showing I/O status
i
Logo setup complete. The PLC is now configured, programmed, and running. It will attempt to connect to the MQTT broker at 10.1.10.1:1883 and retry automatically. Next, we'll set up the broker and a test client on the PC side.

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 Mosquitto

Get 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 → KeepKeep Anyway.

Step 16 — Install Mosquitto

Run the Installer

Use default/standard installation options. Install to the default location:

C:\Program Files\mosquitto

Click Finish.

📷
Screenshot: Mosquitto installer — default installation path selected
Step 17 — Configure Mosquitto

Edit the Config File

Navigate to the installation folder and open mosquitto.conf with Notepad or VS Code:

C:\Program Files\mosquitto\mosquitto.conf

Add 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).

Step 18 — Configure Windows Firewall

Allow MQTT Traffic

Open Windows Defender Firewall with Advanced Security.

Inbound Rule:

  1. Click Inbound RulesNew Rule
  2. Select Port → Next
  3. Select TCP → Specific local ports: 1883 → Next
  4. Select Allow the connection → Next
  5. Check all network types → Next
  6. Name: MQTT Broker → Finish

Outbound Rule: Repeat the same steps under Outbound Rules.

i
Important: The default is "Block" — ensure you select Allow the connection.
📷
Screenshot: Windows Firewall — new inbound rule for port 1883
Step 19 — Restart Mosquitto Service

Apply the Configuration

Open Services (Windows key + R → services.msc), find Mosquitto Broker, right-click → Restart.

If the service won't start, check your mosquitto.conf for syntax errors. A common mistake is extra spaces or missing values.
Once the broker is running, the Logo should automatically connect. Check Logo Soft Comfort — the MQTT status should show Connected.
📷
Screenshot: Windows Services showing Mosquitto Broker running

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 Code

Download VS Code

Download from code.visualstudio.com and install with default options.

Step 21 — Install MQTT Extension

Add 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.

📷
Screenshot: VS Code Extensions marketplace showing VSMQTT extension
Step 22 — Create Workspace

Set Up a Folder

In VS Code: File → Open Folder. Create a new folder (e.g., MQTT), select it, and trust the authors.

Step 23 — Configure MQTT Connection

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.

You should see Online with a green indicator at the top right.
📷
Screenshot: VS Code VSMQTT panel showing "Online" connection status
Step 24 — Subscribe to Logo Topics

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!
You should see the message appear in the Messages section. If the Logo is connected and running, you'll also see its periodic data messages arriving.
📷
Screenshot: VS Code MQTT client — subscribed to /logo/# with test message received

Testing

Step 25 — Test Input Signal

Hardware Setup

Use a jumper wire to connect P1 (24V power) to I1 (Input 1).

Method 1: Screw Terminal

  1. Unplug Logo (safety)
  2. Unscrew P1 terminal
  3. Insert jumper wire alongside power cable
  4. Screw down securely
  5. 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.

📷
Photo: Jumper wire connecting P1 (24V) to I1 on the Logo terminal block
Step 26 — Monitor I/O Status

Verify in Logo Soft Comfort

Right-click Logo → I/O Status. Click Yes to change to RUN mode. Watch the status list.

When you connect P1 to I1, the value should change from 0 to 1.

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
}
📷
Screenshot: VS Code MQTT client showing received JSON message with I1: true

Network Architecture & Topic Structure

Network Diagram

Logo 8.4 10.1.10.2 MQTT Publisher Ethernet PC — 10.1.10.1 Mosquitto Broker Port 1883 VS Code MQTT Client Subscriber Node-RED or other clients (future)

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:

"Server Connection Error":

"Not Authorized":

Logo Configuration Issues

"Unable to access remote device":

"No programme exists in Logo":

Logo screen stays orange:

Input not triggering:

MQTT Data Issues

No messages in VS Code:

Messages only sent once:

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
i
Certificate management for hundreds of devices requires infrastructure planning, as certificates typically expire annually or quarterly.

Next Steps

StepDescription
Multiple InputsMap I2, I3, etc. to additional MQTT data points
Memory BitsUse M bits for calculated values within the Logo program
Node-REDProcess MQTT data for dashboards and automation flows
UNS TopicsAdopt the UNS Framework topic hierarchy for production
Production SecurityImplement TLS, authentication, and certificate management
fn-uns IntegrationConnect 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

DeviceIP AddressRole
PC10.1.10.1MQTT Broker + Client
Logo 8.410.1.10.2MQTT 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.