Pages: 1 [2]   Go Down
Author Topic: serial output corruption with ethernet arduino  (Read 840 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for the info. I'll look ASAP
Logged

0
Offline Offline
Tesla Member
***
Karma: 145
Posts: 9637
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just what are you trying to do? Are you sending a get request to a server and trying to capture data from what is sent from the server?
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sending the GET command to the head unit. Then relay data to remote server. That server remotely displays data on a portal. But this code just sends GET then converts to the string output to relay it to the remote server.
« Last Edit: January 04, 2013, 01:51:25 pm by drewpalmer04 » Logged

0
Offline Offline
Tesla Member
***
Karma: 145
Posts: 9637
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
But this code just sends GET then converts to the string output to relay it to the remote server.

If you are trying to pass a lot of html churn, then you might consider saving all the html text to an SD card, then sending the captured material from the SD card to the remote server.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well it's not my server. I'm just trying to send the string to the server to display my data but the string gets corrupted at the end as seen in my above example
Logged

0
Offline Offline
Tesla Member
***
Karma: 145
Posts: 9637
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

just how big is the string?
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

<RA><T1>804</T1><T2>698</T2><T3>773</T3><PH>862</PH><R>248</R><RON>0</RON><ROFF>255</ROFF><ATOLOW>0</ATOLOW><ATOHIGH>0</ATOHIGH><EM>0</EM><REM>0</REM><PWMA>84</PWMA><PWMD>76</PWMD></RA>


This is the entire string...it repeats over and over and changes the values depending on what the serial receives from the headunit for values. IE:<T1>804</T1> can be the temperature reading that can change to 805 709 etc etc.
Logged

0
Offline Offline
Tesla Member
***
Karma: 145
Posts: 9637
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You may need to check the http specs for query_string length limits. Might be something like 128 characters. longer than the limit you might need to use a post method.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You said that you have a sketch that just reads the serial data. So, after reading up the \n, how many characters are in the array? The readBytesUntil() method NULL terminates the array, so strlen() will tell you the length.


I'm sorry  but I can't get this function to work...could you lay it out in my code for me? So I can get an answer for you...Sorry I'm a noob
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 617
Posts: 49463
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I'm sorry  but I can't get this function to work...could you lay it out in my code for me? So I can get an answer for you...Sorry I'm a noob
Code:
      int b=Serial.readBytesUntil('\n',strout,sizeof(strout));
   int len = strlen(strout);

Of course, you could just print the value in b, instead. It should contain the same value as len.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

issue resolved...thank you for everyone's help.
Logged

Pages: 1 [2]   Go Up
Jump to: