If TL;DR, go to question at bottom.
I’ve got a very unique project I’ve developed that has no real practical real-world application, but it involves curling https://api.particle.io/v1/devices/device_id/function_name to call a photon function from PHP. This is the application:
I have a small chicken coop with cameras that stream 24/7 on YouTube so people can watch the chickens live their best lives, lay eggs and run around. Viewers can also feed the chickens by using YouTube SuperChat (pay a buck, the chickens get a treat, fully automatic - like a virtual zoo but without having to leave your house - totally integrated into YouTube’s payment flow - lots of fun for everyone). There’s a photon powering the feeder, it’s been working flawlessly for 5 months.
Recently I added a second photon to control the gate on the coop so that moderators (viewers around the world who are hand selected to also moderate comments) can click a button on a website and close the gate at night once all the chickens go in to roost.
That flow looks like this:
-Mod pushes button on web page.
-Javascript sends command via Ajax to PHP to close the gate
-PHP script logs this action into a MySQL database
-PHP sends a pushover notification to my phone to let me know a mod closed the door
-PHP cURLs https://api.particle.io/v1/devices/device_id/function_name - this calls the closeGate() function in the photon.
This feature has only been turned on for three days, but today, for some reason everything in the above PHP script fired properly, but the gate didn’t close. So it could be that there was an error with the PHP connecting to the Particle cloud, or it could have been that the photon was offline at that moment, or a number of other things.
My question is: is there a log some place that shows all of the calls to the API for a specific device that I could look through? It’s only happened once, but this has only been used 3 times. So there’s no telling what the stats are on failure rate.
And if you want to see the project, it’s here. They’re all asleep now but they get up early and the photon automatically opens the gate at sunrise: https://www.youtube.com/watch?v=n0E_aZ5C0x8