--- /dev/null
+Title: LinuxCNC MQTT publisher component
+Tags: english, debian, linuxcnc, robot
+Date: 2023-01-08 19:30
+
+<p>I watched <a href="https://yewtu.be/watch?v=jmKUV3aNLjk">a 2015
+video from Andreas Schiffler</a> the other day, where he set up
+<a href="https://linuxcnc.org/">LinuxCNC</a> to send status
+information to the MQTT broker IBM Bluemix. As I also use MQTT for
+graphing, it occured to me that a generic MQTT LinuxCNC component
+would be useful and I set out to implement it. Today I got the first
+draft limping along and submitted as
+<ahref="https://github.com/LinuxCNC/linuxcnc/pull/2253">a patch to the
+LinuxCNC project</a>.</p>
+
+<p>The simple part was setting up the MQTT publishing code in Python.
+I already have set up other parts submitting data to my Mosquito MQTT
+broker, so I could reuse that code. Writing a LinuxCNC component in
+Python as new to me, but using existing examples in the code
+repository, this was fairly straight forward. The hardest part was
+creating a automated test for the component to ensure it was working.
+Testing it in a simulated LinuxCNC machine proved very useful, as I
+discovered features I needed that I had not thought of yet, and
+adjusted the code quite a bit to make it easier to test without a
+operational MQTT broker available.</p>
+
+<p>The draft is ready and working, but I am unsure which LinuxCNC HAL
+pins I should collect and publish by default (in other words, the
+default set of information pieces published), and how to get the
+machine name from the LinuxCNC INI file. The latter is a minor
+detail, but I expect it would be useful in a setup with several
+machines available. I am hoping for feedback from the experienced
+LinuxCNC developers and users, to make the component even better
+before it can go into the mainland LinuxCNC code base.</p>
+
+<p>Since I started on the MQTT component, I came across
+<a href="https://yewtu.be/watch?v=Bqa2grG0XtA">another video from Kent
+VanderVelden where he combine LinuxCNC with a set of screen glasses
+controlled by a Raspberry Pi</a>, and it occured to me that it would
+be useful for such use cases if LinuxCNC also provided a REST API for
+querying its status. I hope to start on such component once the MQTT
+component is working well.</p>
+
+<p>As usual, if you use Bitcoin and want to show your support of my
+activities, please send Bitcoin donations to my address
+<b><a href="bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b</a></b>.</p>