Go Down

Topic: Thinker Proxy + flash broken data (Read 1 time) previous topic - next topic

Geek Ionizado

I'm using thinker proxy to interface arduino-to-flash but I'm receiving LOST/Broken data.

My arduino is outputing: "1000000000000000"

and the flash receives:

"100
0000000000000"

or

"1
000000
0000
00000"

What's the problem??

Please help me  =( =(

dxw00d

Quote
I'm using thinker proxy


You're using what? Is there a link to that?

Geek Ionizado

It's a socket-to-serial for using arduino with flash:

http://code.google.com/p/tinkerit/wiki/TinkerProxy

Please help me :(

dxw00d

Where's your code? Are we supposed to guess what you have running?

Geek Ionizado

//import flash.errors.*;
At flash:

import flash.events.*;
import flash.net.Socket;
var serial:String;
//Create a socket connection to the deafult tinkerProxy port
var arduinoSocket:Socket = new Socket("localhost",5334);
arduinoSocket.addEventListener(ProgressEvent.SOCKET_DATA, socketDataHandler);

function readResponse():void
{
   serial = arduinoSocket.readUTFBytes(arduinoSocket.bytesAvailable);
   touch(serial);
}

function socketDataHandler(event:ProgressEvent):void
{
   readResponse();
}


and at arduino is a simple
println("1000000000000000")
   trace(serial);
}

PaulS

Quote
and at arduino is a simple
println("1000000000000000")
   trace(serial);
}

No, that is not the code on the Arduino. Try again.

Then, you need to understand how serial data transmission works. The data is sent one byte at a time. Slowly.

Your PC app reads all the serial data that has arrived, and assumes that that is a complete packet. It is not. When you consider ways to delimit the packets being sent, and read and store data until a complete packet arrives, your problems will be solved.

How to do that only comes up about 3 times a week on the forum, so it might take you a few seconds to find some solutions.

Indyaner


How to do that only comes up about 3 times a week on the forum, so it might take you a few seconds to find some solutions.


Please dont do this. At least give a hint or a example link. I know how you hate repeating yourself, of course. Me too. But here are reading also non-native english speaker like me and I had a hard time finding a thread like this that has the same problem like me, and now I'm again stuck, as I dont know what I have to search for in the forum. This thread describes my problem and you just end it with a blind alley.

Can you please give me a pointer or terms I can use to find those 3-times-a-week-threads?  :~


Greetings from Germany

PaulS

There are several people who have undertaken to post details about how to read serial data. I post quite regularly. Nick has put up a web site with details: http://www.gammon.com.au/forum/?id=11425. Here's another one: http://jhaskellsblog.blogspot.com/2011/05/serial-comm-fundamentals-on-arduino.html

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy