OK, so in the beginning I thought it may be the issue with camera being offline due to power outage which would cause a gap in a video stream. However by inspecting Meraki Dashboard I can see that the video for the specific timestamp is there! Either way if you query for a camera snapshot when there is no footage for the specific timestamp, you will get error at the point when generating the URL for snapshot file rather than at the point of downloading the file. What I tried next is generate URL & download snaps for +/- few seconds and apparently this works for every single time. Whenever I hit 400/502 I just try again with +1s. So if you can allow for this difference in timestamp for your snaps then I believe it's stable enough solution until we hear back from Meraki about the issue. P.S. There is no need for delaying requests. In my experience during the debugging time the file is ready for download as soon as the URL is generated for it. Although as a safeguards I also implemented some loop which retries download file again with 1s delay whenever there is error in response - you can cap it at few times not to run it indefinitely just in case
... View more