Skip to Content

Scratch with WeDo on Linux -- distro-specific issues

« Bugs, Troubleshooting, Suggestions
8 replies [Last post]
F. Gress
Member
Hello folks,
 
I am a middle-school teacher working on integrating Scratch with LEGO WeDo systems, on Linux. 
(I have previously used Scratch+WeDo on Windows, but I'm hoping to start using Linux so that I can re-purpose old computers, plus encourage more educators and parents to try Linux with kids.)
 
BUT...I am having trouble, I think, getting the LEGO WeDo USB connection to be recognized consistently through Linux.
 
I have recently obtained a Raspberry Pi, which came with a Raspbian distro (Debian Wheezy) , and the included Scratch 1.4 version worked right away with the WeDo USB connection. Yay!
 
However, not so much luck with another version of Linux on some laptops that I tried.
Boo.
 
As you may know, in Scratch, there are some special functions (program blocks) that interact with the WeDo motor and sensors through the special WeDo USB hub. The documentation that I can find says that Scratch will show these special function blocks only when the WeDo USB hub is active/recognized. (One can force-display the blocks through a menu option, but that doesn't necessarily mean they'll work).

I installed the Ubermix (Ubuntu) distro on 2 old-ish Dell Latitude D610's, and the WeDo USB connection does NOT seem to be working/recognized on either laptop. (The special blocks do not appear in Scratch 1.4, nor does any sensor or motor work, even if I make the blocks appear by using the menu, then put them in a program. And yes, I tried both motor and sensors, & all of the USB ports.)
 
Anyone got clues to help me?
Maybe I should just try another kid-friendly distro?
(Anyone tried Edubuntu or DoudouLinux?)
 
 
I figure it's  USB drivers or hardware config or permissions or something, but I am NOT at all an expert with Linux and I don't have that much time. I can edit config files, etc, if I have instructions. I also have a few Linux-loving friends who I can call upon if needed, but I'd like to have first done whatever research I can. (*see below)  Also, I cannot really advocate for other teachers to try this if it's not fairly easy. but if there is a fairly simple fix, I'd be happy to help make sure it gets spread around.
 
I do have a deadline of sorts -- trying to have this working for demos at a Maker Faire in May 2014.
 

Any help appreciated!

~ Ms. G in Texas



 
* Here are all the web clues I have found so far:
Re: No support for LEGO WeDo in Scratch on Linux (scratch team mailing list archive): https://lists.launchpad.net/scratch/msg00269.html
Scratch in Debian (Miriam Ruiz blog): http://www.miriamruiz.es/weblog/?p=678
Lego Wedo & Scratch (Raspberry Pi forums): http://www.raspberrypi.org/forums/viewtopic.php?f=63&t=62957
Scratch and GPIO (Raspberry Pi forums): http://www.raspberrypi.org/forums/viewtopic.php?f=77&t=15604
Scratch to hardware API: call for discussions (Raspberry Pi forums): http://www.raspberrypi.org/forums/posting.php?mode=quote&f=77&p=511369
 
Replies
Kevin Valentine
Member
wrt to your last paragraph, I am in a similar situation.  I am somewhat locked-in at the moment with the Lego software + Win7.  The Lego software isn't that bad and actually warming up to it.  I just find the Scratch learning curve to have a more natural flow to it.  I also prefer Linux, whenever possible, on PC hardware with low performance.

You've discovered one of the major annoyances between the different flavors of Linux-based OSes: udev, aka Linux Dynamic Device Management.  For some details from the Debian site:
https://wiki.debian.org/udev

Out of the box, each Linux flavor seems to have different security policies regarding what a typical user can plug in to the PC and immediately operate without Admin privs.  Strict security is general a good thing but it tends to get in the way when tinkering with hardware.  It's good you found Mint.

FYI, I recently tried a community update to Scratch 1.4 for operating two motors on Linux.  Works great so far.

F. Gress
Member
Thanks for the offer, Kevin, but I'm going to take your word that it works on Ubuntu.
(Maybe there's something you already know or did or take for granted if you're familiar with Ubuntu? I recall there perhaps being some issue with the "plugdev" group in some other part of system settings?)

I can't justify spending the time on new installs just to see if it works right now (plus I don't have access to the aformentioned Dell laptops over the summer; they are checked in at school).

On a related note, however, I had a student who wanted to install Linux on a small hand-me-down "netbook" or "notebook" type of computer (Acer something). We decided to try out Linux Mint (MATE desktop).
It turned out to be pretty popular among the kids, super easy & quick to install from USB, worked on a number of devices and -- guess what -- the WeDo integration with Scratch JUST WORKED right away, with no tweaking whatsoever! <facepalm>

So here's the conclusion for anyone wading through this thread, hoping to get WeDo - Scratch integration working on a new Linux install, plus a recommendation for a good starter distro for middle-school education:
Try Linux Mint!

BTW Kevin, I agree that Scratch is preferable for a number of reasons. If I was not using (and our school hadn't already paid for) the "Activity Pack" that runs within the WeDo software interface, I might try doing a whole class from Scratch.
F. Gress
Member
Thanks, Sjoerd,
...but alas, adding that file didn't work.

This is similar to the solution discussed at http://www.miriamruiz.es/weblog/?p=678 so I was really hopeful.
Where did you get this info?
(Looks like you pasted from somewhere)

I made sure the file permissions were the same as other files in the rules.d directory, in case that mattered. (and spent a little time understanding the need to use "sudo" to do eveything in this Ubuntu distro.)

Is there any easy way to tell what USB devices/drivers are installed or detected?

Time to call my Linux friends, I guess.
I'll keep y'all posted.
Sjoerd Dirk Meijer
Member
I'm using Debian and this worked for me.

Did you restart udev or alternatively, did you restart the computer?

Hopefully you get it fixed.

Sjoerd Dirk
Sjoerd Dirk Meijer
Member
 Please try this:

Functionality can be restored
by installing the following file  /etc/udev/rules.d/99-wedo.rules with
the following content:

ATTRS{idVendor}=="0694", ATTRS{idProduct}=="0003", SUBSYSTEMS=="usb",
ACTION=="add", MODE="0666", GROUP="plugdev"
F. Gress
Member
Update:

Got it all running fine in Debian (thanks to a friend), with the ".rules" fix.

Still no idea how to get it going in Ubuntu -- my friend was unfamiliar/wary of Ubuntu and felt it easier just to install Debian.
Anyone who ever reads this & wants to suggest something else to try for Ubuntu, I'd be willing to try.

Thanks to the GNU/Linux & OSS community, as always, for having stuff that works, with options & people who support it.

We introduced dozens of kids to Linux, along with Scratch, at the Austin Mini Maker Faire.
(see here)

~ Ms. G
Kevin Valentine
Member
Hi Ms. G,

I'm using the solution that Sjoerd proivded further up with the 99-wedo.rules file.  So far, it's been very repeatable on 3 different PCs running Ubunut Linux 12.04 (32-bit) using Scratch 1.4 (non-web of course).  I'm impressed with how well it works across my different PCs.  I can attempt to walk you through it on Ubuntu.

BTW, I'm strongly preferring Scratch over the software provided by Lego.


F. Gress
Member
Thanks for the offer, Kevin, but I'm going to take your word that it works on Ubuntu. 
(Maybe there's something you already know or did or take for granted if you're familiar with Ubuntu? I recall there perhaps being some issue with the "plugdev" group in some other part of system settings?)
 
I can't justify spending the time on new installs just to see if it works right now (plus I don't have access to the aformentioned Dell laptops over the summer; they are checked in at school).
 
On a related note, however, I had a student who wanted to install Linux on a small hand-me-down "netbook" or "notebook" type of computer (Acer something). We decided to try out Linux Mint (MATE desktop). 
It turned out to be pretty popular among the kids, super easy & quick to install from USB, worked on a number of devices and -- guess what -- the WeDo integration with Scratch JUST WORKED right away, with no tweaking whatsoever! <facepalm>
 
So here's the conclusion for anyone wading through this thread, hoping to get WeDo - Scratch integration working on a new Linux install, plus a recommendation for a good starter distro for middle-school education:
  • Try Linux Mint!

 
BTW Kevin, I agree that Scratch is preferable for a number of reasons. If I was not using (and our school hadn't already paid for) the "Activity Pack" that runs within the WeDo software interface, I might try doing a whole class from Scratch.