Python Code on Raspberry Pi Stops after several hours but used to run for months

422 Views Asked by At

As the title says it is a Python script which used to run for weeks/months at a time but now suddenly stops working after several hours. There is no error message. There are no other indications that something went wrong. The script is programmed to print all its actions and a timestamp every 10 minutes. At some point no more time stamps and or actions are printed to the screen. This has occured multiple times now.

I think it is not the script because: *The script itself has not been changed in between *The script still runs for several hours and 1 loop including pause is ~3 seconds (>>1000 ok loops) *A week ago the exact same script could still run 'indefinitely'

The script is used for crypto trading according to a fixed set of simple rules and interfaces with Bitvavo

All help and suggestions are appriciated! If you need more information, please let me know!

Facts: Raspberry Pi 2 Model B Rev 1.1 The script runs in a Geany Shell or Idle3 (both have shown the issue)

Suspects & Actions taken: *Full updates of the system (apt-get full-upgrade) (apt-get dist-upgrade) --> Problem not solved *Can the problem be caused by one of the updates?

*SD card corrupted --> speed tested and NOK --> New SD card with a fresh install of Rasbian --> Problem not solved

*Raspberry Pi not ok? It has been running for around 14 months for 24/7. Although it is quite old it was only used occasionally before that. Other than the script stopping there are no obvious signals for it being not ok.

*Other suggestions?

1

There are 1 best solutions below

0
Johan On

Running the code directly from the terminal instead of the IDE has proven itself stable for the last couple of days. 100 stable hours is a significant improvement from ~4 hours, so I assume that the code is running stable like it used to do. Thanks!