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

#1 2012-07-21 17:18:37

maddigger00009
New Scratcher
Registered: 2012-07-21
Posts: 1

php for the Remote Sensors Protocol

is it posable to use php to communicate with scratch?
if so how do you i have tryed some socket stuf but i ant good at that sort of stuff.

Offline

 

#2 2012-07-22 04:31:25

Maki-Tak
Scratcher
Registered: 2008-03-10
Posts: 100+

Re: php for the Remote Sensors Protocol

I don't think that's possible.
You could check out this thread here though: http://scratch.mit.edu/forums/viewtopic.php?id=99438

Last edited by Maki-Tak (2012-07-22 04:33:39)


http://i.cubeupload.com/zZE0XJ.png

Offline

 

#3 2012-07-22 04:34:32

SciTecCf
Scratcher
Registered: 2011-11-23
Posts: 1000+

Re: php for the Remote Sensors Protocol

This doesn't really go here, as this is for Scratch scripts, not PHP -- requesting to be moved to Advanced Topics.  smile

Now I really wish I was a mod, then I could actually move it  neutral


http://bit.ly/LCZEJRhttp://bit.ly/LSONcOhttp://bit.ly/LF3vIc
http://trinary.site40.net/images/scratchrank.php?username=SciTecCf&display=small

Offline

 

#4 2012-07-22 05:09:24

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: php for the Remote Sensors Protocol

Hmm... don't take my word for it, but I think it's remotely possible...

Not directly using PHP of course, because the language doesn't support ports and sockets. And it goes without saying that the PHP has to be running on your server, or a server that is configured to allow PHP to access other programs on the disk and get/send values from/to it.

However, if you set up PHP to communicate with a Python or C program (or any other language that can use the socket), you could theoretically then have a page that allows GET parameters to access Scratch!

Wonderful but extremely hard if you ask me  big_smile

Offline

 

#5 2012-07-22 06:59:14

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: php for the Remote Sensors Protocol

PHP supports sockets, so yes.


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#6 2012-07-22 08:40:30

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: php for the Remote Sensors Protocol

You can run PHP standalone (without a web server); and it appears to support sockets, as bobbybee points out.

If you're trying to run a Mesh server off PHP hosting; bear in mind this probably isn't possible, as you can't usually have long running processes. Running it standalone on your computer or a VPS should be fine; I don't know how tricky it is to set up.

You'll need to implement the Remote Sensors Protocol yourself. Try having a look at some of the example programs, for example the Python one, and seeing if you can port the code to PHP. Ask here if you get stuck  smile


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

Board footer