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
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.
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
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
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
Offline
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
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
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
@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
vorburger wrote:
would http://trac.assembla.com/scratchonlinux … eDoLinux.c help you?
Wow. Thank you!
Offline
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
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
@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
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
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