dokeeffe / cloud-rain-monitor

Device to measure sky conditions (rain and cloud) for an astronomical observatory
16 stars 3 forks source link

weatherMicroService.py no longer responding after a while #2

Closed Trigger-broom-289 closed 6 years ago

Trigger-broom-289 commented 7 years ago

Would you have any idea why after a while running (let's say an hour or so), it is no longer responding to curl requests? I have to restart the weatherMicroService.py script

dokeeffe commented 7 years ago

Yes!! I see the same behavior except it usually takes about 1 or 2 days. It started happening when I added the matplotlib plots. Are you calling the API to generate the plots? I'm thinking of removing the plots. I cant seem to see whats wrong with it. Can you see anything strange happineing like memory or CPU usage spiking? I only have ssh access to it so its almost impossible to diagnose remotely.

Trigger-broom-289 commented 7 years ago

I have quite a few more bits to connect in my observatory version 2. My odroid C1 has also been re-formated and I'm going through installing all I need, but I do not have all my troubleshooting tools on it yet. I will try to monitor the behaviour and see what I can find for you in the next few days.

I've played with the :8080/weather/chart/temperature.png and :8080/weather/chart/cloud.png They are ok in a way to look at, but if I may say not really necessary to have.

As long as in the indi driver you get (which we already have): rain : yes / no | cloud cover: yes / no then it's fine.

What would be nice to have is that in case of rain detection, mount goes to park and the roof closes automatically (or is it there?).

dokeeffe commented 7 years ago

Yea, the charts are not really needed at all. It was 100% stable before I added them so I think I'll remove them.

Regarding parking the mount then dome, EKOS has this feature in the scheduler. Not sure if you use the scheduler, I do and that bit works really well. There is a checkbox in the schduler panel for 'weather' and that does the trick. It will only work if the scheduler is running though.

Trigger-broom-289 commented 7 years ago

If it was 100% stable before, then I vote to have it removed. I would rather have a stable tool than one with "pretty" stuff....

My observatory is about 450 miles away from home.... with no remote hands... I'm always looking for stability :)

I will re-use the scheduler at some point yes.

dokeeffe commented 7 years ago

Hehe ,yes stability is better alright. 450miles is far, my one is only about 30miles or so :-) Its easy to remove it. There is not much code, remove the cloud_chart() function and the ChartGenerator from weatherMicroservice.py. I'll also have a look in the next couple of days with my one.

Trigger-broom-289 commented 7 years ago

Let me give this remove xyz a bash :) Will see how I get on. If not, I shall wait for you updated code.

If you really really want to have charts, take a look at http://indilib.org/develop/arduino/meteostation.html I used to have it (might build another one), it's using some similar graphs.

Trigger-broom-289 commented 7 years ago

I've managed to remove the code.

Noticed something interesting, running as: ./weatherMicroservice.py & will work for a few minutes then die (curl is not responding)

while running is in a screen session as ./weatherMicroservice.py works without issues

Trigger-broom-289 commented 7 years ago

Doing some tests again with the chart function. Running it in a screen session seems to be OK, had it running for a few hours now and it hasn't crashed. Will carry on monitoring it.

dokeeffe commented 7 years ago

Thats great, if you get it sorted can you let me know what changes you made or send a PR

Trigger-broom-289 commented 7 years ago

I have not made any code changes (apart from putting back the chart function as I had removed it last night), the script is running in a screen session only.

Found out that when run with ./script.py & it would die for no apparent reasons.

dokeeffe commented 7 years ago

I've stopped using the charts on my station for a day (was being called from a cron) and the thing still stops responding after about 1 day. Only way is a reboot. I cant even ssh into the PI. Still investigating. Let me know if you find anything.

Trigger-broom-289 commented 6 years ago

We can close all of this now.