Hi all,
I am playing with a rocket scream TraLog v2 trying to develop a simple tracking device (for the sheer hell of it) and I've got it working (yay!)
But, only for about 30mins, and after that it stops sending data, the LEDs etc on the sheild itself suggest it's still running, so I am wondering if maybe its overheating (plugged into a 12v DC adapter) or running out of memory.
SurferTim:
My #1 rule: Check power first. Have you run it using usb power? Or maybe a 9v wall wart rather than 12v?
the sheild wont run off USB power and dont have a 9v handy, but im hoping its memory rather than a power issue as i want to run it from a 12v circuit on my motorbike to log in realtime the roads ive travelled (I want to turn europe red!)
Then check the SRAM memory. Add this function to your code.
int freeRam() {
extern int __heap_start,*__brkval;
int v;
return (int)&v - (__brkval == 0 ? (int)&__heap_start : (int) __brkval);
}
// call like this where you want to check available memory remaining.
Serial.print(F("SRAM left: "));
Serial.println(freeRam());
thanks thats running now, will take a little while to give you results as it doesnt try and do anything until it has a GPS lock and I haven't put a battery on the board yet for hot start GPS
// Software serial for the GPS
SoftwareSerial ss(gpsRxPin, gpsTxPin);
// WISMO228 class
SoftwareSerial gsm(gsmRxPin, gsmTxPin);
You know that only one of these can be listening at a time, right?
Why is the instance connected to the gps pins called ss? The one connected to the gsm pins has a reasonable name.
ss.begin(9600);
// Parse GPS data for 2 second
for (unsigned long start = millis(); millis() - start < 2000;) {
while (ss.available()) {
char c = ss.read();
// New valid NMEA data available
if (gps.encode(c)) {
newGpsData = true;
}
}
}
ss.end();
Wrong, for several reasons. One, you should not be starting and stopping the SoftwareSerial instance. You should use listen(), instead. Second, diddling around waiting for GPS data for two seconds is not a good idea. Since a GPS typically sends data once per second, you'll miss half the data. Third, when the end of a sentence IS received, you should break out of the loops.
I think you should get rid of the for loop, and add a break; statement to the if block.
strcat(data, coordinate);
// Terminate the string
strcat(data, "\0");
strcat() appends a NULL. There is no reason for you to add another one.
all fair and valid points
ss was used in the example i have modified, i plan on refactoring alot of the code at some point
the WISMO228 is the library used to control the GSM part of the TraLog shield
as for the loop, ok, ill look into that - thanks
the start stop, was provided by RocketSCream who produce the board, I will look into the SoftwareSerial library in more detail and see how to implement listen in reference to my sketch
You should notice right away if you have a memory leak. The available SRAM will slowly decrease, then when below about 150 bytes remaining, it might freeze or do weird things. When it does run out and doesn't freeze, it will report a very large or negative amount of SRAM.
the thing i really dont get though is....
one time i can be running it and get 57 points from it, another time only 6 (it appears to of stopped on 6 this time round) there seems to be no rhyme or reason to it
however according to the SerialMonitor it is still working fine and dandy
If the Arduino is still running, then it sounds like a problem with the WISMO228 library or the provider.
#include <WISMO228.h>
If you are powering only the Uno with the onboard regulator, there should not be a problem with overheating. If you have any other devices connected to the Arduino +5v pin/bus, then that is a possibility.
Almost all regulators have a thermal shutdown now.