aprsworld / wsWebDisplay

0 stars 0 forks source link

Cams do not reappear after station expires and comes back #95

Closed Cdetviler closed 8 years ago

Cdetviler commented 8 years ago

Cam displays no image available instead.

Cdetviler commented 8 years ago

So my own reference:

This happened on two separate occasions so far. Both times, according to Jim and Andrew, the cam was down when the configuration was loaded and then was brought up after page load. This is consistent with what I am seeing in the code. The function that is in charge of loading a camera from the configuration is the only place in the code where it will load images/unavailable.jpg in place of the camera src. It will only do so when it cannot find a URL in the first data object that it received. This is intended behavior in case it loads an expired camera.

What is not intended is the fact that these cams do not update afterwards. It's possible the actual path is getting messed up when the camera loads for the first time. If that's the case, then it should be an easy fix.

I will have to test this further tomorrow.

Cdetviler commented 8 years ago

I may have solve the issue in one of the more recent commits. We will see if it happens again. It may be worth me having a camera at some point that I can shut down for testing purposes.

Cdetviler commented 8 years ago

So this issue issue is still happening - confirmed by a scenario that happened with Jim's camera.

1) The camera went offline due to power so everything had expired. 2) Jim loaded a saved layout with the information for that camera and all data elements displayed NaN and the camera displayed no image available. (NaN should be handled more gracefully - and I thought it was. Apparently not). 3) When the camera and sensors came back online and started sending data, the page that had loaded while it was offline recovered only for data elements. The camera still shows "no image available" 4) Loading a new page with the layout shows the correct information

This needs to be fixed in that:

1) NaN is handled more gracefully. 2) camera images start being loaded once the camera comes back online

Cdetviler commented 8 years ago

I simulated this issue by creating a saved layout with a specific camera. In the function that loads the camera from a configuration, I set the path to a non-existent path and set a timeout that changed it to the correct path after a minute. This means that for the first minute, the cam object attempted to look for it's image src in the wrong place which resulted in the 'no image available' place holder showing up.

I found an issue in the updating function that would cause cameras to not update based on the path property in the camera object. I fixed this and it seemed to run better in my simulation.

I was actually able to reproduce the real situation this morning as well. A4751 was not online for a while this morning and all of the data expired. After I had made my changes and tested my simulated situation, I loaded up a configuration containing the camera for A4751. As expected, it was showing the 'no image available' placeholder. I powercycled the camera and it came online. I went to take out the mail and came back to my computer, and the cameras were online.

I would obviously like to test this some more to make sure that it is working. However, data doesn't expire for quite a while - David has it set for a half hour or something like that. I currently have A4751 unplugged. I am going to work on getting age of data working in the meantime while I wait for the data to expire.

Cdetviler commented 8 years ago

I waited for the data to expire on A4751 once more. The 'no image available' showed up once more when I loaded a layout that contained the camera. I plugged the camera back in and wsWebDisplay displayed the first image that loaded once the camera came up.

Cdetviler commented 8 years ago

Duplicate of #101