Header for a Data Stream ( TCP/IP)

Refer the data stream that is put out by a Serial- WiFi device server. The Serial data is generated by a UNO and its Serial Output is connected to the WiFi module. I can then view this on a Chrome browser as a data stream.

But when i try the same thing on a iPhone the Safari browser seems not to like the idea and simply times out.

Of course i am simply putting out the data stream with no header and maybe the Safari thinks its not worth it time to bother with this.

can anyone point the right way to structure each row of data so that i can view it on any browser ??

The Safari browser is probably trying to render HTML. Is your datastream HTML? Even if it is, the browser may wait for the closing tag to render the page.

Posting your complete code would also help understand the problem.

Here is the full code... actually its nothing but a Serial.print(). The variable defines and module startups take more code !! ( Of course this does not contain standard functions for reading the RTC , clock Edit and such which don't take part in sending the data to the WiFi Node)

  */ Using the XPico interface :
  USAGE :
    For using Telnet : Open CMD interface. Type telnet 192.168.1.150 10001 for WLAN  [0r] telnet 192.168.0.1 10001 for direct. Data should come in..
    For linking serial from Arduino to x-pico, the jumpers of JP3 and JP5 should be on 2-3. ( The one near board edge is 1)

  27 Aug 2016 : Fully Checked by sending the formatted data to Static IP at home ands vieing on a browser.


  ###############################################
*/
//=================== INCLUDE ====================

// Include Libraries :
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#include "Wire.h"
#include <phi_interfaces.h>
#include "RunningAverage.h"

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
//================== DEFINES ======================
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

// Define the LCD pins to use and Initialize an instance
LiquidCrystal_I2C  lcd(0x27, 2, 1, 0, 4, 5, 6, 7);        // [C] 0x27 is the I2C bus address

// Define the Machine Digital Inputs and Outputs
#define StartPB 2                                          // [C]
#define IncrPB 3                                           // [C]
#define DecrPB 4                                           // [C]
#define EnterPB 5                                          // [C]
#define total_buttons 4
char mapDIN[] = {'S', 'I', 'D', 'E'};                      // [C] This is a list of names for each button.
byte pinDIN[] = { StartPB, IncrPB, DecrPB, EnterPB};       // [C] The digital pins connected to the 4 buttons.
phi_button_groups MyDIN(mapDIN, pinDIN, total_buttons);
multiple_button_input* pad1 = &MyDIN;

// List all global variables....
long interval;
int ledState           = 0;
int heartBeat          = 13;
int RA_SampleSize      = 5;
const int Sens00       = 0;                 // Analog pins to use
const int Sens01       = 1;
const int Sens02       = 2;
const int Sens03       = 3;
unsigned int Val_00    = 0;                 // Variable to hold raw AI data
unsigned int Val_01    = 0;
unsigned int Val_02    = 0;
unsigned int Val_03    = 0;
unsigned long BaudRate = 9600;
unsigned int loopDelay = 1000;
boolean tunnelFlag = 0;
char receivedChar;
boolean newData = false;

RunningAverage RA_Ch00(RA_SampleSize);
RunningAverage RA_Ch01(RA_SampleSize);
RunningAverage RA_Ch02(RA_SampleSize);
RunningAverage RA_Ch03(RA_SampleSize);

char LCDmsg[35];
char ValidDIN = '0';
byte second, minute, hour, dayOfWeek, dayOfMonth, month, year;
char tempchar[5];
char Yr_Array[5];
char Mo_Array[5];
char Dt_Array[5];
char Hr_Array[5];
char Mi_Array[5];
char CurLoc, NCurLoc;
boolean RTC_Set_Gate = 0, RTC_Set_Gate01 = 1, RTC_Set_Gate02 = 0, HomeDisp_Gate = 1;

// Define Gate Flags to block segments by choice.
boolean RTC_Disp_Gate = HIGH;

void setDS3231time(byte second, byte minute, byte hour, byte dayOfWeek, byte
                   dayOfMonth, byte month, byte year);

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
//================= SETUP =========================
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
void setup()
{
  // START SERIAL FOR DEBUGGING
  Serial.begin(9600);
  // Usage : Serial.println(variable);

  // START THE I2C INTERFACE
#define DS3231_I2C_ADDRESS 0x68             // [C] 0x68 is the RTC address
  Wire.begin();
  Wire.beginTransmission(DS3231_I2C_ADDRESS);
  Wire.write(0xE);                            // Address the Control Register
  Wire.write(0x00);                           // Write 0x0 to control Register
  Wire.endTransmission();
  Wire.beginTransmission(DS3231_I2C_ADDRESS);
  Wire.write(0xF);                            // Address the Status register
  Wire.write(0x00);                           // Write 0x0 to Status Register
  Wire.endTransmission();                     // Both above writes solved the problem of clock stopping on Battery power

  RA_Ch00.clear();
  RA_Ch01.clear();
  RA_Ch02.clear();
  RA_Ch03.clear();

  // START THE LCD INTERFACE

  lcd.begin(16, 2);
  lcd.setBacklightPin(3, POSITIVE);
  lcd.setBacklight(HIGH);
  lcd.clear();
  lcd.write( "  XPICO SERVER  " );
  lcd.setCursor(0, 1);
  lcd.write( " Version : 1.00 " );
  delay (2000);

  pinMode( heartBeat, OUTPUT);

  //setDS3231time(0, 27 , 15, 4, 7, 9, 16); // Uncomment to set clock and enter correct time: sec,min,hour,day,date,month,year
}

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
//================ SCAN LOOP ======================
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

void loop()
{
  // ENDLESS LOOP EXECUTION STARTS HERE:

  // Read the Push buttons  for every scan..
  ValidDIN = MyDIN.getKey();

  if ( ValidDIN == 'S') {                         // Press the Start to enter Clock Set mode
    RTC_Set_Gate = 1;
    HomeDisp_Gate = 0;
  }

  if (HomeDisp_Gate) displayHome();               // Upddate the Home Screen with date time once every second

  if (RTC_Set_Gate) Set_TimeOfRTC3231();

  Blink();

  // recvOneChar();
  // processNewData();

  tunnelFlag = 1;                       // Start command bypassed..

  if (tunnelFlag)
  {
    Serial.print(" SIGMA RIG ");
    Serial.print('|');
    ReadTime();
    Serial.print( year );
    Serial.print(':');
    Serial.print( month );
    Serial.print(':');
    Serial.print( dayOfMonth );
    Serial.print('|');
    Serial.print( hour );
    Serial.print(':');
    Serial.print( minute );
    Serial.print(':');
    Serial.print( second );
    Serial.print('|');
    Serial.print("Sigma Rig Status : Normal. No alarms ");
    Serial.print('|');
    Serial.print("Active Test schedule : JCB Main pump ");
    Serial.print('|');
    Val_00 = analogRead(Sens00);
    Val_01 = analogRead(Sens01);
    Val_02 = analogRead(Sens02);
    Val_03 = analogRead(Sens03);
    RA_Ch00.addValue(Val_00);
    RA_Ch01.addValue(Val_01);
    RA_Ch02.addValue(Val_02);
    RA_Ch03.addValue(Val_03);
    Serial.print(RA_Ch00.getAverage(), 2);
    Serial.print('|');
    Serial.print(RA_Ch01.getAverage(), 2);
    Serial.print('|');
    Serial.print(RA_Ch02.getAverage(), 2);
    Serial.print('|');
    Serial.print(RA_Ch03.getAverage(), 2);
    Serial.println('|');
  }

  delay (loopDelay);
}// End of main loop.

Well, using telnet is a totally different thing to HTTP. Telnet is just the equivalent of the Serial Monitor for TCP/IP instead of COM ports.

Putty is an example of a telnet client. Is there a version of Putty available for the iPhone? Or any telnet equivalent?

Oh... looks like the comments has confused. Telnet is just to check if the code is working as required.

In the final deployment I need to be able to view the data ONLY in a browser or a iPhone App that is designed to receive this data string, parse it and display the values suitably.

Well then you need to accept HTTP requests and emit HTML pages. This is usually called a "web server". I'm sure there's an example for the wifi module which shows this.

Making live data update within a web page is a slightly more complex problem. But there's a zillion examples online if you search for the right terms.