From: Petter Reinholdtsen Date: Mon, 6 Nov 2017 09:50:30 +0000 (+0100) Subject: Generated. X-Git-Url: https://pere.pagekite.me/gitweb/homepage.git/commitdiff_plain/c59110119a869e433132f6d63c009ef4a0284d85?ds=inline Generated. --- diff --git a/blog/tags/lego/index.html b/blog/tags/lego/index.html new file mode 100644 index 0000000000..5eeed19ef2 --- /dev/null +++ b/blog/tags/lego/index.html @@ -0,0 +1,725 @@ + + + + + Petter Reinholdtsen: Entries Tagged lego + + + + + +
+

+ Petter Reinholdtsen + +

+ +
+ + +

Entries tagged "lego".

+ +
+ +
+ 4th November 2016 +
+
+

A while back I received a Gyro sensor for the NXT +Mindstorms controller as a birthday +present. It had been on my wishlist for a while, because I wanted to +build a Segway like balancing lego robot. I had already built +a simple balancing +robot with the kids, using the light/color sensor included in the +NXT kit as the balance sensor, but it was not working very well. It +could balance for a while, but was very sensitive to the light +condition in the room and the reflective properties of the surface and +would fall over after a short while. I wanted something more robust, +and had +the +gyro sensor from HiTechnic I believed would solve it on my +wishlist for some years before it suddenly showed up as a gift from my +loved ones. :)

+ +

Unfortunately I have not had time to sit down and play with it +since then. But that changed some days ago, when I was searching for +lego segway information and came across a recipe from HiTechnic for +building +the +HTWay, a segway like balancing robot. Build instructions and +source +code was included, so it was just a question of putting it all +together. And thanks to the great work of many Debian developers, the +compiler needed to build the source for the NXT is already included in +Debian, so I was read to go in less than an hour. The resulting robot +do not look very impressive in its simplicity:

+ +

+ +

Because I lack the infrared sensor used to control the robot in the +design from HiTechnic, I had to comment out the last task +(taskControl). I simply placed /* and */ around it get the program +working without that sensor present. Now it balances just fine until +the battery status run low:

+ +

+ +

Now we would like to teach it how to follow a line and take remote +control instructions using the included Bluetooth receiver in the NXT.

+ +

If you, like me, love LEGO and want to make sure we find the tools +they need to work with LEGO in Debian and all our derivative +distributions like Ubuntu, check out +the LEGO designers +project page and join the Debian LEGO team. Personally I own a +RCX and NXT controller (no EV3), and would like to make sure the +Debian tools needed to program the systems I own work as they +should.

+ +
+
+ + + Tags: debian, english, lego, robot. + + +
+
+
+ +
+ +
+ 7th October 2016 +
+
+

The Isenkram +system provide a practical and easy way to figure out which +packages support the hardware in a given machine. The command line +tool isenkram-lookup and the tasksel options provide a +convenient way to list and install packages relevant for the current +hardware during system installation, both user space packages and +firmware packages. The GUI background daemon on the other hand provide +a pop-up proposing to install packages when a new dongle is inserted +while using the computer. For example, if you plug in a smart card +reader, the system will ask if you want to install pcscd if +that package isn't already installed, and if you plug in a USB video +camera the system will ask if you want to install cheese if +cheese is currently missing. This already work just fine.

+ +

But Isenkram depend on a database mapping from hardware IDs to +package names. When I started no such database existed in Debian, so +I made my own data set and included it with the isenkram package and +made isenkram fetch the latest version of this database from git using +http. This way the isenkram users would get updated package proposals +as soon as I learned more about hardware related packages.

+ +

The hardware is identified using modalias strings. The modalias +design is from the Linux kernel where most hardware descriptors are +made available as a strings that can be matched using filename style +globbing. It handle USB, PCI, DMI and a lot of other hardware related +identifiers.

+ +

The downside to the Isenkram specific database is that there is no +information about relevant distribution / Debian version, making +isenkram propose obsolete packages too. But along came AppStream, a +cross distribution mechanism to store and collect metadata about +software packages. When I heard about the proposal, I contacted the +people involved and suggested to add a hardware matching rule using +modalias strings in the specification, to be able to use AppStream for +mapping hardware to packages. This idea was accepted and AppStream is +now a great way for a package to announce the hardware it support in a +distribution neutral way. I wrote +a +recipe on how to add such meta-information in a blog post last +December. If you have a hardware related package in Debian, please +announce the relevant hardware IDs using AppStream.

+ +

In Debian, almost all packages that can talk to a LEGO Mindestorms +RCX or NXT unit, announce this support using AppStream. The effect is +that when you insert such LEGO robot controller into your Debian +machine, Isenkram will propose to install the packages needed to get +it working. The intention is that this should allow the local user to +start programming his robot controller right away without having to +guess what packages to use or which permissions to fix.

+ +

But when I sat down with my son the other day to program our NXT +unit using his Debian Stretch computer, I discovered something +annoying. The local console user (ie my son) did not get access to +the USB device for programming the unit. This used to work, but no +longer in Jessie and Stretch. After some investigation and asking +around on #debian-devel, I discovered that this was because udev had +changed the mechanism used to grant access to local devices. The +ConsoleKit mechanism from /lib/udev/rules.d/70-udev-acl.rules +no longer applied, because LDAP users no longer was added to the +plugdev group during login. Michael Biebl told me that this method +was obsolete and the new method used ACLs instead. This was good +news, as the plugdev mechanism is a mess when using a remote user +directory like LDAP. Using ACLs would make sure a user lost device +access when she logged out, even if the user left behind a background +process which would retain the plugdev membership with the ConsoleKit +setup. Armed with this knowledge I moved on to fix the access problem +for the LEGO Mindstorms related packages.

+ +

The new system uses a udev tag, 'uaccess'. It can either be +applied directly for a device, or is applied in +/lib/udev/rules.d/70-uaccess.rules for classes of devices. As the +LEGO Mindstorms udev rules did not have a class, I decided to add the +tag directly in the udev rules files included in the packages. Here +is one example. For the nqc C compiler for the RCX, the +/lib/udev/rules.d/60-nqc.rules file now look like this: + +

+SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="0694", ATTR{idProduct}=="0001", \
+    SYMLINK+="rcx-%k", TAG+="uaccess"
+

+ +

The key part is the 'TAG+="uaccess"' at the end. I suspect all +packages using plugdev in their /lib/udev/rules.d/ files should be +changed to use this tag (either directly or indirectly via +70-uaccess.rules). Perhaps a lintian check should be created +to detect this?

+ +

I've been unable to find good documentation on the uaccess feature. +It is unclear to me if the uaccess tag is an internal implementation +detail like the udev-acl tag used by +/lib/udev/rules.d/70-udev-acl.rules. If it is, I guess the +indirect method is the preferred way. Michael +asked for more +documentation from the systemd project and I hope it will make +this clearer. For now I use the generic classes when they exist and +is already handled by 70-uaccess.rules, and add the tag +directly if no such class exist.

+ +

To learn more about the isenkram system, please check out +my +blog posts tagged isenkram.

+ +

To help out making life for LEGO constructors in Debian easier, +please join us on our IRC channel +#debian-lego and join +the Debian +LEGO team in the Alioth project we created yesterday. A mailing +list is not yet created, but we are working on it. :)

+ +

As usual, if you use Bitcoin and want to show your support of my +activities, please send Bitcoin donations to my address +15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b.

+ +
+
+ + + Tags: debian, english, isenkram, lego. + + +
+
+
+ +
+ +
+ 11th May 2013 +
+
+

In January, +I +announced a new IRC +channel #debian-lego, for those of us in the Debian and Linux +community interested in LEGO, the +marvellous construction system from Denmark. We also created +a wiki page to have +a place to take notes and write down our plans and hopes. And several +people showed up to help. I was very happy to see the effect of my +call. Since the small start, we have a debtags tag +hardware::hobby:lego +tag for LEGO related packages, and now count 10 packages related to +LEGO and Mindstorms:

+ +

+ + + + + + + + + + +
brickosalternative OS for LEGO Mindstorms RCX. Supports development in C/C++
leocadvirtual brick CAD software
libnxtutility library for talking to the LEGO Mindstorms NX
lnpddaemon for LNP communication with BrickOS
nbccompiler for LEGO Mindstorms NXT bricks
nqcNot Quite C compiler for LEGO Mindstorms RCX
python-nxtpython driver/interface/wrapper for the Lego Mindstorms NXT robot
python-nxt-filersimple GUI to manage files on a LEGO Mindstorms NXT
scratcheasy to use programming environment for ages 8 and up
t2nsimple command-line tool for Lego NXT

+ +

Some of these are available in Wheezy, and all but one are +currently available in Jessie/testing. leocad is so far only +available in experimental.

+ +

If you care about LEGO in Debian, please join us on IRC and help +adding the rest of the great free software tools available on Linux +for LEGO designers.

+ +
+
+ + + Tags: debian, english, lego, robot. + + +
+
+
+ +
+ +
+ 2nd January 2013 +
+
+

During Christmas, I have worked a bit on the Debian support for +LEGO Mindstorm +NXT. My son and I have played a bit with my NXT set, and I +discovered I had to build all the tools myself because none were +already in Debian Squeeze. If Debian support for LEGO is something +you care about, please join me on the IRC channel +#debian-lego (server +irc.debian.org). There is a lot that could be done to improve the +Debian support for LEGO designers. For example both CAD software +and Mindstorm compilers are missing. :)

+ +

Update 2012-01-03: A +project page +including links to Lego related packages is now available.

+ +
+
+ + + Tags: debian, english, lego, robot. + + +
+
+
+ +

RSS Feed

+ +

+ Created by Chronicle v4.6 +

+ + + diff --git a/blog/tags/lego/lego.rss b/blog/tags/lego/lego.rss new file mode 100644 index 0000000000..67eccaf111 --- /dev/null +++ b/blog/tags/lego/lego.rss @@ -0,0 +1,254 @@ + + + + Petter Reinholdtsen - Entries tagged lego + Entries tagged lego + http://people.skolelinux.org/pere/blog/ + + + + My own self balancing Lego Segway + http://people.skolelinux.org/pere/blog/My_own_self_balancing_Lego_Segway.html + http://people.skolelinux.org/pere/blog/My_own_self_balancing_Lego_Segway.html + Fri, 4 Nov 2016 10:15:00 +0100 + <p>A while back I received a Gyro sensor for the NXT +<a href="mindstorms.lego.com">Mindstorms</a> controller as a birthday +present. It had been on my wishlist for a while, because I wanted to +build a Segway like balancing lego robot. I had already built +<a href="http://www.nxtprograms.com/NXT2/segway/">a simple balancing +robot</a> with the kids, using the light/color sensor included in the +NXT kit as the balance sensor, but it was not working very well. It +could balance for a while, but was very sensitive to the light +condition in the room and the reflective properties of the surface and +would fall over after a short while. I wanted something more robust, +and had +<a href="https://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=NGY1044">the +gyro sensor from HiTechnic</a> I believed would solve it on my +wishlist for some years before it suddenly showed up as a gift from my +loved ones. :)</p> + +<p>Unfortunately I have not had time to sit down and play with it +since then. But that changed some days ago, when I was searching for +lego segway information and came across a recipe from HiTechnic for +building +<a href="http://www.hitechnic.com/blog/gyro-sensor/htway/">the +HTWay</a>, a segway like balancing robot. Build instructions and +<a href="https://www.hitechnic.com/upload/786-HTWayC.nxc">source +code</a> was included, so it was just a question of putting it all +together. And thanks to the great work of many Debian developers, the +compiler needed to build the source for the NXT is already included in +Debian, so I was read to go in less than an hour. The resulting robot +do not look very impressive in its simplicity:</p> + +<p align="center"><img width="70%" src="http://people.skolelinux.org/pere/blog/images/2016-11-04-lego-htway-robot.jpeg"></p> + +<p>Because I lack the infrared sensor used to control the robot in the +design from HiTechnic, I had to comment out the last task +(taskControl). I simply placed /* and */ around it get the program +working without that sensor present. Now it balances just fine until +the battery status run low:</p> + +<p align="center"><video width="70%" controls="true"> + <source src="http://people.skolelinux.org/pere/blog/images/2016-11-04-lego-htway-balancing.ogv" type="video/ogg"> +</video></p> + +<p>Now we would like to teach it how to follow a line and take remote +control instructions using the included Bluetooth receiver in the NXT.</p> + +<p>If you, like me, love LEGO and want to make sure we find the tools +they need to work with LEGO in Debian and all our derivative +distributions like Ubuntu, check out +<a href="http://wiki.debian.org/LegoDesigners">the LEGO designers +project page</a> and join the Debian LEGO team. Personally I own a +RCX and NXT controller (no EV3), and would like to make sure the +Debian tools needed to program the systems I own work as they +should.</p> + + + + + Isenkram, Appstream and udev make life as a LEGO builder easier + http://people.skolelinux.org/pere/blog/Isenkram__Appstream_and_udev_make_life_as_a_LEGO_builder_easier.html + http://people.skolelinux.org/pere/blog/Isenkram__Appstream_and_udev_make_life_as_a_LEGO_builder_easier.html + Fri, 7 Oct 2016 09:50:00 +0200 + <p><a href="http://packages.qa.debian.org/isenkram">The Isenkram +system</a> provide a practical and easy way to figure out which +packages support the hardware in a given machine. The command line +tool <tt>isenkram-lookup</tt> and the tasksel options provide a +convenient way to list and install packages relevant for the current +hardware during system installation, both user space packages and +firmware packages. The GUI background daemon on the other hand provide +a pop-up proposing to install packages when a new dongle is inserted +while using the computer. For example, if you plug in a smart card +reader, the system will ask if you want to install <tt>pcscd</tt> if +that package isn't already installed, and if you plug in a USB video +camera the system will ask if you want to install <tt>cheese</tt> if +cheese is currently missing. This already work just fine.</p> + +<p>But Isenkram depend on a database mapping from hardware IDs to +package names. When I started no such database existed in Debian, so +I made my own data set and included it with the isenkram package and +made isenkram fetch the latest version of this database from git using +http. This way the isenkram users would get updated package proposals +as soon as I learned more about hardware related packages.</p> + +<p>The hardware is identified using modalias strings. The modalias +design is from the Linux kernel where most hardware descriptors are +made available as a strings that can be matched using filename style +globbing. It handle USB, PCI, DMI and a lot of other hardware related +identifiers.</p> + +<p>The downside to the Isenkram specific database is that there is no +information about relevant distribution / Debian version, making +isenkram propose obsolete packages too. But along came AppStream, a +cross distribution mechanism to store and collect metadata about +software packages. When I heard about the proposal, I contacted the +people involved and suggested to add a hardware matching rule using +modalias strings in the specification, to be able to use AppStream for +mapping hardware to packages. This idea was accepted and AppStream is +now a great way for a package to announce the hardware it support in a +distribution neutral way. I wrote +<a href="http://people.skolelinux.org/pere/blog/Using_appstream_with_isenkram_to_install_hardware_related_packages_in_Debian.html">a +recipe on how to add such meta-information</a> in a blog post last +December. If you have a hardware related package in Debian, please +announce the relevant hardware IDs using AppStream.</p> + +<p>In Debian, almost all packages that can talk to a LEGO Mindestorms +RCX or NXT unit, announce this support using AppStream. The effect is +that when you insert such LEGO robot controller into your Debian +machine, Isenkram will propose to install the packages needed to get +it working. The intention is that this should allow the local user to +start programming his robot controller right away without having to +guess what packages to use or which permissions to fix.</p> + +<p>But when I sat down with my son the other day to program our NXT +unit using his Debian Stretch computer, I discovered something +annoying. The local console user (ie my son) did not get access to +the USB device for programming the unit. This used to work, but no +longer in Jessie and Stretch. After some investigation and asking +around on #debian-devel, I discovered that this was because udev had +changed the mechanism used to grant access to local devices. The +ConsoleKit mechanism from <tt>/lib/udev/rules.d/70-udev-acl.rules</tt> +no longer applied, because LDAP users no longer was added to the +plugdev group during login. Michael Biebl told me that this method +was obsolete and the new method used ACLs instead. This was good +news, as the plugdev mechanism is a mess when using a remote user +directory like LDAP. Using ACLs would make sure a user lost device +access when she logged out, even if the user left behind a background +process which would retain the plugdev membership with the ConsoleKit +setup. Armed with this knowledge I moved on to fix the access problem +for the LEGO Mindstorms related packages.</p> + +<p>The new system uses a udev tag, 'uaccess'. It can either be +applied directly for a device, or is applied in +/lib/udev/rules.d/70-uaccess.rules for classes of devices. As the +LEGO Mindstorms udev rules did not have a class, I decided to add the +tag directly in the udev rules files included in the packages. Here +is one example. For the nqc C compiler for the RCX, the +<tt>/lib/udev/rules.d/60-nqc.rules</tt> file now look like this: + +<p><pre> +SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="0694", ATTR{idProduct}=="0001", \ + SYMLINK+="rcx-%k", TAG+="uaccess" +</pre></p> + +<p>The key part is the 'TAG+="uaccess"' at the end. I suspect all +packages using plugdev in their /lib/udev/rules.d/ files should be +changed to use this tag (either directly or indirectly via +<tt>70-uaccess.rules</tt>). Perhaps a lintian check should be created +to detect this?</p> + +<p>I've been unable to find good documentation on the uaccess feature. +It is unclear to me if the uaccess tag is an internal implementation +detail like the udev-acl tag used by +<tt>/lib/udev/rules.d/70-udev-acl.rules</tt>. If it is, I guess the +indirect method is the preferred way. Michael +<a href="https://github.com/systemd/systemd/issues/4288">asked for more +documentation from the systemd project</a> and I hope it will make +this clearer. For now I use the generic classes when they exist and +is already handled by <tt>70-uaccess.rules</tt>, and add the tag +directly if no such class exist.</p> + +<p>To learn more about the isenkram system, please check out +<a href="http://people.skolelinux.org/pere/blog/tags/isenkram/">my +blog posts tagged isenkram</a>.</p> + +<p>To help out making life for LEGO constructors in Debian easier, +please join us on our IRC channel +<a href="irc://irc.debian.org/%23debian-lego">#debian-lego</a> and join +the <a href="https://alioth.debian.org/projects/debian-lego/">Debian +LEGO team</a> in the Alioth project we created yesterday. A mailing +list is not yet created, but we are working on it. :)</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&label=PetterReinholdtsenBlog">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b</a></b>.</p> + + + + + Debian, the Linux distribution of choice for LEGO designers? + http://people.skolelinux.org/pere/blog/Debian__the_Linux_distribution_of_choice_for_LEGO_designers_.html + http://people.skolelinux.org/pere/blog/Debian__the_Linux_distribution_of_choice_for_LEGO_designers_.html + Sat, 11 May 2013 20:30:00 +0200 + <P>In January, +<a href="http://people.skolelinux.org/pere/blog/New_IRC_channel_for_LEGO_designers_using_Debian.html">I +announced a</a> new <a href="irc://irc.debian.org/%23debian-lego">IRC +channel #debian-lego</a>, for those of us in the Debian and Linux +community interested in <a href="http://www.lego.com/">LEGO</a>, the +marvellous construction system from Denmark. We also created +<a href="http://wiki.debian.org/LegoDesigners">a wiki page</a> to have +a place to take notes and write down our plans and hopes. And several +people showed up to help. I was very happy to see the effect of my +call. Since the small start, we have a debtags tag +<a href="http://debtags.debian.net/search/bytag?wl=hardware::hobby:lego">hardware::hobby:lego</a> +tag for LEGO related packages, and now count 10 packages related to +LEGO and <a href="http://mindstorms.lego.com/">Mindstorms</a>:</p> + +<p><table> +<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> +<tr><td><a href="http://packages.qa.debian.org/leocad">leocad</a></td><td>virtual brick CAD software</td></tr> +<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> +<tr><td><a href="http://packages.qa.debian.org/lnpd">lnpd</a></td><td>daemon for LNP communication with BrickOS</td></tr> +<tr><td><a href="http://packages.qa.debian.org/nbc">nbc</a></td><td>compiler for LEGO Mindstorms NXT bricks</td></tr> +<tr><td><a href="http://packages.qa.debian.org/nqc">nqc</a></td><td>Not Quite C compiler for LEGO Mindstorms RCX</td></tr> +<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> +<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> +<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> +<tr><td><a href="http://packages.qa.debian.org/t2n">t2n</a></td><td>simple command-line tool for Lego NXT</td></tr> +</table></p> + +<p>Some of these are available in Wheezy, and all but one are +currently available in Jessie/testing. leocad is so far only +available in experimental.</p> + +<p>If you care about LEGO in Debian, please join us on IRC and help +adding the rest of the great free software tools available on Linux +for LEGO designers.</p> + + + + + New IRC channel for LEGO designers using Debian + http://people.skolelinux.org/pere/blog/New_IRC_channel_for_LEGO_designers_using_Debian.html + http://people.skolelinux.org/pere/blog/New_IRC_channel_for_LEGO_designers_using_Debian.html + Wed, 2 Jan 2013 15:40:00 +0100 + <p>During Christmas, I have worked a bit on the Debian support for +<a href="http://mindstorms.lego.com/en-us/Default.aspx">LEGO Mindstorm +NXT</a>. My son and I have played a bit with my NXT set, and I +discovered I had to build all the tools myself because none were +already in Debian Squeeze. If Debian support for LEGO is something +you care about, please join me on the IRC channel +<a href="irc://irc.debian.org/%23debian-lego">#debian-lego</a> (server +irc.debian.org). There is a lot that could be done to improve the +Debian support for LEGO designers. For example both CAD software +and Mindstorm compilers are missing. :)</p> + +<p>Update 2012-01-03: A +<a href="http://wiki.debian.org/LegoDesigners">project page</a> +including links to Lego related packages is now available.</p> + + + + +