I’m using Node Red to capture a snapshot then message it to my phones.
The capture portion works fine, however, the notification displays an old photo. It seems as if an old image has been cached and not being replaced.
Here’s the sequence that I am using…
When triggered, I capture the camera image and save it to a folder…
Note that I use “/local/snapshots/” for the notify path because the notify.notify service did not work with “/config/www/snapshots/” but essentially it’s the same thing.
If anyone has experienced this issue or has notification working I would love to hear from you.
Thanks
[SOLVED]
So the problem was with Cloudflare caching. I’ve disabled caching and all is good now.
Make sure that the script allow time for the image to be finished written.
Add a delay in your script. Start with a big value and then if it works, lower it.
Remember that timing can change from run to run, so don’t try to optimize it too much.
Also make sure that your device do not show a cached image by clearing the cache between attempts.
If this is the issue, then URLs can usually be suffixed with a ?cachecheat=timestamp, where timestamp should be made a real timestamp.
Are you sure that msg.snapshot_name is being updated correctly and or exists? Yes. snapshot_name is also used for the saving so it is correct.
notify.notify service
This service does not always work the way you would expect. It is recommended to always use the device’s actual notification entity. I also tried specifying my phone “notify.pixel_6a” and got the same result.
I do get an image displayed but it’s an image from a few days ago.
Make sure that the script allow time for the image to be finished written.
Add a delay in your script. Start with a big value and then if it works, lower it.
Remember that timing can change from run to run, so don’t try to optimize it too much. I thought this may be the issue so I put a delay in but it did not have any impact. Even after multiple notifications it continues to give an old image.
Also make sure that your device do not show a cached image by clearing the cache between attempts.
If this is the issue, then URLs can usually be suffixed with a ?cachecheat=timestamp, where timestamp should be made a real timestamp. I think this may be the issue so I’ll give it a test.