Step 8: Testing

We're ready so lets start testing.
Open a terminal window and if you have installed MAMP in the default location type:

/Applications/MAMP/bin/php5/bin/php /Applications/MAMP/htdocs/Candygrabber/socketShell.php

it should say something like:

1 socket bound to
1 listening...

Start the NO-IP.ORG dynamic updater. Plug the USB cable connected to arduino into the computer and then open Tinker Proxy. Select your network port number(should be 5333), the serial port and the speed(set it to 9600), and then click "Start".
If everything went ok start your AIR app.
If the AIR app establish all three connections you're done. Now you can launch your favorite browser and browse to the Client flash file. In my case it is www.pimedius.com/Candygrabber/ as I'm hosting it online.
<p>Ah Arduino projects are so fun! </p><p>And Arduino is cheap now...</p><p>https://sites.google.com/site/arduinouk/</p>
Hey odvratno.zgodan. I wanted to say: hvala ti za dokumentaciju tog projekta! A great tutorial but do you know if there is a way to realize it with a eg. RaspberryPi instead of a full fledged computer? Do you have some tips which way would be best to get it working with a raspberrypi? So I could use html/php and the GPIO Ports from the Raspberry and a Webcam to get the stream out? I think I do not need any Flash or Red5!?<br> <br> Hvala i pozdrav!
<strong>Oh WOW!</strong> <em>This is exceptional.</em><br> Did I miss where to buy commercial coin slot mechanisms to make this a money maker?
Oh my gosh. That is awesome!
G8 Work
Hi!<br><br>Thanks for awesome and detailed tutorial. <br><br>I think i'm already finished, but smth is not working:<br><br>http://clip2net.com/s/1xb7j<br><br>i'm trying to run everything on Windows 7, Adobe Air app shows each status: Connected. <br><br>But not on client side.<br><br>This screen from server (on wich Air app is running and arduino connected) http://clip2net.com/s/1xb7j<br><br>From screen you see that i'm receiving some errors in command promt:<br>&quot;Notice: Undefined index: queuePosition in socketShell.php on line 214&quot;<br><br>This message i get when i run client.swf on other machine. RED5 - connected, Shared obejct: connected, SocketConnection - nothing.<br><br>Please take a look on a screen below https://skitch.com/neskin/gh3aa/client<br><br>Thanks in advance!
It seems that the PHP socket isn't working properly. As a result the Shared object isn't going to work properly. It's because the PHP socket works as a queue and tells which client to connect to the AIR app. There could be a few causes and ways to debug the app:<br>1. I'm not sure which server you installed. On my mac I installed MAMP but I had to enable socket connections. I'm not sure anymore how to do it but you can google it.<br>2. Do you have a video feed in the AIR app and client? The Red5 connection should handle the video. The video is captured with the AIR app --&gt; sent to the Red5 server --&gt; Client <br>3. If the sliders don't work it is probably cause the socket connection doesn't work. Remember that the socket connection handles the clients queue. So if it doesn't work your sliders won't work.<br>4. I checked the PHP code at line 236. Not sure why the error occurred here. I use a low tech solution to debug my code. On the beginning of every IF statement put ECHO &quot;something&quot; and replace the text &quot;something&quot; with different text so when you run the code you can find out at which line exactly the error occurred.<br>5. Where do you host the socket connection? Locally? Did you put the cross-domain policy files in the root folder of your php server?<br><br>To summarize, to me it seems that the error is located somewhere in the SocketConnection.php . I'm not sure where and why as this is the same file that I used for the project and it worked for me. If you'll have anymore questions do not hesitate to contact me. Also I would love to see you project, so if it's possible send me a link or pic.<br><br>Good luck,<br>Bye
hi there,<br>I'm testing this project out locally on MAMP, all status's are read 'connected' . the video streaming works, the arduino connection works. however i keep getting this area, <br><br>Error: Error #2134: Cannot create SharedObject.<br> at flash.net::SharedObject$/getRemote()<br> at com.Red5Link::Red5SharedObject/startSharedObject()[/Users/camoconnell/Documents/folder/Source/com/Red5Link/Red5SharedObject.as:140]<br><br>which means the client sliders aren't working. Have you experienced this problem with remote SharedObjects?<br><br>in the air app i call;<br> xmlSocketAppController.sharedObject=new Array(&quot;rtmp://camoconnell.local&quot;,&quot;motors&quot;,sharedStatusTxt);<br><br>and the client;<br> xmlSocketController.sharedObject=new Array(&quot;rtmp://camoconnell.local&quot;,&quot;motors&quot;,sharedStatusTxt);<br><br>thanks cam
Hi,<br>I haven't had this error before. It seems by the error message that the error is located in the in the class Red5Link. Do the sliders in the client document work or are they unresponsive in both the client and AIR app? In which document the error occurs?<br>If you don't find the bug in the class, could you send a url where I can check your progress? When I get home from work I'll take a closer look.<br><br>Bye
Thanks for your reply,<br><br>Correct, <br>the error is located in the class Red5SharedObject.as on the line where getRemote() method is being called. I get it when i run the ArduinoAir.swf.<br><br>sharedObject=SharedObject.getRemote(sharedObjectUrl,netConnection.uri,false);<br><br>The client sliders are moving but they have no effect on the AIR app sliders. I guess its because the sharedObject aren't being shared.. <br><br>I wonder if it has anything to do with where the files are housed in the directories. the socketShell.php is running on my local MAMP server;<br>http://camoconnell.local/socketShell.php<br><br>the Client.swf is running on my local red5 server;<br>http://camoconnell.local:5080/arduino/Client.html<br><br>and the air app is being published to local folder, not on any local server.<br><br>im testing it locally on MAMP &amp; Red5 servers, are you able to view it remotely?<br><br>thanks again,<br>Cam<br>
Hi,<br>I can't view it remotely. You could set up no-ip.org and then I could view it.<br>When I tested my files the Client.swf was located on my MAMP server not Red5. Try that. <br>Could you post the whole code for the Client.swf? Have you changed it any way from what you have downloaded from the instructable?
Really cool! I could see lots of uses for this. Are there any free online servers, so you wouldn't have to pay $30 for the hosting plan?<br><br>P.S. I got one of the black things with a star on the end. :)
hey odvratno, amazing project! bravo <br><br>I found a portal site which rates free hosting;<br>http://www.free-webhosts.com/reviews/<br>however no red5<br><br>I'm already paying monthly for reseller hosting, &amp; my hosting provider won't upload red5 citing potential load issues.<br><br>if anyone has a solution pls post it!! i had thought of maybe ustream or skype API as a long shot instead.<br><br>- if needed, how would i install red5 locally? for use with MAMP. and Would other computers sharing the same WLAN be able to connect?<br><br>thanks,<br>Cam<br>
I couldn't find any free hosting plans with red5. You can install it on your computer though. If you find any free hosting please let me know.
never seen this on the newsletter!, definitely worth to be mentioned <br><br>LOVE it :)
Uh, why can't I get my prize?
Cool! Will vote.
This and the Portal turret are my favorite i'ables EVER!!!
im using the arduino uno and the code knob to turn a servo it works fine im gessing
This is really cool! Are you going to fix the grabber motor or are you going to leave it as it is? Really cool instructable though.
Hi, I'm glad that you like it. I already tried to fix the grabber but the gears already wore out so they slip and get stuck. The only thing that I can do is jank it out. Sorry :(<br>I'm thinking of scaling up the project. Of course the makerbot could help me a lot :)
Cool. I&rsquo;ll vote for you
I played it a ton! this is so much fun, i tried to get all of the canisters, but the thing that you drop it into was overflowing with them. 5*
I actually own one of these candy grabbers. I got it awhile back and have not done anything with it. What a great idea!
Awesome, I played while u was smoking :-D
<em>Oooohh,</em> <u><strong>THE CLAW!</strong></u>
Hi odvranto, <br><br>cool project! For a simple and scalable way to push data directly to an Intenret-connected Arduino you might want to check our project http://yaler.org/ and http://www.instructables.com/id/Arduino-Web-LED/<br><br>Cheers,<br>tamberg
Wow! Thats so cool and so simple to use. But I couldn't have integrated a queue in it(though I'm not shure), and the video streaming through justin.tv is delayed a few seconds. Using flash and red5 I get a resonable delay on the video and controls, so I opted for it because I'm Flash developer and was curious of red5.<br>That said, if I saw this instructable before I would have probably given up from my aproach.<br><br>Thanks for pointing it out to me,<br>Bye
Hi odvratno,<br><br>Yes, the video streaming lags. It's hosted on a PC completely separate from the Arduino and not relayed through the Yaler relay infrastructure.<br><br>Queuing of messages would have to be done on the Arduino (or your PC, depending on the setup). The relay infrastructure itself does not have any state and just forwards the HTTP request/response back and forth.<br><br>Cheers,<br>tamberg
Yiiieeehhaaaaa! <br>I Got one of the white thingies:-D How will I receive my price?<br>Just kidding;-)<br><br>Really impressive Work, and a very detailed Instructable! Thumbs up!

About This Instructable


221 favorites


More by odvratno.zgodan: Arduino Candygrabber
Add instructable to: