I went to check my system and found that it had stopped. Checking the logcat I found that it was closed by Android because of an excessive wake lock issue.
This is a permanently powered embedded device and I need the application to be always running and never closed by the OS.
I added the wakelock as I found that when it switched to battery power it stopped the app before the battery reached the limit of 50% that I was monitoring for.
Should I run without wakelock when on external power and only set the wakelock when the system switches to battery? I've found that it seems to keep running as long as I don't have the wakelock. The screen powers down after a few minutes but I can see that the serial communications and uploading to the server is still running and touching the LCD brings the display back on.
Is there a way around this wakelock issue or is the above the best solution?