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