1 <?xml version=
"1.0" encoding=
"utf-8"?>
2 <rss version='
2.0' xmlns:lj='http://www.livejournal.org/rss/lj/
1.0/'
>
4 <title>Petter Reinholdtsen - Entries tagged lego
</title>
5 <description>Entries tagged lego
</description>
6 <link>http://www.hungry.com/~pere/blog/
</link>
10 <title>Debian still an excellent choice for Lego builders
</title>
11 <link>http://www.hungry.com/~pere/blog/Debian_still_an_excellent_choice_for_Lego_builders.html
</link>
12 <guid isPermaLink=
"true">http://www.hungry.com/~pere/blog/Debian_still_an_excellent_choice_for_Lego_builders.html
</guid>
13 <pubDate>Sun,
24 Oct
2021 07:
10:
00 +
0200</pubDate>
14 <description><p
>The Debian Lego team saw a lot of activity the last few weeks. All
15 the packages under the team umbrella has been updated to fix
16 packaging, lintian issues and BTS reports. In addition, a new and
17 inspiring team member appeared on both the
18 <a href=
"https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-lego-team
">debian-lego-team
19 Team mailing list
</a
> and
20 <a href=
"irc://irc.debian.org/%
23debian-lego
">IRC channel
21 #debian-lego
</a
>. If you are interested in Lego CAD design and LEGO
22 Mindstorms programming, check out the
23 <a href=
"http://wiki.debian.org/LegoDesigners
">team wiki page
</a
> to
24 see what Debian can offer the Lego enthusiast.
</p
>
26 <p
>Patches has been sent upstream, causing new upstream releases, one
27 even the first one in more than ten years, and old upstreams was
28 released with new ones. There are still a lot of work left, and the
29 team welcome more members to help us make sure Debian is the Linux
30 distribution of choice for Lego builders. If you want to contribute,
31 join us in the IRC channel and become part of
32 <a href=
"https://salsa.debian.org/debian-lego-team/
">the team on
33 Salsa
</a
>.
</p
>
35 <p
>As usual, if you use Bitcoin and want to show your support of my
36 activities, please send Bitcoin donations to my address
37 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
42 <title>My own self balancing Lego Segway
</title>
43 <link>http://www.hungry.com/~pere/blog/My_own_self_balancing_Lego_Segway.html
</link>
44 <guid isPermaLink=
"true">http://www.hungry.com/~pere/blog/My_own_self_balancing_Lego_Segway.html
</guid>
45 <pubDate>Fri,
4 Nov
2016 10:
15:
00 +
0100</pubDate>
46 <description><p
>A while back I received a Gyro sensor for the NXT
47 <a href=
"mindstorms.lego.com
">Mindstorms
</a
> controller as a birthday
48 present. It had been on my wishlist for a while, because I wanted to
49 build a Segway like balancing lego robot. I had already built
50 <a href=
"http://www.nxtprograms.com/NXT2/segway/
">a simple balancing
51 robot
</a
> with the kids, using the light/color sensor included in the
52 NXT kit as the balance sensor, but it was not working very well. It
53 could balance for a while, but was very sensitive to the light
54 condition in the room and the reflective properties of the surface and
55 would fall over after a short while. I wanted something more robust,
57 <a href=
"https://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action
&key=NGY1044
">the
58 gyro sensor from HiTechnic
</a
> I believed would solve it on my
59 wishlist for some years before it suddenly showed up as a gift from my
60 loved ones. :)
</p
>
62 <p
>Unfortunately I have not had time to sit down and play with it
63 since then. But that changed some days ago, when I was searching for
64 lego segway information and came across a recipe from HiTechnic for
66 <a href=
"http://www.hitechnic.com/blog/gyro-sensor/htway/
">the
67 HTWay
</a
>, a segway like balancing robot. Build instructions and
68 <a href=
"https://www.hitechnic.com/upload/
786-HTWayC.nxc
">source
69 code
</a
> was included, so it was just a question of putting it all
70 together. And thanks to the great work of many Debian developers, the
71 compiler needed to build the source for the NXT is already included in
72 Debian, so I was read to go in less than an hour. The resulting robot
73 do not look very impressive in its simplicity:
</p
>
75 <p align=
"center
"><img width=
"70%
" src=
"https://people.skolelinux.org/pere/blog/images/
2016-
11-
04-lego-htway-robot.jpeg
"></p
>
77 <p
>Because I lack the infrared sensor used to control the robot in the
78 design from HiTechnic, I had to comment out the last task
79 (taskControl). I simply placed /* and */ around it get the program
80 working without that sensor present. Now it balances just fine until
81 the battery status run low:
</p
>
83 <p align=
"center
"><video width=
"70%
" controls=
"true
">
84 <source src=
"https://people.skolelinux.org/pere/blog/images/
2016-
11-
04-lego-htway-balancing.ogv
" type=
"video/ogg
">
85 </video
></p
>
87 <p
>Now we would like to teach it how to follow a line and take remote
88 control instructions using the included Bluetooth receiver in the NXT.
</p
>
90 <p
>If you, like me, love LEGO and want to make sure we find the tools
91 they need to work with LEGO in Debian and all our derivative
92 distributions like Ubuntu, check out
93 <a href=
"http://wiki.debian.org/LegoDesigners
">the LEGO designers
94 project page
</a
> and join the Debian LEGO team. Personally I own a
95 RCX and NXT controller (no EV3), and would like to make sure the
96 Debian tools needed to program the systems I own work as they
102 <title>Isenkram, Appstream and udev make life as a LEGO builder easier
</title>
103 <link>http://www.hungry.com/~pere/blog/Isenkram__Appstream_and_udev_make_life_as_a_LEGO_builder_easier.html
</link>
104 <guid isPermaLink=
"true">http://www.hungry.com/~pere/blog/Isenkram__Appstream_and_udev_make_life_as_a_LEGO_builder_easier.html
</guid>
105 <pubDate>Fri,
7 Oct
2016 09:
50:
00 +
0200</pubDate>
106 <description><p
><a href=
"http://packages.qa.debian.org/isenkram
">The Isenkram
107 system
</a
> provide a practical and easy way to figure out which
108 packages support the hardware in a given machine. The command line
109 tool
<tt
>isenkram-lookup
</tt
> and the tasksel options provide a
110 convenient way to list and install packages relevant for the current
111 hardware during system installation, both user space packages and
112 firmware packages. The GUI background daemon on the other hand provide
113 a pop-up proposing to install packages when a new dongle is inserted
114 while using the computer. For example, if you plug in a smart card
115 reader, the system will ask if you want to install
<tt
>pcscd
</tt
> if
116 that package isn
't already installed, and if you plug in a USB video
117 camera the system will ask if you want to install
<tt
>cheese
</tt
> if
118 cheese is currently missing. This already work just fine.
</p
>
120 <p
>But Isenkram depend on a database mapping from hardware IDs to
121 package names. When I started no such database existed in Debian, so
122 I made my own data set and included it with the isenkram package and
123 made isenkram fetch the latest version of this database from git using
124 http. This way the isenkram users would get updated package proposals
125 as soon as I learned more about hardware related packages.
</p
>
127 <p
>The hardware is identified using modalias strings. The modalias
128 design is from the Linux kernel where most hardware descriptors are
129 made available as a strings that can be matched using filename style
130 globbing. It handle USB, PCI, DMI and a lot of other hardware related
131 identifiers.
</p
>
133 <p
>The downside to the Isenkram specific database is that there is no
134 information about relevant distribution / Debian version, making
135 isenkram propose obsolete packages too. But along came AppStream, a
136 cross distribution mechanism to store and collect metadata about
137 software packages. When I heard about the proposal, I contacted the
138 people involved and suggested to add a hardware matching rule using
139 modalias strings in the specification, to be able to use AppStream for
140 mapping hardware to packages. This idea was accepted and AppStream is
141 now a great way for a package to announce the hardware it support in a
142 distribution neutral way. I wrote
143 <a href=
"https://people.skolelinux.org/pere/blog/Using_appstream_with_isenkram_to_install_hardware_related_packages_in_Debian.html
">a
144 recipe on how to add such meta-information
</a
> in a blog post last
145 December. If you have a hardware related package in Debian, please
146 announce the relevant hardware IDs using AppStream.
</p
>
148 <p
>In Debian, almost all packages that can talk to a LEGO Mindestorms
149 RCX or NXT unit, announce this support using AppStream. The effect is
150 that when you insert such LEGO robot controller into your Debian
151 machine, Isenkram will propose to install the packages needed to get
152 it working. The intention is that this should allow the local user to
153 start programming his robot controller right away without having to
154 guess what packages to use or which permissions to fix.
</p
>
156 <p
>But when I sat down with my son the other day to program our NXT
157 unit using his Debian Stretch computer, I discovered something
158 annoying. The local console user (ie my son) did not get access to
159 the USB device for programming the unit. This used to work, but no
160 longer in Jessie and Stretch. After some investigation and asking
161 around on #debian-devel, I discovered that this was because udev had
162 changed the mechanism used to grant access to local devices. The
163 ConsoleKit mechanism from
<tt
>/lib/udev/rules.d/
70-udev-acl.rules
</tt
>
164 no longer applied, because LDAP users no longer was added to the
165 plugdev group during login. Michael Biebl told me that this method
166 was obsolete and the new method used ACLs instead. This was good
167 news, as the plugdev mechanism is a mess when using a remote user
168 directory like LDAP. Using ACLs would make sure a user lost device
169 access when she logged out, even if the user left behind a background
170 process which would retain the plugdev membership with the ConsoleKit
171 setup. Armed with this knowledge I moved on to fix the access problem
172 for the LEGO Mindstorms related packages.
</p
>
174 <p
>The new system uses a udev tag,
'uaccess
'. It can either be
175 applied directly for a device, or is applied in
176 /lib/udev/rules.d/
70-uaccess.rules for classes of devices. As the
177 LEGO Mindstorms udev rules did not have a class, I decided to add the
178 tag directly in the udev rules files included in the packages. Here
179 is one example. For the nqc C compiler for the RCX, the
180 <tt
>/lib/udev/rules.d/
60-nqc.rules
</tt
> file now look like this:
183 SUBSYSTEM==
"usb
", ACTION==
"add
", ATTR{idVendor}==
"0694", ATTR{idProduct}==
"0001", \
184 SYMLINK+=
"rcx-%k
", TAG+=
"uaccess
"
185 </pre
></p
>
187 <p
>The key part is the
'TAG+=
"uaccess
"' at the end. I suspect all
188 packages using plugdev in their /lib/udev/rules.d/ files should be
189 changed to use this tag (either directly or indirectly via
190 <tt
>70-uaccess.rules
</tt
>). Perhaps a lintian check should be created
191 to detect this?
</p
>
193 <p
>I
've been unable to find good documentation on the uaccess feature.
194 It is unclear to me if the uaccess tag is an internal implementation
195 detail like the udev-acl tag used by
196 <tt
>/lib/udev/rules.d/
70-udev-acl.rules
</tt
>. If it is, I guess the
197 indirect method is the preferred way. Michael
198 <a href=
"https://github.com/systemd/systemd/issues/
4288">asked for more
199 documentation from the systemd project
</a
> and I hope it will make
200 this clearer. For now I use the generic classes when they exist and
201 is already handled by
<tt
>70-uaccess.rules
</tt
>, and add the tag
202 directly if no such class exist.
</p
>
204 <p
>To learn more about the isenkram system, please check out
205 <a href=
"https://people.skolelinux.org/pere/blog/tags/isenkram/
">my
206 blog posts tagged isenkram
</a
>.
</p
>
208 <p
>To help out making life for LEGO constructors in Debian easier,
209 please join us on our IRC channel
210 <a href=
"irc://irc.debian.org/%
23debian-lego
">#debian-lego
</a
> and join
211 the
<a href=
"https://alioth.debian.org/projects/debian-lego/
">Debian
212 LEGO team
</a
> in the Alioth project we created yesterday. A mailing
213 list is not yet created, but we are working on it. :)
</p
>
215 <p
>As usual, if you use Bitcoin and want to show your support of my
216 activities, please send Bitcoin donations to my address
217 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
222 <title>Debian, the Linux distribution of choice for LEGO designers?
</title>
223 <link>http://www.hungry.com/~pere/blog/Debian__the_Linux_distribution_of_choice_for_LEGO_designers_.html
</link>
224 <guid isPermaLink=
"true">http://www.hungry.com/~pere/blog/Debian__the_Linux_distribution_of_choice_for_LEGO_designers_.html
</guid>
225 <pubDate>Sat,
11 May
2013 20:
30:
00 +
0200</pubDate>
226 <description><P
>In January,
227 <a href=
"https://people.skolelinux.org/pere/blog/New_IRC_channel_for_LEGO_designers_using_Debian.html
">I
228 announced a
</a
> new
<a href=
"irc://irc.debian.org/%
23debian-lego
">IRC
229 channel #debian-lego
</a
>, for those of us in the Debian and Linux
230 community interested in
<a href=
"http://www.lego.com/
">LEGO
</a
>, the
231 marvellous construction system from Denmark. We also created
232 <a href=
"http://wiki.debian.org/LegoDesigners
">a wiki page
</a
> to have
233 a place to take notes and write down our plans and hopes. And several
234 people showed up to help. I was very happy to see the effect of my
235 call. Since the small start, we have a debtags tag
236 <a href=
"http://debtags.debian.net/search/bytag?wl=hardware::hobby:lego
">hardware::hobby:lego
</a
>
237 tag for LEGO related packages, and now count
10 packages related to
238 LEGO and
<a href=
"http://mindstorms.lego.com/
">Mindstorms
</a
>:
</p
>
240 <p
><table
>
241 <tr
><td
><a href=
"http://packages.qa.debian.org/brickos
">brickos
</a
></td
><td
>alternative OS for LEGO Mindstorms RCX. Supports development in C/C++
</td
></tr
>
242 <tr
><td
><a href=
"http://packages.qa.debian.org/leocad
">leocad
</a
></td
><td
>virtual brick CAD software
</td
></tr
>
243 <tr
><td
><a href=
"http://packages.qa.debian.org/libnxt
">libnxt
</a
></td
><td
>utility library for talking to the LEGO Mindstorms NX
</td
></tr
>
244 <tr
><td
><a href=
"http://packages.qa.debian.org/lnpd
">lnpd
</a
></td
><td
>daemon for LNP communication with BrickOS
</td
></tr
>
245 <tr
><td
><a href=
"http://packages.qa.debian.org/nbc
">nbc
</a
></td
><td
>compiler for LEGO Mindstorms NXT bricks
</td
></tr
>
246 <tr
><td
><a href=
"http://packages.qa.debian.org/nqc
">nqc
</a
></td
><td
>Not Quite C compiler for LEGO Mindstorms RCX
</td
></tr
>
247 <tr
><td
><a href=
"http://packages.qa.debian.org/python-nxt
">python-nxt
</a
></td
><td
>python driver/interface/wrapper for the Lego Mindstorms NXT robot
</td
></tr
>
248 <tr
><td
><a href=
"http://packages.qa.debian.org/python-nxt-filer
">python-nxt-filer
</a
></td
><td
>simple GUI to manage files on a LEGO Mindstorms NXT
</td
></tr
>
249 <tr
><td
><a href=
"http://packages.qa.debian.org/scratch
">scratch
</a
></td
><td
>easy to use programming environment for ages
8 and up
</td
></tr
>
250 <tr
><td
><a href=
"http://packages.qa.debian.org/t2n
">t2n
</a
></td
><td
>simple command-line tool for Lego NXT
</td
></tr
>
251 </table
></p
>
253 <p
>Some of these are available in Wheezy, and all but one are
254 currently available in Jessie/testing. leocad is so far only
255 available in experimental.
</p
>
257 <p
>If you care about LEGO in Debian, please join us on IRC and help
258 adding the rest of the great free software tools available on Linux
259 for LEGO designers.
</p
>
264 <title>New IRC channel for LEGO designers using Debian
</title>
265 <link>http://www.hungry.com/~pere/blog/New_IRC_channel_for_LEGO_designers_using_Debian.html
</link>
266 <guid isPermaLink=
"true">http://www.hungry.com/~pere/blog/New_IRC_channel_for_LEGO_designers_using_Debian.html
</guid>
267 <pubDate>Wed,
2 Jan
2013 15:
40:
00 +
0100</pubDate>
268 <description><p
>During Christmas, I have worked a bit on the Debian support for
269 <a href=
"http://mindstorms.lego.com/en-us/Default.aspx
">LEGO Mindstorm
270 NXT
</a
>. My son and I have played a bit with my NXT set, and I
271 discovered I had to build all the tools myself because none were
272 already in Debian Squeeze. If Debian support for LEGO is something
273 you care about, please join me on the IRC channel
274 <a href=
"irc://irc.debian.org/%
23debian-lego
">#debian-lego
</a
> (server
275 irc.debian.org). There is a lot that could be done to improve the
276 Debian support for LEGO designers. For example both CAD software
277 and Mindstorm compilers are missing. :)
</p
>
279 <p
>Update
2012-
01-
03: A
280 <a href=
"http://wiki.debian.org/LegoDesigners
">project page
</a
>
281 including links to Lego related packages is now available.
</p
>