]> pere.pagekite.me Git - homepage.git/blob - blog/index.rss
Generated.
[homepage.git] / blog / index.rss
1 <?xml version="1.0" encoding="utf-8"?>
2 <rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:atom="http://www.w3.org/2005/Atom">
3 <channel>
4 <title>Petter Reinholdtsen</title>
5 <description></description>
6 <link>https://people.skolelinux.org/pere/blog/</link>
7 <atom:link href="https://people.skolelinux.org/pere/blog/index.rss" rel="self" type="application/rss+xml" />
8
9 <item>
10 <title>rtlsdr-scanner, software defined radio frequency scanner for Linux - nice free software</title>
11 <link>https://people.skolelinux.org/pere/blog/rtlsdr_scanner__software_defined_radio_frequency_scanner_for_Linux____nice_free_software.html</link>
12 <guid isPermaLink="true">https://people.skolelinux.org/pere/blog/rtlsdr_scanner__software_defined_radio_frequency_scanner_for_Linux____nice_free_software.html</guid>
13 <pubDate>Tue, 7 Mar 2023 23:10:00 +0100</pubDate>
14 <description>&lt;p&gt;Today I finally found time to track down a useful radio frequency
15 scanner for my software defined radio. Just for fun I tried to locate
16 the radios used in the areas, and a good start would be to scan all
17 the frequencies to see what is in use. I&#39;ve tried to find a useful
18 program earlier, but ran out of time before I managed to find a useful
19 tool. This time I was more successful, and after a few false leads I
20 found a description of
21 &lt;a href=&quot;https://www.kali.org/tools/rtlsdr-scanner/&quot;&gt;rtlsdr-scanner
22 over at the Kali site&lt;/a&gt;, and was able to track down
23 &lt;a href=&quot;https://gitlab.com/kalilinux/packages/rtlsdr-scanner.git&quot;&gt;the
24 Kali package git repository&lt;/a&gt; to build a deb package for the
25 scanner. Sadly the package is missing from the Debian project itself,
26 at least in Debian Bullseye. Two runtime dependencies,
27 &lt;a href=&quot;https://gitlab.com/kalilinux/packages/python-visvis.git&quot;&gt;python-visvis&lt;/a&gt;
28 and
29 &lt;a href=&quot;https://gitlab.com/kalilinux/packages/python-rtlsdr.git&quot;&gt;python-rtlsdr&lt;/a&gt;
30 had to be built and installed separately. Luckily &#39;&lt;tt&gt;gbp
31 buildpackage&lt;/tt&gt;&#39; handled them just fine and no further packages had
32 to be manually built. The end result worked out of the box after
33 installation.&lt;/p&gt;
34
35 &lt;p&gt;My initial scans for FM channels worked just fine, so I knew the
36 scanner was functioning. But when I tried to scan every frequency
37 from 100 to 1000 MHz, the program stopped unexpectedly near the
38 completion. After some debugging I discovered USB software radio I
39 used rejected frequencies above 948 MHz, triggering a unreported
40 exception breaking the scan. Changing the scan to end at 957 worked
41 better. I similarly found the lower limit to be around 15, and ended
42 up with the following full scan:&lt;/p&gt;
43
44 &lt;p&gt;&lt;a href=&quot;https://people.skolelinux.org/pere/blog/images/2023-04-07-radio-freq-scanning.png&quot;&gt;&lt;img src=&quot;https://people.skolelinux.org/pere/blog/images/2023-04-07-radio-freq-scanning.png&quot; width=&quot;100%&quot;&gt;&lt;/a&gt;&lt;/p&gt;
45
46 &lt;p&gt;Saving the scan did not work, but exporting it as a CSV file worked
47 just fine. I ended up with around 477k CVS lines with dB level for
48 the given frequency.&lt;/p&gt;
49
50 &lt;p&gt;The save failure seem to be a missing UTF-8 encoding issue in the
51 python code. Will see if I can find time to send a patch
52 &lt;a href=&quot;https://github.com/CdeMills/RTLSDR-Scanner/&quot;&gt;upstream&lt;/a&gt;
53 later to fix this exception:&lt;/p&gt;
54
55 &lt;pre&gt;
56 Traceback (most recent call last):
57 File &quot;/usr/lib/python3/dist-packages/rtlsdr_scanner/main_window.py&quot;, line 485, in __on_save
58 save_plot(fullName, self.scanInfo, self.spectrum, self.locations)
59 File &quot;/usr/lib/python3/dist-packages/rtlsdr_scanner/file.py&quot;, line 408, in save_plot
60 handle.write(json.dumps(data, indent=4))
61 TypeError: a bytes-like object is required, not &#39;str&#39;
62 Traceback (most recent call last):
63 File &quot;/usr/lib/python3/dist-packages/rtlsdr_scanner/main_window.py&quot;, line 485, in __on_save
64 save_plot(fullName, self.scanInfo, self.spectrum, self.locations)
65 File &quot;/usr/lib/python3/dist-packages/rtlsdr_scanner/file.py&quot;, line 408, in save_plot
66 handle.write(json.dumps(data, indent=4))
67 TypeError: a bytes-like object is required, not &#39;str&#39;
68 &lt;/pre&gt;
69
70 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
71 activities, please send Bitcoin donations to my address
72 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
73 </description>
74 </item>
75
76 <item>
77 <title>OpenSnitch available in Debian Sid and Bookworm</title>
78 <link>https://people.skolelinux.org/pere/blog/OpenSnitch_available_in_Debian_Sid_and_Bookworm.html</link>
79 <guid isPermaLink="true">https://people.skolelinux.org/pere/blog/OpenSnitch_available_in_Debian_Sid_and_Bookworm.html</guid>
80 <pubDate>Sat, 25 Feb 2023 20:30:00 +0100</pubDate>
81 <description>&lt;p&gt;Thanks to the efforts of the OpenSnitch lead developer Gustavo
82 Iñiguez Goya allowing me to sponsor the upload,
83 &lt;a href=&quot;https://tracker.debian.org/pkg/opensnitch&quot;&gt;the interactive
84 application firewall OpenSnitch&lt;/a&gt; is now available in Debian
85 Testing, soon to become the next stable release of Debian.&lt;/p&gt;
86
87 &lt;p&gt;This is a package which set up a network firewall on one or more
88 machines, which is controlled by a graphical user interface that will
89 ask the user if a program should be allowed to connect to the local
90 network or the Internet. If some background daemon is trying to dial
91 home, it can be blocked from doing so with a simple mouse click, or by
92 default simply by not doing anything when the GUI question dialog pop
93 up. A list of all programs discovered using the network is provided
94 in the GUI, giving the user an overview of how the machine(s) programs
95 use the network.&lt;/p&gt;
96
97 &lt;p&gt;OpenSnitch was uploaded for NEW processing about a month ago, and I
98 had little hope of it getting accepted and shaping up in time for the
99 package freeze, but the Debian ftpmasters proved to be amazingly quick
100 at checking out the package and it was accepted into the archive about
101 week after the first upload. It is now team maintained under the Go
102 language team umbrella. A few fixes to the default setup is only in
103 Sid, and should migrate to Testing/Bookworm in a week.&lt;/p&gt;
104
105 &lt;p&gt;During testing I ran into an
106 &lt;a href=&quot;https://github.com/evilsocket/opensnitch/issues/813&quot;&gt;issue
107 with Minecraft server broadcasts disappearing&lt;/a&gt;, which was quickly
108 resolved by the developer with a patch and a proposed configuration
109 change. I&#39;ve been told this was caused by the Debian packages default
110 use if /proc/ information to track down kernel status, instead of the
111 newer eBPF module that can be used. The reason is simply that
112 upstream and I have failed to find a way to build the eBPF modules for
113 OpenSnitch without a complete configured Linux kernel source tree,
114 which as far as we can tell is unavailable as a build dependency in
115 Debian. We tried unsuccessfully so far to use the kernel-headers
116 package. It would be great if someone could provide some clues how to
117 build eBPF modules on build daemons in Debian, possibly without the full
118 kernel source.&lt;/p&gt;
119
120 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
121 activities, please send Bitcoin donations to my address
122 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
123 </description>
124 </item>
125
126 <item>
127 <title>Is the desktop recommending your program for opening its files?</title>
128 <link>https://people.skolelinux.org/pere/blog/Is_the_desktop_recommending_your_program_for_opening_its_files_.html</link>
129 <guid isPermaLink="true">https://people.skolelinux.org/pere/blog/Is_the_desktop_recommending_your_program_for_opening_its_files_.html</guid>
130 <pubDate>Sun, 29 Jan 2023 11:00:00 +0100</pubDate>
131 <description>&lt;p&gt;Linux desktop systems
132 &lt;a href=&quot;https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html&quot;&gt;have
133 standardized&lt;/a&gt; how programs present themselves to the desktop
134 system. If a package include a .desktop file in
135 /usr/share/applications/, Gnome, KDE, LXDE, Xfce and the other desktop
136 environments will pick up the file and use its content to generate the
137 menu of available programs in the system. A lesser known fact is that
138 a package can also explain to the desktop system how to recognize the
139 files created by the program in question, and use it to open these
140 files on request, for example via a GUI file browser.&lt;/p&gt;
141
142 &lt;p&gt;A while back I ran into a package that did not tell the desktop
143 system how to recognize its files and was not used to open its files
144 in the file browser and fixed it. In the process I wrote a simple
145 debian/tests/ script to ensure the setup keep working. It might be
146 useful for other packages too, to ensure any future version of the
147 package keep handling its own files.&lt;/p&gt;
148
149 &lt;p&gt;For this to work the file format need a useful MIME type that can
150 be used to identify the format. If the file format do not yet have a
151 MIME type, it should define one and preferably also
152 &lt;a href=&quot;https://www.iana.org/assignments/media-types/media-types.xhtml&quot;&gt;register
153 it with IANA&lt;/a&gt; to ensure the MIME type string is reserved.&lt;/p&gt;
154
155 &lt;p&gt;The script uses the &lt;tt&gt;xdg-mime&lt;/tt&gt; program from xdg-utils to
156 query the database of standardized package information and ensure it
157 return sensible values. It also need the location of an example file
158 for xdg-mime to guess the format of.&lt;/p&gt;
159
160 &lt;pre&gt;
161 #!/bin/sh
162 #
163 # Author: Petter Reinholdtsen
164 # License: GPL v2 or later at your choice.
165 #
166 # Validate the MIME setup, making sure motor types have
167 # application/vnd.openmotor+yaml associated with them and is connected
168 # to the openmotor desktop file.
169
170 retval=0
171
172 mimetype=&quot;application/vnd.openmotor+yaml&quot;
173 testfile=&quot;test/data/real/o3100/motor.ric&quot;
174 mydesktopfile=&quot;openmotor.desktop&quot;
175
176 filemime=&quot;$(xdg-mime query filetype &quot;$testfile&quot;)&quot;
177
178 if [ &quot;$mimetype&quot; != &quot;$filemime&quot; ] ; then
179 retval=1
180 echo &quot;error: xdg-mime claim motor file MIME type is $filemine, not $mimetype&quot;
181 else
182 echo &quot;success: xdg-mime report correct mime type $mimetype for motor file&quot;
183 fi
184
185 desktop=$(xdg-mime query default &quot;$mimetype&quot;)
186
187 if [ &quot;$mydesktopfile&quot; != &quot;$desktop&quot; ]; then
188 retval=1
189 echo &quot;error: xdg-mime claim motor file should be handled by $desktop, not $mydesktopfile&quot;
190 else
191 echo &quot;success: xdg-mime agree motor file should be handled by $mydesktopfile&quot;
192 fi
193
194 exit $retval
195 &lt;/pre&gt;
196
197 &lt;p&gt;It is a simple way to ensure your users are not very surprised when
198 they try to open one of your file formats in their file browser.&lt;/p&gt;
199
200 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
201 activities, please send Bitcoin donations to my address
202 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
203 </description>
204 </item>
205
206 <item>
207 <title>Opensnitch, the application level interactive firewall, heading into the Debian archive</title>
208 <link>https://people.skolelinux.org/pere/blog/Opensnitch__the_application_level_interactive_firewall__heading_into_the_Debian_archive.html</link>
209 <guid isPermaLink="true">https://people.skolelinux.org/pere/blog/Opensnitch__the_application_level_interactive_firewall__heading_into_the_Debian_archive.html</guid>
210 <pubDate>Sun, 22 Jan 2023 23:55:00 +0100</pubDate>
211 <description>&lt;p&gt;While reading a
212 &lt;a href=&quot;https://sneak.berlin/20230115/macos-scans-your-local-files-now/&quot;&gt;blog
213 post claiming MacOS X recently started scanning local files and
214 reporting information about them to Apple&lt;/a&gt;, even on a machine where
215 all such callback features had been disabled, I came across a
216 description of the Little Snitch application for MacOS X. It seemed
217 like a very nice tool to have in the tool box, and I decided to see if
218 something similar was available for Linux.&lt;/p&gt;
219
220 &lt;p&gt;It did not take long to find
221 &lt;a href=&quot;https://github.com/evilsocket/opensnitch&quot;&gt;the OpenSnitch
222 package&lt;/a&gt;, which has been in development since 2017, and now is in
223 version 1.5.0. It has had a
224 &lt;a href=&quot;https://bugs.debian.org/909567&quot;&gt;request for Debian
225 packaging&lt;/a&gt; since 2018, but no-one completed the job so far. Just
226 for fun, I decided to see if I could help, and I was very happy to
227 discover that
228 &lt;a href=&quot;https://github.com/evilsocket/opensnitch/issues/304&quot;&gt;upstream
229 want a Debian package too&lt;/a&gt;.&lt;/p&gt;
230
231 &lt;p&gt;After struggling a bit with getting the program to run, figuring
232 out building Go programs (and a little failed detour to look at eBPF
233 builds too - help needed), I am very happy to report that I am
234 sponsoring upstream to maintain the package in Debian, and it has
235 since this morning been waiting in NEW for the ftpmasters to have a
236 look. Perhaps it can get into the archive in time for the Bookworm
237 release?&lt;/p&gt;
238
239 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
240 activities, please send Bitcoin donations to my address
241 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
242 </description>
243 </item>
244
245 <item>
246 <title>LinuxCNC MQTT publisher component</title>
247 <link>https://people.skolelinux.org/pere/blog/LinuxCNC_MQTT_publisher_component.html</link>
248 <guid isPermaLink="true">https://people.skolelinux.org/pere/blog/LinuxCNC_MQTT_publisher_component.html</guid>
249 <pubDate>Sun, 8 Jan 2023 19:30:00 +0100</pubDate>
250 <description>&lt;p&gt;I watched &lt;a href=&quot;https://yewtu.be/watch?v=jmKUV3aNLjk&quot;&gt;a 2015
251 video from Andreas Schiffler&lt;/a&gt; the other day, where he set up
252 &lt;a href=&quot;https://linuxcnc.org/&quot;&gt;LinuxCNC&lt;/a&gt; to send status
253 information to the MQTT broker IBM Bluemix. As I also use MQTT for
254 graphing, it occured to me that a generic MQTT LinuxCNC component
255 would be useful and I set out to implement it. Today I got the first
256 draft limping along and submitted as
257 &lt;a href=&quot;https://github.com/LinuxCNC/linuxcnc/pull/2253&quot;&gt;a patch to the
258 LinuxCNC project&lt;/a&gt;.&lt;/p&gt;
259
260 &lt;p&gt;The simple part was setting up the MQTT publishing code in Python.
261 I already have set up other parts submitting data to my Mosquito MQTT
262 broker, so I could reuse that code. Writing a LinuxCNC component in
263 Python as new to me, but using existing examples in the code
264 repository and the extensive documentation, this was fairly straight
265 forward. The hardest part was creating a automated test for the
266 component to ensure it was working. Testing it in a simulated
267 LinuxCNC machine proved very useful, as I discovered features I needed
268 that I had not thought of yet, and adjusted the code quite a bit to
269 make it easier to test without a operational MQTT broker
270 available.&lt;/p&gt;
271
272 &lt;p&gt;The draft is ready and working, but I am unsure which LinuxCNC HAL
273 pins I should collect and publish by default (in other words, the
274 default set of information pieces published), and how to get the
275 machine name from the LinuxCNC INI file. The latter is a minor
276 detail, but I expect it would be useful in a setup with several
277 machines available. I am hoping for feedback from the experienced
278 LinuxCNC developers and users, to make the component even better
279 before it can go into the mainland LinuxCNC code base.&lt;/p&gt;
280
281 &lt;p&gt;Since I started on the MQTT component, I came across
282 &lt;a href=&quot;https://yewtu.be/watch?v=Bqa2grG0XtA&quot;&gt;another video from Kent
283 VanderVelden&lt;/a&gt; where he combine LinuxCNC with a set of screen glasses
284 controlled by a Raspberry Pi, and it occured to me that it would
285 be useful for such use cases if LinuxCNC also provided a REST API for
286 querying its status. I hope to start on such component once the MQTT
287 component is working well.&lt;/p&gt;
288
289 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
290 activities, please send Bitcoin donations to my address
291 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
292 </description>
293 </item>
294
295 <item>
296 <title>ONVIF IP camera management tool finally in Debian</title>
297 <link>https://people.skolelinux.org/pere/blog/ONVIF_IP_camera_management_tool_finally_in_Debian.html</link>
298 <guid isPermaLink="true">https://people.skolelinux.org/pere/blog/ONVIF_IP_camera_management_tool_finally_in_Debian.html</guid>
299 <pubDate>Sat, 24 Dec 2022 08:00:00 +0100</pubDate>
300 <description>&lt;p&gt;Merry Christmas to you all. Here is a small gift to all those with
301 IP cameras following the &lt;a href=&quot;https://www.onvif.org/&quot;&gt;ONVIF
302 specification&lt;/a&gt;. There is finally a nice command line and GUI tool
303 in Debian to manage ONVIF IP cameras. After working with upstream for
304 a few months and sponsoring the upload, I am very happy to report that
305 the &lt;a href=&quot;https://tracker.debian.org/libonvif&quot;&gt;libonvif package&lt;/a&gt;
306 entered Debian Sid last night.&lt;/p&gt;
307
308 &lt;p&gt;The package provide a C library to communicate with such cameras, a
309 command line tool to locate and update settings of (like password) the
310 cameras and a GUI tool to configure and control the units as well as
311 preview the video from the camera. Libonvif is available on Both
312 Linux and Windows and the GUI tool uses the Qt library. The main
313 competitors are non-free software, while libonvif is GNU GPL licensed.
314 I am very glad Debian users in the future can control their cameras
315 using a free software system provided by Debian. But the ONVIF world
316 is full of slightly broken firmware, where the cameras pretend to
317 follow the ONVIF specification but fail to set some configuration
318 values or refuse to provide video to more than one recipient at the
319 time, and the onvif project is quite young and might take a while
320 before it completely work with your camera. Upstream seem eager to
321 improve the library, so handling any broken camera might be just &lt;a
322 href=&quot;https://github.com/sr99622/libonvif/&quot;&gt;a bug report away&lt;/a&gt;.&lt;/p&gt;
323
324 &lt;p&gt;The package just cleared NEW, and need a new source only upload
325 before it can enter testing. This will happen in the next few
326 days.&lt;/p&gt;
327
328 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
329 activities, please send Bitcoin donations to my address
330 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
331 </description>
332 </item>
333
334 <item>
335 <title>Managing and using ONVIF IP cameras with Linux</title>
336 <link>https://people.skolelinux.org/pere/blog/Managing_and_using_ONVIF_IP_cameras_with_Linux.html</link>
337 <guid isPermaLink="true">https://people.skolelinux.org/pere/blog/Managing_and_using_ONVIF_IP_cameras_with_Linux.html</guid>
338 <pubDate>Wed, 19 Oct 2022 12:30:00 +0200</pubDate>
339 <description>&lt;p&gt;Recently I have been looking at how to control and collect data
340 from a handful IP cameras using Linux. I both wanted to change their
341 settings and to make their imagery available via a free software
342 service under my control. Here is a summary of the tools I found.&lt;/p&gt;
343
344 &lt;p&gt;First I had to identify the cameras and their protocols. As far as
345 I could tell, they were using some SOAP looking protocol and their
346 internal web server seem to only work with Microsoft Internet Explorer
347 with some proprietary binary plugin, which in these days of course is
348 a security disaster and also made it impossible for me to use the
349 camera web interface. Luckily I discovered that the SOAP looking
350 protocol is actually following &lt;a href=&quot;https://www.onvif.org/&quot;&gt;the
351 ONVIF specification&lt;/a&gt;, which seem to be supported by a lot of IP
352 cameras these days.&lt;/p&gt;
353
354 &lt;p&gt;Once the protocol was identified, I was able to find what appear to
355 be the most popular way to configure ONVIF cameras, the free software
356 Windows tool named
357 &lt;a href=&quot;https://sourceforge.net/projects/onvifdm/&quot;&gt;ONVIF Device
358 Manager&lt;/a&gt;. Lacking any other options at the time, I tried
359 unsuccessfully to get it running using Wine, but was missing a dotnet
360 40 library and I found no way around it to run it on Linux.&lt;/p&gt;
361
362 &lt;p&gt;The next tool I found to configure the cameras were a non-free Linux Qt
363 client &lt;a href=&quot;https://www.lingodigit.com/onvif_nvcdemo.html&quot;&gt;ONVIF
364 Device Tool&lt;/a&gt;. I did not like its terms of use, so did not spend
365 much time on it.&lt;/p&gt;
366
367 &lt;p&gt;To collect the video and make it available in a web interface, I
368 found the Zoneminder tool in Debian. A recent version was able to
369 automatically detect and configure ONVIF devices, so I could use it to
370 set up motion detection in and collection of the camera output. I had
371 initial problems getting the ONVIF autodetection to work, as both
372 Firefox and Chromium &lt;a href=&quot;https://bugs.debian.org/1001188&quot;&gt;refused
373 the inter-tab communication&lt;/a&gt; being used by the Zoneminder web
374 pages, but managed to get konqueror to work. Apparently the &quot;Enhanced
375 Tracking Protection&quot; in Firefox cause the problem. I ended up
376 upgrading to the Bookworm edition of Zoneminder in the process to try
377 to fix the issue, and believe the problem might be solved now.&lt;/p&gt;
378
379 &lt;p&gt;In the process I came across the nice Linux GUI tool
380 &lt;a href=&quot;https://gitlab.com/caspermeijn/onvifviewer/&quot;&gt;ONVIF Viewer&lt;/a&gt;
381 allowing me to preview the camera output and validate the login
382 passwords required. Sadly its author has grown tired of maintaining
383 the software, so it might not see any future updates. Which is sad,
384 as the viewer is sightly unstable and the picture tend to lock up.
385 Note, this lockup might be due to limitations in the cameras and not
386 the viewer implementation. I suspect the camera is only able to
387 provide pictures to one client at the time, and the Zoneminder feed
388 might interfere with the GUI viewer. I have
389 &lt;a href=&quot;https://bugs.debian.org/1000820&quot;&gt;asked for the tool to be
390 included in Debian&lt;/a&gt;.&lt;/p&gt;
391
392 &lt;p&gt;Finally, I found what appear to be very nice Linux free software
393 replacement for the Windows tool, named
394 &lt;a href=&quot;https://github.com/sr99622/libonvif/&quot;&gt;libonvif&lt;/a&gt;. It
395 provide a C library to talk to ONVIF devices as well as a command line
396 and GUI tool using the library. Using the GUI tool I was able to change
397 the admin passwords and update other settings of the cameras. I have
398 &lt;a href=&quot;https://bugs.debian.org/1021980&quot;&gt;asked for the package to be
399 included in Debian&lt;/a&gt;.&lt;/p&gt;
400
401 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
402 activities, please send Bitcoin donations to my address
403 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
404
405 &lt;p&gt;&lt;strong&gt;Update 2022-10-20&lt;/strong&gt;: Since my initial publication of
406 this text, I got several suggestions for more free software Linux
407 tools. There is &lt;a href=&quot;https://github.com/quatanium/python-onvif&quot;&gt;a
408 ONVIF python library&lt;/a&gt; (already
409 &lt;a href=&quot;https://bugs.debian.org/824240&quot;&gt;requested into Debian&lt;/a&gt;) and
410 &lt;a href=&quot;https://github.com/FalkTannhaeuser/python-onvif-zeep&quot;&gt;a python 3
411 fork&lt;/a&gt; using a different SOAP dependency. There is also
412 &lt;a href=&quot;https://www.home-assistant.io/integrations/onvif/&quot;&gt;support for
413 ONVIF in Home Assistant&lt;/a&gt;, and there is an alternative to Zoneminder
414 called &lt;a href=&quot;https://www.shinobi.video/&quot;&gt;Shinobi&lt;/a&gt;. The latter
415 two are not included in Debian either. I have not tested any of these
416 so far.&lt;/p&gt;
417 </description>
418 </item>
419
420 <item>
421 <title>Time to translate the Bullseye edition of the Debian Administrator&#39;s Handbook</title>
422 <link>https://people.skolelinux.org/pere/blog/Time_to_translate_the_Bullseye_edition_of_the_Debian_Administrator_s_Handbook.html</link>
423 <guid isPermaLink="true">https://people.skolelinux.org/pere/blog/Time_to_translate_the_Bullseye_edition_of_the_Debian_Administrator_s_Handbook.html</guid>
424 <pubDate>Mon, 12 Sep 2022 15:45:00 +0200</pubDate>
425 <description>&lt;p align=&quot;center&quot;&gt;&lt;img align=&quot;center&quot; src=&quot;http://people.skolelinux.org/pere/blog/images/2020-10-20-debian-handbook-nb-testprint.jpeg&quot; width=&quot;60%&quot;/&gt;&lt;/p&gt;
426
427 &lt;p&gt;(The picture is of the previous edition.)&lt;/p&gt;
428
429 &lt;p&gt;Almost two years after the previous Norwegian Bokmål translation of
430 the &quot;&lt;a href=&quot;https://debian-handbook.info/&quot;&gt;The Debian Administrator&#39;s
431 Handbook&lt;/a&gt;&quot; was published, a new edition is finally being prepared. The
432 english text is updated, and it is time to start working on the
433 translations. Around 37 percent of the strings have been updated, one
434 way or another, and the translations starting from a complete Debian Buster
435 edition now need to bring their translation up from 63% to 100%. The
436 complete book is licensed using a Creative Commons license, and has
437 been published in several languages over the years. The translations
438 are done by volunteers to bring Linux in their native tongue. The
439 last time I checked, it complete text was available in English,
440 Norwegian Bokmål, German, Indonesian, Brazil Portuguese and Spanish.
441 In addition, work has been started for Arabic (Morocco), Catalan,
442 Chinese (Simplified), Chinese (Traditional), Croatian, Czech, Danish,
443 Dutch, French, Greek, Italian, Japanese, Korean, Persian, Polish,
444 Romanian, Russian, Swedish, Turkish and Vietnamese.&lt;/p&gt;
445
446 &lt;p&gt;The translation is conducted on
447 &lt;a href=&quot;https://hosted.weblate.org/projects/debian-handbook/&quot;&gt;the
448 hosted weblate project page&lt;/a&gt;. Prospective translators are
449 recommeded to subscribe to
450 &lt;a href=&quot;http://lists.alioth.debian.org/mailman/listinfo/debian-handbook-translators&quot;&gt;the
451 translators mailing list&lt;/a&gt; and should also check out
452 &lt;a href=&quot;https://debian-handbook.info/contribute/&quot;&gt;the instructions for
453 contributors&lt;/a&gt;.&lt;/p&gt;
454
455 &lt;p&gt;I am one of the Norwegian Bokmål translators of this book, and we
456 have just started. Your contribution is most welcome.&lt;/p&gt;
457
458 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
459 activities, please send Bitcoin donations to my address
460 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
461 </description>
462 </item>
463
464 <item>
465 <title>Automatic LinuxCNC servo PID tuning?</title>
466 <link>https://people.skolelinux.org/pere/blog/Automatic_LinuxCNC_servo_PID_tuning_.html</link>
467 <guid isPermaLink="true">https://people.skolelinux.org/pere/blog/Automatic_LinuxCNC_servo_PID_tuning_.html</guid>
468 <pubDate>Sat, 16 Jul 2022 22:30:00 +0200</pubDate>
469 <description>&lt;p&gt;While working on a CNC with servo motors controlled by the
470 &lt;a href=&quot;https://en.wikipedia.org/wiki/LinuxCNC&quot;&gt;LinuxCNC&lt;/a&gt;
471 &lt;a href=&quot;https://en.wikipedia.org/wiki/PID_controller&quot;&gt;PID
472 controller&lt;/a&gt;, I recently had to learn how to tune the collection of values
473 that control such mathematical machinery that a PID controller is. It
474 proved to be a lot harder than I hoped, and I still have not succeeded
475 in getting the Z PID controller to successfully defy gravity, nor X
476 and Y to move accurately and reliably. But while climbing up this
477 rather steep learning curve, I discovered that some motor control
478 systems are able to tune their PID controllers. I got the impression
479 from the documentation that LinuxCNC were not. This proved to be not
480 true.&lt;/p&gt;
481
482 &lt;p&gt;The LinuxCNC
483 &lt;a href=&quot;http://linuxcnc.org/docs/html/man/man9/pid.9.html&quot;&gt;pid
484 component&lt;/a&gt; is the recommended PID controller to use. It uses eight
485 constants &lt;tt&gt;Pgain&lt;/tt&gt;, &lt;tt&gt;Igain&lt;/tt&gt;, &lt;tt&gt;Dgain&lt;/tt&gt;,
486 &lt;tt&gt;bias&lt;/tt&gt;, &lt;tt&gt;FF0&lt;/tt&gt;, &lt;tt&gt;FF1&lt;/tt&gt;, &lt;tt&gt;FF2&lt;/tt&gt; and
487 &lt;tt&gt;FF3&lt;/tt&gt; to calculate the output value based on current and wanted
488 state, and all of these need to have a sensible value for the
489 controller to behave properly. Note, there are even more values
490 involved, theser are just the most important ones. In my case I need
491 the X, Y and Z axes to follow the requested path with little error.
492 This has proved quite a challenge for someone who have never tuned a
493 PID controller before, but there is at least some help to be found.
494
495 &lt;p&gt;I discovered that included in LinuxCNC was this old PID component
496 at_pid claiming to have auto tuning capabilities. Sadly it had been
497 neglected since 2011, and could not be used as a plug in replacement
498 for the default pid component. One would have to rewriting the
499 LinuxCNC HAL setup to test at_pid. This was rather sad, when I wanted
500 to quickly test auto tuning to see if it did a better job than me at
501 figuring out good P, I and D values to use.&lt;/p&gt;
502
503 &lt;p&gt;I decided to have a look if the situation could be improved. This
504 involved trying to understand the code and history of the pid and
505 at_pid components. Apparently they had a common ancestor, as code
506 structure, comments and variable names were quite close to each other.
507 Sadly this was not reflected in the git history, making it hard to
508 figure out what really happened. My guess is that the author of
509 &lt;a href=&quot;https://github.com/LinuxCNC/linuxcnc/blob/master/src/hal/components/at_pid.c&quot;&gt;at_pid.c&lt;/a&gt;
510 took a version of
511 &lt;a href=&quot;https://github.com/LinuxCNC/linuxcnc/blob/master/src/hal/components/pid.c&quot;&gt;pid.c&lt;/a&gt;,
512 rewrote it to follow the structure he wished pid.c to have, then added
513 support for auto tuning and finally got it included into the LinuxCNC
514 repository. The restructuring and lack of early history made it
515 harder to figure out which part of the code were relevant to the auto
516 tuning, and which part of the code needed to be updated to work the
517 same way as the current pid.c implementation. I started by trying to
518 isolate relevant changes in pid.c, and applying them to at_pid.c. My
519 aim was to make sure the at_pid component could replace the pid
520 component with a simple change in the HAL setup loadrt line, without
521 having to &quot;rewire&quot; the rest of the HAL configuration. After a few
522 hours following this approach, I had learned quite a lot about the
523 code structure of both components, while concluding I was heading down
524 the wrong rabbit hole, and should get back to the surface and find a
525 different path.&lt;/p&gt;
526
527 &lt;p&gt;For the second attempt, I decided to throw away all the PID control
528 related part of the original at_pid.c, and instead isolate and lift
529 the auto tuning part of the code and inject it into a copy of pid.c.
530 This ensured compatibility with the current pid component, while
531 adding auto tuning as a run time option. To make it easier to identify
532 the relevant parts in the future, I wrapped all the auto tuning code
533 with &#39;#ifdef AUTO_TUNER&#39;. The end result behave just like the current
534 pid component by default, as that part of the code is identical. The
535 &lt;a href=&quot;https://github.com/LinuxCNC/linuxcnc/pull/1820&quot;&gt;end result
536 entered the LinuxCNC master branch&lt;/a&gt; a few days ago.&lt;/p&gt;
537
538 &lt;p&gt;To enable auto tuning, one need to set a few HAL pins in the PID
539 component. The most important ones are &lt;tt&gt;tune-effort&lt;/tt&gt;,
540 &lt;tt&gt;tune-mode&lt;/tt&gt; and &lt;tt&gt;tune-start&lt;/tt&gt;. But lets take a step
541 back, and see what the auto tuning code will do. I do not know the
542 mathematical foundation of the at_pid algorithm, but from observation
543 I can tell that the algorithm will, when enabled, produce a square
544 wave pattern centered around the &lt;tt&gt;bias&lt;/tt&gt; value on the output pin
545 of the PID controller. This can be seen using the HAL Scope provided
546 by LinuxCNC. In my case, this is translated into voltage (+-10V) sent
547 to the motor controller, which in turn is translated into motor speed.
548 So at_pid will ask the motor to move the axis back and forth. The
549 number of cycles in the pattern is controlled by the
550 &lt;tt&gt;tune-cycles&lt;/tt&gt; pin, and the extremes of the wave pattern is
551 controlled by the &lt;tt&gt;tune-effort&lt;/tt&gt; pin. Of course, trying to
552 change the direction of a physical object instantly (as in going
553 directly from a positive voltage to the equivalent negative voltage)
554 do not change velocity instantly, and it take some time for the object
555 to slow down and move in the opposite direction. This result in a
556 more smooth movement wave form, as the axis in question were vibrating
557 back and forth. When the axis reached the target speed in the
558 opposing direction, the auto tuner change direction again. After
559 several of these changes, the average time delay between the &#39;peaks&#39;
560 and &#39;valleys&#39; of this movement graph is then used to calculate
561 proposed values for Pgain, Igain and Dgain, and insert them into the
562 HAL model to use by the pid controller. The auto tuned settings are
563 not great, but htye work a lot better than the values I had been able
564 to cook up on my own, at least for the horizontal X and Y axis. But I
565 had to use very small &lt;tt&gt;tune-effort&lt;tt&gt; values, as my motor
566 controllers error out if the voltage change too quickly. I&#39;ve been
567 less lucky with the Z axis, which is moving a heavy object up and
568 down, and seem to confuse the algorithm. The Z axis movement became a
569 lot better when I introduced a &lt;tt&gt;bias&lt;/tt&gt; value to counter the
570 gravitational drag, but I will have to work a lot more on the Z axis
571 PID values.&lt;/p&gt;
572
573 &lt;p&gt;Armed with this knowledge, it is time to look at how to do the
574 tuning. Lets say the HAL configuration in question load the PID
575 component for X, Y and Z like this:&lt;/p&gt;
576
577 &lt;blockquote&gt;&lt;pre&gt;
578 loadrt pid names=pid.x,pid.y,pid.z
579 &lt;/pre&gt;&lt;/blockquote&gt;
580
581 &lt;p&gt;Armed with the new and improved at_pid component, the new line will
582 look like this:&lt;/p&gt;
583
584 &lt;blockquote&gt;&lt;pre&gt;
585 loadrt at_pid names=pid.x,pid.y,pid.z
586 &lt;/pre&gt;&lt;/blockquote&gt;
587
588 &lt;p&gt;The rest of the HAL setup can stay the same. This work because the
589 components are referenced by name. If the component had used count=3
590 instead, all use of pid.# had to be changed to at_pid.#.&lt;/p&gt;
591
592 &lt;p&gt;To start tuning the X axis, move the axis to the middle of its
593 range, to make sure it do not hit anything when it start moving back
594 and forth. Next, set the &lt;tt&gt;tune-effort&lt;/tt&gt; to a low number in the
595 output range. I used 0.1 as my initial value. Next, assign 1 to the
596 &lt;tt&gt;tune-mode&lt;/tt&gt; value. Note, this will disable the pid controlling
597 part and feed 0 to the output pin, which in my case initially caused a
598 lot of drift. In my case it proved to be a good idea with X and Y to
599 tune the motor driver to make sure 0 voltage stopped the motor
600 rotation. On the other hand, for the Z axis this proved to be a bad
601 idea, so it will depend on your setup. It might help to set the
602 &lt;tt&gt;bias&lt;/tt&gt; value to a output value that reduce or eliminate the
603 axis drift. Finally, after setting &lt;tt&gt;tune-mode&lt;/tt&gt;, set
604 &lt;tt&gt;tune-start&lt;/tt&gt; to 1 to activate the auto tuning. If all go well,
605 your axis will vibrate for a few seconds and when it is done, new
606 values for Pgain, Igain and Dgain will be active. To test them,
607 change &lt;tt&gt;tune-mode&lt;/tt&gt; back to 0. Note that this might cause the
608 machine to suddenly jerk as it bring the axis back to its commanded
609 position, which it might have drifted away from during tuning. To
610 summarize with some halcmd lines:&lt;/p&gt;
611
612 &lt;blockquote&gt;&lt;pre&gt;
613 setp pid.x.tune-effort 0.1
614 setp pid.x.tune-mode 1
615 setp pid.x.tune-start 1
616 # wait for the tuning to complete
617 setp pid.x.tune-mode 0
618 &lt;/pre&gt;&lt;/blockquote&gt;
619
620 &lt;p&gt;After doing this task quite a few times while trying to figure out
621 how to properly tune the PID controllers on the machine in, I decided
622 to figure out if this process could be automated, and wrote a script
623 to do the entire tuning process from power on. The end result will
624 ensure the machine is powered on and ready to run, home all axis if it
625 is not already done, check that the extra tuning pins are available,
626 move the axis to its mid point, run the auto tuning and re-enable the
627 pid controller when it is done. It can be run several times. Check
628 out the
629 &lt;a href=&quot;https://github.com/SebKuzminsky/MazakVQC1540/blob/bon-dev/scripts/run-auto-pid-tuner&quot;&gt;run-auto-pid-tuner&lt;/a&gt;
630 script on github if you want to learn how it is done.&lt;/p&gt;
631
632 &lt;p&gt;My hope is that this little adventure can inspire someone who know
633 more about motor PID controller tuning can implement even better
634 algorithms for automatic PID tuning in LinuxCNC, making life easier
635 for both me and all the others that want to use LinuxCNC but lack the
636 in depth knowledge needed to tune PID controllers well.&lt;/p&gt;
637
638 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
639 activities, please send Bitcoin donations to my address
640 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
641 </description>
642 </item>
643
644 <item>
645 <title>My free software activity of late (2022)</title>
646 <link>https://people.skolelinux.org/pere/blog/My_free_software_activity_of_late__2022_.html</link>
647 <guid isPermaLink="true">https://people.skolelinux.org/pere/blog/My_free_software_activity_of_late__2022_.html</guid>
648 <pubDate>Mon, 20 Jun 2022 14:30:00 +0200</pubDate>
649 <description>&lt;p&gt;I guess it is time to bring some light on the various free software
650 and open culture activities and projects I have worked on or been
651 involved in the last year and a half.&lt;/p&gt;
652
653 &lt;p&gt;First, lets mention the book
654 &lt;a href=&quot;http://www.hungry.com/~pere/publisher/&quot;&gt;releases I managed to
655 publish&lt;/a&gt;. The Cory Doctorow book &quot;Hvordan knuse
656 overvåkningskapitalismen&quot; argue that it is not the magic machine
657 learning of the big technology companies that causes the surveillance
658 capitalism to thrive, it is the lack of trust busting to enforce
659 existing anti-monopoly laws. I also published a family of
660 dictionaries for machinists, one sorted on the English words, one
661 sorted on the Norwegian and the last sorted on the North Sámi words.
662 A bit on the back burner but not forgotten is the Debian
663 Administrators Handbook, where a new edition is being worked on. I
664 have not spent as much time as I want to help bring it to completion,
665 but hope I will get more spare time to look at it before the end of
666 the year.&lt;/p&gt;
667
668 &lt;p&gt;With my Debian had I have spent time on several projects, both
669 updating existing packages, helping to bring in new packages and
670 working with upstream projects to try to get them ready to go into
671 Debian. The list is rather long, and I will only mention my own
672 isenkram, openmotor, vlc bittorrent plugin, xprintidle, norwegian
673 letter style for latex, bs1770gain, and recordmydesktop. In addition
674 to these I have sponsored several packages into Debian, like audmes.&lt;/p&gt;
675
676 &lt;p&gt;The last year I have looked at several infrastructure projects for
677 collecting meter data and video surveillance recordings. This include
678 several ONVIF related tools like onvifviewer and zoneminder as well as
679 rtl-433, wmbusmeters and rtl-wmbus.&lt;/p&gt;
680
681 &lt;p&gt;In parallel with this I have looked at fabrication related free
682 software solutions like pycam and LinuxCNC. The latter recently
683 gained improved translation support using po4a and weblate, which was
684 a harder nut to crack that I had anticipated when I started.&lt;/p&gt;
685
686 &lt;p&gt;Several hours have been spent translating free software to
687 Norwegian Bokmål on the Weblate hosted service. Do not have a
688 complete list, but you will find my contributions in at least gnucash,
689 minetest and po4a.&lt;/p&gt;
690
691 &lt;p&gt;I also spent quite some time on the Norwegian archiving specification
692 Noark 5, and its companion project Nikita implementing the API
693 specification for Noark 5.&lt;/p&gt;
694
695 &lt;p&gt;Recently I have been looking into free software tools to do company
696 accounting here in Norway., which present an interesting mix between
697 law, rules, regulations, format specifications and API interfaces.&lt;/p&gt;
698
699 &lt;p&gt;I guess I should also mention the Norwegian community driven
700 government interfacing projects Mimes Brønn and Fiksgatami, which have
701 ended up in a kind of limbo while the future of the projects is being
702 worked out.&lt;/p&gt;
703
704 &lt;p&gt;These are just a few of the projects I have been involved it, and
705 would like to give more visibility. I&#39;ll stop here to avoid delaying
706 this post.&lt;/p&gt;
707
708 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
709 activities, please send Bitcoin donations to my address
710 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
711 </description>
712 </item>
713
714 </channel>
715 </rss>