GPS string transmission via radiometrix - buffer problem??

Hi,

The Radiometrix string looks like this: "000000,100#v,999tl<hheIRd$Irrrerrrrr%rrrerrrrr -----" (correct transmission shown in red text).

I suspect that the jumble of text that follows the correct transmission has its roots in a buffer problem, but I don't know enough to test this by modifying the programme.

The programme and hardware can produce a coherent serial print string - the difficulty seems to be getting the whole string through the radiometrix transmitter to the receiver (DI-fldigi).

Any suggestions would be welcomed.

Colin.

Have you tried reformatting your hard drive?

but I don't know enough to test this by modifying the programme.

Or even to read the posts at the top of the forum that say "Read me before posting". It's clear that you didn't because, if you had, you'd know that you needed to post you f**king code.

Hi PaulS,

Thanks for the rebuke, well deserved!

I didn't include the code because I thought, quite wrongly, that maybe I had given enough to prompt a general steer - which I suppose you did.

I am using a Arduino Uno with a Radiometrix NTX2B-FA, 434.30. The Radiometrix circuit uses 2x4k4 and one 47k resistors to get the necessary RTTY shift. As I said earlier, the transmission gets through, but only for a short section of useful text followed by gibberish.

However, this time I have attached the programme (GPS_Radiometrix1.txt).

Please accept my apologies for causing annoyance, and again, thanks for your very direct and chastening response.

Colin.

GPS_Radiometrix1.txt (9.07 KB)

void getGPS(){

  Serial.flush();

So, first thing we do is wait for any pending data to be sent. Why? Are you sending data TO the GPS?

  int i = 0;
  unsigned long start = millis();

  while ((i<60) && ((millis() - start) < 2000) ) 
  {
    if (Serial.available()) {
      char c = Serial.read();
      tgps.encode(c);
    }
  }

Since you have hardcoded i to 0, is there any point in testing it in the while statement?

Listening for data for two seconds, when GPSs typically send data once per second seems pointless. Ignoring whether the encode() method returned true or false is also silly.

  Serial.flush();////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Even though you haven't sent anything since the last wait-for-everything-to-be-sent call, lets wait again. Why?

void loop()
{
  //get new gps data
  getGPS();
  delay(100);
}

Where do you actually use the radio to send anything?

    sprintf(txstring, "%s*%04X\n",txstring,gps_CRC16_checksum(txstring));

There's a good way to corrupt data. The buffer you are writing to can NOT be the buffer you are reading from!

Thank you PaulS,

Much appreciated. I am new at this and a bit slow for the moment, but I will work on your advice and see how it goes.

Regards,

Colin.