<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Hugo Felgueiras on Medium]]></title>
        <description><![CDATA[Stories by Hugo Felgueiras on Medium]]></description>
        <link>https://medium.com/@hugo.felgueiras?source=rss-519d46bb3996------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*xxqFOOlZqjhzZp9jEfXP1g.png</url>
            <title>Stories by Hugo Felgueiras on Medium</title>
            <link>https://medium.com/@hugo.felgueiras?source=rss-519d46bb3996------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 17:03:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hugo.felgueiras/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[S72MQTT, a Coreflux Flux Asset]]></title>
            <link>https://medium.com/coreflux-blog/s72mqtt-a-coreflux-flux-asset-3d7ea95be19c?source=rss-519d46bb3996------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d7ea95be19c</guid>
            <category><![CDATA[coreflux]]></category>
            <category><![CDATA[mqtt]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[siemens]]></category>
            <dc:creator><![CDATA[Hugo Felgueiras]]></dc:creator>
            <pubDate>Fri, 25 Mar 2022 01:00:15 GMT</pubDate>
            <atom:updated>2022-06-30T18:03:45.747Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UszaBByD70Pr8Rg4MhC29g.jpeg" /></figure><h3>1. The Purpose of this Flux Asset</h3><p>Coreflux’s <strong>S72MQTT</strong> allows you to communicate with Siemens S7 devices, by generally or selectively identifying and porting them to an <strong>MQTT Broker</strong> in JSON format, where they can be further consumed by other systems.</p><p>From the newest Tia portal S7–1500 to the oldest S7–300. You can connect your plc via ethernet.</p><p>We are able to connect to all devices with ethernet of the families of products S7 300/400/1200/1500/WinAC.</p><h3>2. Installation</h3><ul><li>There must be an MQTT Broker available (whether Coreflux’s <strong>MQTT Broker</strong> / Coreflux <strong>MQTT WebSockets Broker</strong> Flux Asset), to which the values will be written (the respective settings being used in the upcoming configuration of the S7 asset)</li><li>To install this Flux Asset, open the Coreflux interface, locate the <strong>S72MQTT</strong> Flux asset (check if you have available slots for the installation of this Flux Asset, this information is displayed on the asset box, in the “used slots / total available slots” format)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/419/1*I-P1w9QfffoEKwcEYmcsTA.png" /><figcaption>S72MQTT flux asset</figcaption></figure><p>The Flux Asset box within the Coreflux Hub app (this user has used 5 of a total of 12 owned assets)</p><ul><li>Click the “Install” button, which will prompt the opening of the configuration overlay</li><li>Configure the <strong>S72MQTT</strong> Flux Asset to be installed.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/434/1*nDaa9fZ5C1vMqOYWYHt18Q.png" /></figure><p>The configuration window on the pre-install phase</p><ul><li>Start the newly installed <strong>S72MQTT</strong> Flux Asset</li><li>After installation, the instance window for this asset installation will display the “Standby” status (to begin execution, press the Play button, and if successful, the instance status will change to “Running”)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/115/1*Bhw7PWAh9wdN8Z7_oBnSdA.png" /></figure><p>Asset installed! Time to run it.</p><ul><li>If for some reason the inputted configuration fails to execute (or permission to run is not confirmed by the system), the asset will try to enter a run state but return to a halted state when failing to do so, displaying an error popup (on the GUI Hub) or message (on the command-line Hub)</li></ul><h3>3. Glossary of Parameters</h3><ul><li><strong><em>Instance ID (String)</em></strong></li></ul><p>Name identifier attributed to this specific instance of the <strong>S72MQTT</strong> Flux Asset application (which can either be defined by the user or randomly assigned if null, at the time of the creation of that specific instance)</p><ul><li><strong><em>MQTT Broker Server Address (IP Address)</em></strong></li></ul><p>IP element of the address where the gathered and generated values should be written (if you have a local <strong>MQTT Broker</strong> Flux Asset installed and bound to any address, you can either use your specific network IP or localhost address)</p><ul><li><strong><em>MQTT Broker Server Port (TCP port)</em></strong></li></ul><p>Port element of the address where the gathered and generated values should be written (if you have a local <strong>MQTT Broker</strong> Flux Asset installed, you can either use it, inputting the specific port in which it is running). By default, it’s 1883.</p><ul><li><strong><em>S7 Address (IP Address)</em></strong></li></ul><p>IP element of the address of the target S7 PLC where we want to connect.</p><ul><li><strong><em>PLC Rack and PLC Slot</em></strong></li></ul><p>These 2 elements must meet the configuration of the running PLC, typically it should be PLC Rack=0 and PLC Slot=1 but you can check this configuration in TiaPortal <strong>Devices &gt; Device Configuration &gt;</strong> click on <strong>CPU &gt; Project Information, Rack 0, Slot 1 in this example</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*mklFYr7-gyZ4_8aweRFrgw.png" /></figure><p>We can also use the following table as reference:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*6V34n4-YbHeWzhgV8wcMXQ.jpeg" /><figcaption>Rack/Slot reference table</figcaption></figure><p>Some examples of S7 CPU’s configurations</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*UfmFKvE3P5BXVea7qIF6ug.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*MQ6kXlbcCCFC6Oe0UrY5TQ.jpeg" /><figcaption>S7 400 can have different configurations</figcaption></figure><ul><li><strong><em>Refresh Timer</em></strong></li></ul><p>Cycle time for refresh variables in ms.</p><ul><li><strong><em>Retries</em></strong></li></ul><p>A number of communication retries. If set to Zero it will indefinitely try to connect!</p><ul><li><strong><em>Retry Time (in seconds)</em></strong></li></ul><p>If the communication is lost, here you can define the time between atempts to reconnect.</p><ul><li><strong><em>Connection Resource</em></strong></li></ul><p>By default, the client connects as a PG (the programming console), with this function is possible to change the connection resource type to OP or S7 Basic (a generic data transfer connection).</p><p>In the hardware configuration (Simatic Manager) of the CPU, under the “Communication” tab, you can change, PLC-side, the connection’s distribution. So in a sense, this represents a protocol resource on the plc side.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*eOLkmRE-dJtQvISr_QtHaA.jpeg" /><figcaption>Connection Resources</figcaption></figure><ul><li><strong><em>Debug Topic</em></strong></li></ul><p>All status messages the service encounters will be published in this topic.</p><ul><li><strong><em>Debug Topic Enable</em></strong></li></ul><p>Enable the debug topic.</p><h3>4. Adding tags</h3><p>Since Siemens works with memory positions we need to provide the tags we require has topics. The structure for each tag is has followed:</p><p>&lt;Tag&gt;<br> &lt;name&gt;StringTest6&lt;/name&gt;<br> &lt;writable&gt;ToMqtt&lt;/writable&gt;<br> &lt;mqttTopic&gt;PLC/DB5/StringTest/TestValue6&lt;/mqttTopic&gt;<br> &lt;mqttQos&gt;AtMostOnce&lt;/mqttQos&gt;<br> &lt;mqttRetain&gt;false&lt;/mqttRetain&gt;<br> &lt;valueType&gt;STRING&lt;/valueType&gt;<br> &lt;S7Address&gt;DB5.DBB680 STRING 10&lt;/S7Address&gt;<br> &lt;behavior&gt;TriggerOnlyDifferent&lt;/behavior&gt;<br> &lt;/Tag&gt;</p><ul><li><strong><em>Name — </em></strong><em>A name used for the tag, just to serve as an identifier. In future with the editor version, they will come in handy to the user.</em></li><li><strong><em>Writable — </em></strong><em>ToMqtt -&gt; Reads from S7 writes in MQTT | ToS7 -&gt; Reads from S7 writes to MQTT</em></li><li><strong>mqttTopic<em>— </em></strong><em>The topic to publish the value</em></li><li><strong>mqttQos<em> — </em></strong><em>AtMostOnce — QOS 0 | AtLeastOnce — QOS 1 | ExactlyOnce — QOS2</em></li><li><strong>mqttRetain<em>—</em></strong><em> Publish the value with Retain!</em></li><li><strong>valueType — Value type fetching — BOOL |BYTE |INT |WORD |DINT |REAL |STRING</strong></li><li><strong>S7Address<em>— </em></strong><em>The address of the device var. Ex: M0.0 — bit memory for memory. For string, you need to write the number of bytes for the string followed by the keyword STRING ex:DB5.DBB680 STRING 10. In this string starts in DBB680 but the last character is @ DBB692 because the first two bytes are specific for the size and characters being used.</em></li><li><strong><em>behaviour— </em></strong><em>TriggerOnlyDifferent — Only sends data when the variable is different | TriggerAlways — Publishes always the variable to the MQTT</em></li></ul><h3>5. Enabling “Connection mechanisms” in Tia Portal</h3><p>Due to a series of hacking problems upon release of the Siemens Tia Portal and mainly targetting the models S7–1200 and S7–1500 series, Siemens adopted a solution where the user decides if it will permit access from remote partners to read/write the internal variables of the devices where it’s connecting.</p><p>In order for the <strong>S72MQTT</strong> Flux asset to be able to read/write into the PLC it is necessary to activate the access to PUT/GET communication and this is how to do it.</p><ul><li>Step 1, connect your Tia Portal project to your target PLC and then go to “<strong>Local modules” </strong>and select your PLC CPU;</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*nBLxeRH4hAAnj7O62hf-tg.jpeg" /></figure><ul><li>Step 2, double click on the device or go to Properties and scroll down and select <strong>“Protection &amp; Security”;</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oe5VeuDNKpEJpnQmQdJBKA.jpeg" /></figure><ul><li>Step 3, open <strong>“Protection &amp; Security” </strong>and select <strong>“Connection mechanisms”</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u3XjpZxSR8P5G-Lucvzg-w.jpeg" /></figure><ul><li>Step 4, make sure that option <strong>“Permit access with PUT/GET communication from remote partner”</strong> is selected.</li><li>Step 5, <strong>compile and download</strong> your new hardware configuration.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*0OWRLZG9ox6sD8Zz2yrYUg.jpeg" /></figure><p>Feel free to download Coreflux&#39;s current version @ <a href="http://www.coreflux.org/">Coreflux.org</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d7ea95be19c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coreflux-blog/s72mqtt-a-coreflux-flux-asset-3d7ea95be19c">S72MQTT, a Coreflux Flux Asset</a> was originally published in <a href="https://medium.com/coreflux-blog">Coreflux Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MQTT WS Broker, a Coreflux Flux Asset]]></title>
            <link>https://medium.com/coreflux-blog/mqtt-ws-broker-a-coreflux-flux-asset-49637cba389f?source=rss-519d46bb3996------2</link>
            <guid isPermaLink="false">https://medium.com/p/49637cba389f</guid>
            <category><![CDATA[websocket]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[mqtt]]></category>
            <category><![CDATA[https]]></category>
            <category><![CDATA[coreflux]]></category>
            <dc:creator><![CDATA[Hugo Felgueiras]]></dc:creator>
            <pubDate>Wed, 23 Mar 2022 17:43:19 GMT</pubDate>
            <atom:updated>2022-03-23T17:48:49.284Z</atom:updated>
            <content:encoded><![CDATA[<p>Prepare your own IoT Hub with this MQTT Broker. Set with users, TLS, WebSocket and/or TCP/IP.</p><h3>Glossary of Parameters (Configuration)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/424/1*QDt_xUQ6I39_Hdo4Sj58zA.png" /></figure><p>The parameters can be configured like this:</p><h3>Bind to IP</h3><p>We can define the LAN we want to provide MQTT service in this setting. If Bind IP is defined with 0.0.0.0, it enables all the interfaces… set the IP to select only one interface. This is very useful when you need to separate LANs and disable MQTT access from outside.</p><h3>TCP Port</h3><p>The WebSocket protocol is an independent TCP-based protocol. Its only relationship to HTTP is that its handshake is interpreted by HTTP servers as an Upgrade request. By default the WebSocket protocol uses <strong>port 80 for regular WebSocket connections and port 443 for WebSocket connections tunnelled over TLS</strong>.</p><h3>Client Timeout (ms)</h3><p>This timeout closes the socket if no activity is found within the socket connection.</p><h3>Persistent sessions</h3><p>This setting enables Persistent Connections.</p><p>If the client enables this, the broker stores the following information (even if the client is offline).</p><ul><li>Existence of a session (even if there are no subscriptions).</li><li>All the subscriptions of the client.</li><li>All messages in a <a href="http://www.steves-internet-guide.com/understanding-mqtt-qos-levels-part-1"><strong>Quality of Service (QoS)</strong></a> 1 or 2 flow that the client has not yet confirmed.</li><li>All new QoS 1 or 2 messages that the client missed while offline.</li><li>All QoS 2 messages received from the client that is not yet completely acknowledged.</li></ul><p>When the client reconnects, the information is available immediately.</p><h3>Connection Backlog</h3><p>This setting is used when multiple clients connect at the same time, and it defines the maximum queue of clients at peak. This setting should not be changed for a small to medium-sized IoT project. For a global concept connection, it might be required to increase the queue, which will increase the memory consumption.</p><h3>Maximum pending messages</h3><p>This setting defines the maximum pending messages that missed the delivery confirmation when using QoS 1 or 2. If the maximum number of pending messages is reached the buffer will discard the oldest in line.</p><h3>URLs to Use</h3><p>This setting is used to define the URL where the broker is serving. <a href="http://*:5000;http://localhost:5001">http://*:5000;http://localhost:5001</a></p><h3>Endpoint</h3><p>For MQTT installations this resource allows retrieving the needed information to connect and authorize with an MQTT broker.</p><h3>Instance ID</h3><p>In this field, you can define a name for the broker. <a href="http://coreflux.org/">Coreflux </a>will provide a random one if it is left empty.</p><h3>Quick Example</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/421/1*cII5mVzhUIj0M8bOTWOL5g.png" /><figcaption>MQTT WS Broker</figcaption></figure><p>Fill in all the described fields, for instance, your local machine IP Address, or leave them as default and start the asset installation. When ready start the new asset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fzc1yIChgIq9iBxdODdwsQ.png" /></figure><p>The broker should be installed and up and running. Please ensure that you add the Port configured (by default 1883) to your firewall settings.</p><p>For C# users please check :</p><p><a href="https://github.com/CorefluxCommunity/CorefluxMQTTcSharpAPI">https://github.com/CorefluxCommunity/CorefluxMQTTcSharpAPI</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49637cba389f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coreflux-blog/mqtt-ws-broker-a-coreflux-flux-asset-49637cba389f">MQTT WS Broker, a Coreflux Flux Asset</a> was originally published in <a href="https://medium.com/coreflux-blog">Coreflux Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WMI2MQTT, a Coreflux Flux Asset]]></title>
            <link>https://medium.com/coreflux-blog/wmi2mqtt-a-coreflux-flux-asset-a14cb420deb3?source=rss-519d46bb3996------2</link>
            <guid isPermaLink="false">https://medium.com/p/a14cb420deb3</guid>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[mqtt]]></category>
            <category><![CDATA[json]]></category>
            <category><![CDATA[wmi]]></category>
            <category><![CDATA[coreflux]]></category>
            <dc:creator><![CDATA[Hugo Felgueiras]]></dc:creator>
            <pubDate>Mon, 24 Jan 2022 00:16:14 GMT</pubDate>
            <atom:updated>2022-03-17T12:17:28.306Z</atom:updated>
            <content:encoded><![CDATA[<p>It was never so easy to get your Windows monitoring tools into MQTT topics and access them any where you need them.</p><h3>Glossary of Parameters (Configuration)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*vH1KDiAUmlR9M6cCmmtbDQ.png" /></figure><p>The parameters can be configured like this:</p><h3>MQTT Broker Server IP/Address</h3><p>Here we can configure the target IP address of the Broker machine that we want to monitor. By default it will point to the localhost.</p><h3>MQTT Broker Server TCP Port</h3><p>The target Broker TCP Port that we want to connect. Usually the target port is 1883.</p><h3>Publish to MQTT Topic</h3><p>The topic where you can gather the transmitted Data.</p><h3>Cycle Time (seconds)</h3><p>The time frame period to publish the Data.</p><h3>Instance ID</h3><p>The Name for the instance you want to create. If left empty it will generate a random ID.</p><h3>Quick Example</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/423/1*0cYkTYjOdnCGPCHE_dhTBg.png" /></figure><p>Fill in all the described fields or leave them as default and start the asset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gWlnmTdDFtLX1zg2eSUx2A.png" /></figure><p>The following list of topics will be published:</p><p>ITanalytics/Win32_Processor</p><p>ITanalytics/Win32_Battery</p><p>ITanalytics/Win32_DiskDrive</p><p>ITanalytics/Win32_LogicalDisk</p><p>ITanalytics/Win32_PhysicalMemory</p><p>ITanalytics/Win32_PerfFormattedData_PerfDisk_PhysicalDisk</p><p>ITanalytics/Win32_PerfFormattedData_PerfOS_Memory</p><p>ITanalytics/Win32_PerfFormattedData_Tcpip_NetworkInterface</p><p>ITanalytics/Win32_PerfFormattedData_Tcpip_TCPv4</p><p>ITanalytics/Win32_PerfRawData_PerfOS_Processor</p><p>You can get more information about WMI here <a href="https://docs.microsoft.com/en-us/windows/win32/wmisdk/about-wmi">https://docs.microsoft.com/en-us/windows/win32/wmisdk/about-wmi</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a14cb420deb3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coreflux-blog/wmi2mqtt-a-coreflux-flux-asset-a14cb420deb3">WMI2MQTT, a Coreflux Flux Asset</a> was originally published in <a href="https://medium.com/coreflux-blog">Coreflux Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>