Go Down

Topic: Serial Proxy and Flash (Read 319 times) previous topic - next topic

lagarto

Aug 13, 2008, 03:14 am Last Edit: Aug 13, 2008, 03:16 am by lagarto Reason: 1
I, i need your help on this.

I have flash and arduido with serial proxy, but,

I send a command to arduido like ( ID + chr(13)), and i have to receive ( ID TH-F7 )

But the flash only receive the data send by arduido, when i sent another command to arduido.

I connect the hiper-terminal using TCP/IP (Winsock) with the IP and port number and disconnect the flash, and all working fine...
with hiper-terminal i send and receive all commands with no problem.

The code in flash,
system.useCodepage = true;

hms = "";
ip = "192.168.2.2";
porta = 5001;
lig.htmlText += "<b>"+hms+"--> Remote IP: </b>"+ip;
lig.htmlText += "<b>"+hms+"--> Porta</b>: "+porta;
invia.htmlText = "<b>"+hms+"-->Weelcome!!!</b><br>";

mySocket = new XMLSocket();
mySocket.connect(ip, porta);
mySocket.onConnect = function(success){
     if (success)lig.htmlText += "<b>"+hms+"-->Server connection established!</b>";
     else lig.htmlText += "<b>"+hms+"-->Server connection failed!</b>";      };

mySocket.onClose = function(){
     lig.htmlText += "<b>"+hms+"-->Server connection lost</b>"
     };

     XMLSocket.prototype.onData = function(msg) {
recebe.htmlText += msg;
};

//--- Handle button click --------------------------------------
function sendMsg(){      

     mySocket.send(inputMsg.text+ chr(13) );
     invia.htmlText += hmsm+" "+inputMsg.text;

     }

this.onData = function (data) {
           trace ("incomingg " + data);
           trace ("incoming " + data.text);
           inputer.text = inputer.text + data;
     };
     
envia.onRelease = function() {
sendMsg();
}

id.onRelease = function() {
mySocket.send("ID" + chr(13));
invia.htmlText += "IdentificaĆ§Ć£o";

}




I have all so tried with others serial proxys and the problem is the same.

The problem is in the flash, but were???

What i need is when i receive a chr(13) in the proxy, the proxy send me the data to flash.
I have all so read all docs and forums but dont find the error...



Tanks for the help!!!

Lagarto Oliveira from Portugal

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