Go Down

Topic: GPS parsing problem (Read 3 times) previous topic - next topic

gregcan

Thanks Paul,

I appreciate your efforts...  You are obviously seeing something that I'm not (not surprising 'coz I'm still trying to get my head around a new programming language and it's intricacies)...  I am trying to understand why the " is appended to readString, yet the , is not. Is the problem specifically related to the fact that the " character performs a certain function in C? (The language, not the char label I'm using)...  If so, is there a way around that or do I need to just accept it and work out how to remove the " from readString before storing it as Phone?

Cheers
Greg.

PaulS

No, there is no special significance to the " character. The issue is that you look at the character, and set Tag_Count to different values based on the number of times that you've seen the ". Regardless of the value in Tag_Count, you append the " to readString.

What I wanted you to look at was the if/if/else structure that should be an if/else if/else structure, to make sure that neither the " nor the , are added to readString.

gregcan

Hi Paul,

Thanks again!...  I see your point and have now tattooed across my forehead "ELSE MEANS EXACTLY WHAT IT SAYS... only if it doesn't meet ANY of the listed conditions!"  Can't believe I missed that but that's what complacency does I guess...

I'm sure it won't be my last lapse of concentration.

Cheers
Greg.

gregcan

Gents...

I can't begin to thank you for your help!  PaulS in particular... You are "Da Man"!!!  I got through all the issues I had except for a weird issue with the device crashing at random. I immediately assumed I was running low / out of RAM but disproved that theory with some debugging code and MemoryFree (available RAM never dropped below 1K and just to be sure I ran the sketch on a Mega 2560 with 4 times the RAM of the NANO)...

Next I started doubting my code but the results were too random for that to make sense...

Finally, I decided to do some homework on memory fragmentation...  Guess what... My "String Heavy" application was creating MANY short , empty strings amongst the actual required long strings each of which chewed up 16 Bytes of heap space!... Yep... big problem!

In my search for a solution I came across a post pointing to a previous solution from 1 Paul (last name beginning with "S") leading to a "re-hashed" (and may I say very well de-bugged) version of the WSTRING core library!... 

Implementing this version IMMEDIATELY and COMPLETELY eliminated my problem.  I literally cannot make my code crash no matter how  try! 

Paul, I'd be more than happy to buy your "Teeny boards" if you can point me to a reliable supply line here in Australia...  If this is not a possibility you have my absolute thanks and gratitude for all your work and assistance, and I think the Arduino Team really need to take a fresh look at your solution...

Cheers
Greg.

Go Up