Background information: I have an RPI3 running headless that is set up to monitor the temperature in an aquarium. If the temperature goes out of range the heater is either turned on or off. the code is written in Python and it checks the temperature every 30 seconds and adjusts as needed. Each time it reads the temperature it also records the results in a text file.
The problem I am having is that after running without any problems for around three weeks, it will no longer accept any remote connections. I have tried VNC and SSH (putty) without success. In the past I just reloaded the SD card and started back up again, but this doesn't seem like a good long term solution.
I have checked that the pi is still on the network both wireless and with LAN and I have also been able to ping the pi without any errors.
The RPi3 has a 16 GB SD card so there shouldn't be any issue with space availability. Any suggestions of how to fix this?