This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#26 2011-04-05 10:52:29

schoelles
New Scratcher
Registered: 2011-03-29
Posts: 7

Re: WeDo - will it work?

abee wrote:

... However it requires two PCs and some skill of network.
Do you have both of them? If so I will tell you how it works.

I think I would be able to do this in C and I have 2 PC's. But isn't it possible to configure the ports, to let it run on one PC? Seems that touch_classroom developed something like this in python:
http://scratch.mit.edu/forums/viewtopic.php?pid=438133#p438133

Offline

 

#27 2011-04-05 21:56:44

abee
Scratcher
Registered: 2007-05-25
Posts: 100+

Re: WeDo - will it work?

schoelles,
You need to open the TCP/IP port #42001 for Scratch Mesh. In many case this port is opened as default. If not, you should configure firewall and/or router setting. C language is not related. The system diagram is as follows.
http://squeakland.jp/abee/tmp/MeshWeDo.png
That thread you pointed describes connecting Mindstorm NXT to Scratch.
Many technical documents for Mindstorms NXT are available. But there are no documents for WeDo. So it is difficult to control two or more hubs from one PC by any language, Python, etc. Only genuine LEGO WeDo software supports 8 hubs max.

Offline

 

#28 2011-04-06 14:04:05

djembii
New Scratcher
Registered: 2011-03-25
Posts: 13

Re: WeDo - will it work?

Thanks a lot abee!

abee wrote:

You need to open the TCP/IP port #42001 for Scratch Mesh.

So now I'm able to snoop for the protocol - or does there exist any descriptions of the application layer protocol?

abee wrote:

Many technical documents for Mindstorms NXT are available.

I saw the NXT iBrick's firmware to be open source. But what's about the NXT sensors itself? They are using analogue or I2C. Or do you think touch_classroom connects to the NXT iBrick instead? Then it would not be a suitable solution for my kids...

abee wrote:

But there are no documents for WeDo.

From link http://thenxtstep.blogspot.com/2009/01/wedo-sensors-and-nxt.html I've learned that the WeDo sensors are all analogue. So one way would be, to use a picoboard to read the values. But then I would need another hardware for all kids! So I search a little bit longer and I've found: http://news.lugnet.com/robotics/rcx/?n=2954:; Though I have no glue of LUA, I've requested the sources already - let's see.

Offline

 

#29 2011-04-07 03:34:21

djembii
New Scratcher
Registered: 2011-03-25
Posts: 13

Re: WeDo - will it work?

Found the Mesh protocol on the Wiki (<url=http://wiki.scratch.mit.edu/wiki/Remote_Sensors_Protocol>Remote Sensor Protocol</url>) - I'm really a newbee! But I'm learning...

By the way Ralf Hempel didn't answer yet, so I'm still awaiting impatiently for that Lua code  wink

Offline

 

#30 2011-04-07 14:23:17

abee
Scratcher
Registered: 2007-05-25
Posts: 100+

Re: WeDo - will it work?

djembii wrote:

I saw the NXT iBrick's firmware to be open source. But what's about the NXT sensors itself? They are using analogue or I2C. Or do you think touch_classroom connects to the NXT iBrick instead? Then it would not be a suitable solution for my kids...

Some of NXT sensor may be possible to use as WeDo sensor. But NXT architecture is very different from WeDo. (NXT is a standalone micro computer. WeDo is a slave unit of PC.) So we should consider NXT and WeDo separately, I think.

From link http://thenxtstep.blogspot.com/2009/01/wedo-sensors-and-nxt.html I've learned that the WeDo sensors are all analogue. So one way would be, to use a picoboard to read the values. But then I would need another hardware for all kids!

Thank you for nice information. I have analyzed WeDo's  PF motor for my device that using Arduino before. (I made this for an elementary school in Japan.)
http://scratch.mit.edu/forums/viewtopic.php?pid=299068#p299068
http://twitpic.com/1zj98k
But I have not done about sensors. This information may make possible to use WeDo sensors for PicoBoard or other devices and vice versa. However it requires some work, as you wrote.

So I search a little bit longer and I've found: http://news.lugnet.com/robotics/rcx/?n=2954:; Though I have no glue of LUA, I've requested the sources already - let's see.

Very interesting! It is good if we get the source code.

Offline

 

#31 2011-04-07 15:20:28

abee
Scratcher
Registered: 2007-05-25
Posts: 100+

Re: WeDo - will it work?

djembii wrote:

Found the Mesh protocol on the Wiki (<url=http://wiki.scratch.mit.edu/wiki/Remote_Sensors_Protocol>Remote Sensor Protocol</url>)

Yes, it is a description of remote sensor protocol. But you don't need to use this protocol directly because mesh wraps it.

I prepared new image that supports dual motors and mesh.
http://squeakland.jp/abee/tmp/controlingTwoMotorsWithMesh.zip

1. Extract and put it to both of server and client
2. Confirm connection same as the system diagram.
3. Start scratch on the both side.
4. Host mesh on the server by [Share] -> [Host Mesh] menu.
5. Note IP address that displayed on the server.
6. Join mesh on the client by [Share] -> [Join Mesh] menu.
7. Enter IP address of the server to the dialog.
8. If an error occurs, check network connection, firewall and router.
9. Open the project "TestProjectForServer" on the server.
10. Open the project "TestProjectForClient" on the client.
11. Click green flag on the both side and do something by using the sensors on the client.
12. The motors of the server will rotate by input of the sensors if test is success.

Last edited by abee (2011-05-02 21:27:59)

Offline

 

#32 2011-04-07 19:08:03

djembii
New Scratcher
Registered: 2011-03-25
Posts: 13

Re: WeDo - will it work?

Thanks a lot abee!! That rocks!!! The only hitch are the 2 stiffy cables to 2 different computers. But as the Wedo hub is closed with screw, I think I order some of these ultra thin usb extension cables and replace the original cable.

abee wrote:

http://twitpic.com/1zj98k

There I saw you using a kind of connection brick. Where do you got this from?

Offline

 

#33 2011-04-08 12:53:02

abee
Scratcher
Registered: 2007-05-25
Posts: 100+

Re: WeDo - will it work?

I'm glad to hear that.
I use PF extension cable (#8886, #8871).
http://www.nxt-roboter.de/main_bigware_29.php?cName=wedo
This cable has two connectors at both ends. So I cut it to get connectors.

Offline

 

#34 2011-04-08 16:32:53

djembii
New Scratcher
Registered: 2011-03-25
Posts: 13

Re: WeDo - will it work?

Good idea! So with one cable you get 2 picoboard connectors... Thanks!

Offline

 

#35 2011-09-25 08:24:24

vorburger
Scratcher
Registered: 2007-08-04
Posts: 2

Re: WeDo - will it work?

@abee, about "depends on WeDoPlugin. If I can modify that source code, it might be possible. Unfortunately ScratchPluginSrc1.4 does not include it" and "the source code of WeDoPlugin is not opened for public. I cannot do anything without it", would http://trac.assembla.com/scratchonlinux/browser/trunk/scratch/src/plugins/wedo/WeDoLinux.c help you?

Offline

 

#36 2011-09-26 04:27:55

abee
Scratcher
Registered: 2007-05-25
Posts: 100+

Re: WeDo - will it work?

Wow. Thank you!

Offline

 

#37 2011-10-29 10:31:21

vorburger
Scratcher
Registered: 2007-08-04
Posts: 2

Re: WeDo - will it work?

thank you abee for your controlingTwoMotors.zip; we've made a LEGO WeDo Robot Cleaning Car ;-) with it; see Video on http://www.scratch.mit.edu/ext/youtube/?v=LEXN7QMLf_8 and more on https://sites.google.com/site/michaelvorburger/wedo

Offline

 

#38 2011-11-07 22:35:38

abee
Scratcher
Registered: 2007-05-25
Posts: 100+

Re: WeDo - will it work?

Thank you for sharing the video! How cute the cleaning car! And the presentation by your kid is perfect!

Offline

 

#39 2012-08-02 20:31:12

phede
New Scratcher
Registered: 2012-08-02
Posts: 1

Re: WeDo - will it work?

Is it possible to connect two Wedo hub's with one sensor?  It imply connecton of the two hub's to each other, but will it result in damage of the hub's?

Offline

 

#40 2012-08-20 14:43:51

BoyKetchup
Scratcher
Registered: 2008-09-05
Posts: 8

Re: WeDo - will it work?

I am planing on buying a Wedo set, but I need to know something first:
Can you use more than one motor at a time,and if so, how many?

Offline

 

#41 2012-11-20 20:43:55

bantammenace
New Scratcher
Registered: 2012-11-03
Posts: 1

Re: WeDo - will it work?

@abee, Thanks for the controllingTwoMotors image. Do you have version for Linux ? If you do would you be able to share it and provide simple installation instructions ? I am a total noob to Linux, robotics and electronics.
I ask because I intend running Scratch on a Raspberry Pi attached to a tracked vehicle. This will be operated wirelessly via VNC or similar.
Initially I'll be using two WeDo motors but as I learn more I will want to interface via GPIO or an add-on board. Once I'm happy with that I'll want to look at encoders, cameras and other sensors.
Thanks in advance.

Offline

 

#42 2012-12-28 09:28:24

richaney
New Scratcher
Registered: 2012-12-28
Posts: 1

Re: WeDo - will it work?

bantammenace wrote:

@abee, Thanks for the controllingTwoMotors image. Do you have version for Linux ? If you do would you be able to share it and provide simple installation instructions ? I am a total noob to Linux, robotics and electronics.
I ask because I intend running Scratch on a Raspberry Pi [ ...]

Ditto!  I've managed to get hold of two WeDo kits, and have now found that the reference to "3 hubs" in the Lego spiel does not appear to equate to the RPi and Scratch.  I have downloaded the TwoMotors zip, thanks, and just about managed to crow-bar its contents into the /usr/share/scratch directory - but it does not appear to be that simple .. and beyond a newbie like me!

Either simple instructions on how to add the two motors functionalility to my RPi build, or confirmation that this ability will be added to an imminent Srcth Update, would be gratefully received!

Offline

 

#43 2012-12-30 06:47:47

abee
Scratcher
Registered: 2007-05-25
Posts: 100+

Re: WeDo - will it work?

richaney,
Thank you for your interest of my project.
I tested ControllingTwoMotors on my Rasperry Pi
(2012-09-18-wheezy-raspbian.img) and it worked fine.
Download the following file and extract it to any folder on your
Raspberry Pi. (e.g. /home/pi/)
http://squeakland.jp/abee/tmp/Controlli … i.image.gz
And copy /usr/bin/scratch to any folder with any name. (e.g.
/home/pi/controllingTwoMotors)
You need to modify this file as follows by any text editor.

before:
IMAGE="/usr/share/scratch/Scratch.image"

after:
IMAGE="/home/pi/ControllingTwoMotorsForRasPi.image"

Then open the terminal and execute the following command.

$ /home/pi/controllingTwoMotors

You can use two motors connected to WeDo as same as other platforms.
Please notice that Raspberry Pi can provide very limited current for
each USB port, 140 mA max. You might use self-powered USB hub with
WeDo.

I hope this helps you.

Offline

 

#44 2013-04-23 22:33:25

calphi
New Scratcher
Registered: 2013-04-23
Posts: 1

Re: WeDo - will it work?

when gf clicked
repeat until <(timer) > [10]>
  go to [mouse-pointer v]
end
think [Scripts in your posts!] for (3) secs

Offline

 

#45 2013-04-24 16:44:41

Muttley1
New Scratcher
Registered: 2013-04-20
Posts: 10

Re: WeDo - will it work?

Do I need wedo to connect lego to the pi or can I use the piface and just hack off the connecting ends of the wire?

Offline

 

Board footer