kevinabrandon / AboveTustin

ADS-B Twitter Bot. Uses dump1090-mutability to track airplanes and then tweets whenever an airplane flies overhead.
MIT License
72 stars 21 forks source link

Screenshot eventually fails and never comes back #17

Closed kevinabrandon closed 6 years ago

kevinabrandon commented 6 years ago

Now that the general reliability of the script has been improved, I've found that eventually the internal browser will fail and the screenshots will stop working. Currently there's nothing inside the script to attempt to reload the browser if it ever goes away.

kevinabrandon commented 6 years ago

While searching through log messages I found that on the last tweet before the screenshots went away there was an exception in screenshot(): <class 'http.client.BadStatusLine'> . After that one there was an exception in clickOnAirplane(): <class 'urllib.error.URLError'> . I'm currently catching these errors specifically and will try to reload the browser when they're caught. I'm running that now and waiting to see if that works. If it does then I'll go ahead and push those changes and close this issue.

kevinabrandon commented 6 years ago

I think I start getting these messages when the raspberry pi runs out of memory. I've been looking at my performance graphs and I can see there is some kind of memory leak going out of control... still investigating.

kevinabrandon commented 6 years ago

Definitely a memory leak. I'm having success by periodically quitting and restarting the browser once an hour: You can see the memory usage creeping up, and then on the hour it drops down, creating the sawtooth effect. I'll be pushing this code very soon.