]> pere.pagekite.me Git - homepage.git/blob - blog/archive/2023/01/01.rss
Generated.
[homepage.git] / blog / archive / 2023 / 01 / 01.rss
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/'>
3 <channel>
4 <title>Petter Reinholdtsen - Entries from January 2023</title>
5 <description>Entries from January 2023</description>
6 <link>https://people.skolelinux.org/pere/blog/</link>
7
8
9 <item>
10 <title>LinuxCNC MQTT publisher component</title>
11 <link>https://people.skolelinux.org/pere/blog/LinuxCNC_MQTT_publisher_component.html</link>
12 <guid isPermaLink="true">https://people.skolelinux.org/pere/blog/LinuxCNC_MQTT_publisher_component.html</guid>
13 <pubDate>Sun, 8 Jan 2023 19:30:00 +0100</pubDate>
14 <description>&lt;p&gt;I watched &lt;a href=&quot;https://yewtu.be/watch?v=jmKUV3aNLjk&quot;&gt;a 2015
15 video from Andreas Schiffler&lt;/a&gt; the other day, where he set up
16 &lt;a href=&quot;https://linuxcnc.org/&quot;&gt;LinuxCNC&lt;/a&gt; to send status
17 information to the MQTT broker IBM Bluemix. As I also use MQTT for
18 graphing, it occured to me that a generic MQTT LinuxCNC component
19 would be useful and I set out to implement it. Today I got the first
20 draft limping along and submitted as
21 &lt;a href=&quot;https://github.com/LinuxCNC/linuxcnc/pull/2253&quot;&gt;a patch to the
22 LinuxCNC project&lt;/a&gt;.&lt;/p&gt;
23
24 &lt;p&gt;The simple part was setting up the MQTT publishing code in Python.
25 I already have set up other parts submitting data to my Mosquito MQTT
26 broker, so I could reuse that code. Writing a LinuxCNC component in
27 Python as new to me, but using existing examples in the code
28 repository and the extensive documentation, this was fairly straight
29 forward. The hardest part was creating a automated test for the
30 component to ensure it was working. Testing it in a simulated
31 LinuxCNC machine proved very useful, as I discovered features I needed
32 that I had not thought of yet, and adjusted the code quite a bit to
33 make it easier to test without a operational MQTT broker
34 available.&lt;/p&gt;
35
36 &lt;p&gt;The draft is ready and working, but I am unsure which LinuxCNC HAL
37 pins I should collect and publish by default (in other words, the
38 default set of information pieces published), and how to get the
39 machine name from the LinuxCNC INI file. The latter is a minor
40 detail, but I expect it would be useful in a setup with several
41 machines available. I am hoping for feedback from the experienced
42 LinuxCNC developers and users, to make the component even better
43 before it can go into the mainland LinuxCNC code base.&lt;/p&gt;
44
45 &lt;p&gt;Since I started on the MQTT component, I came across
46 &lt;a href=&quot;https://yewtu.be/watch?v=Bqa2grG0XtA&quot;&gt;another video from Kent
47 VanderVelden&lt;/a&gt; where he combine LinuxCNC with a set of screen glasses
48 controlled by a Raspberry Pi, and it occured to me that it would
49 be useful for such use cases if LinuxCNC also provided a REST API for
50 querying its status. I hope to start on such component once the MQTT
51 component is working well.&lt;/p&gt;
52
53 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
54 activities, please send Bitcoin donations to my address
55 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
56 </description>
57 </item>
58
59 </channel>
60 </rss>