WeDo + Scratch working!


8 posts
by Myra » Tue Jul 10, 2012 10:27 pm
I now have the WeDo crocodile happily chomping on my finger, powered by my Pi, thanks to some help from Alex Bradbury. In order to make this happen you need to add a udev rule which makes the WeDo USB hub readable and writable by the pi user.

Go to directory
/lib/udev/rules.d
make a file called "40-scratch.rules" that contains the following:
ATTRS{idVendor}=="0694", ATTRS{idProduct}=="0003", SUBSYSTEMS=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

Then start up Scratch, plug in your WeDo USB hub, and the motor control blocks should show up in the Motion area.

Hooray, chomping crocodiles for everyone!
Posts: 13
Joined: Fri Jan 06, 2012 3:14 pm
by Myra » Wed Jul 11, 2012 8:43 am
Hmmm, I think my announcement was a bit premature. This udev rule works with the Scratch on the new wheezy distribution, but not on squeeze. At least it doesn't work on the version of squeeze that I've got!
Posts: 13
Joined: Fri Jan 06, 2012 3:14 pm
by asb » Wed Jul 11, 2012 9:15 am
We're moving to wheezy anyway. Very possibly the version of squeak-plugins-scratch used in the wheezy distribution didn't have WeDo, or maybe the pi user isn't a member of the plugdev group (if that's the problem, running scratch as root should still allow WeDo to work).
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 843
Joined: Fri Sep 16, 2011 7:16 pm
by FangW » Wed Mar 25, 2015 5:40 am
Hi, I just purchased rasberry pi 2 ultimate kit and trying to connect WeDo USB hub to it.

Following the instructions above to create the rule file, but the usb connection is not working. Motor can't be turned on and sensor value is not changing.

Here is dmesg output which looks fine to me:

[ 86.668920] usb 1-1.2: new low-speed USB device number 12 using dwc_otg
[ 86.818378] usb 1-1.2: New USB device found, idVendor=0694, idProduct=0003
[ 86.830740] usb 1-1.2: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 86.843443] usb 1-1.2: Product: LEGO USB Hub V1.00
[ 86.869818] hid-generic 0003:0694:0003.0005: hiddev0,hidraw0: USB HID v1.10 Device [LEGO USB Hub V1.00] on usb-bcm2708_usb-1.2/input0


more /lib/udev/rules.d/40-scratch.rules
ATTRS{idVendor}=="0694", ATTRS{idProduct}=="0003", SUBSYSTEMS=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"


Thanks.

Fang
Posts: 1
Joined: Wed Mar 25, 2015 5:33 am
by arieg » Sat Apr 11, 2015 9:11 pm
Hi -
Just unpacked a new Pi 2, and connected to WeDo via Scratch. Unfortunately the motor and sensors are not responsive.
dmesg output, and 40-scratch.rules look correct - as in a recent post by Fang

I've succeeded to activate WeDo with python wedo library - but only after tweaking wedo USB device initialization code

Advice appreciated
ArieG
Posts: 2
Joined: Sat Apr 11, 2015 8:53 pm
by mattmiller » Fri May 01, 2015 9:25 pm
It might be worth trying to use the original version of Scratch just in case its an issue with the latest version

Try running opening up LX Terminal and typing
/usr/bin.scratch.old
Posts: 36
Joined: Thu Feb 05, 2015 11:25 pm
by arieg » Sat May 02, 2015 7:05 pm
mattmiller wrote:It might be worth trying to use the original version of Scratch just in case its an issue with the latest version

Try running opening up LX Terminal and typing
/usr/bin.scratch.old

This works perfectly, thanks!!
Posts: 2
Joined: Sat Apr 11, 2015 8:53 pm
by timrowledge » Sun May 03, 2015 8:53 pm
The problem you're going to face using the old Scratch system is that you lose out on the fairly dramatic performance improvements made over the last year or so as well as some very big speed bumps coming fairly soon.

I can't offer to do any debugging of the WeDo stuff since I have no WeDo hardware, *but* looking at the codebase I don't think it's even being built right now. I'll add it to the (rather long) list of things to look at when possible.
"Compromise", says Professor Trefusis, "is stalling between two fools"
Posts: 511
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island