I have a camera swarm that I need to record capture numbers with their filenames so I can group them together on the webserver they are uploaded to. Each time I capture images I would like each of the modules that took a picture to have the same capture number.
I have been able to write code to increment the capture number each time (image attached), but the issue is that I have to use a bridge which only works with 2 ESP32’s at a time. I could fix this by adding bridges to each module effectively “daisy chaining” them, but that would require a new program for each module and that would be a huge hassle for 16 - 24 ESP32 modules.
Is there an easy way to keep (and preferably even reset) a global capture number that each of the ESP32-CAM modules pull from each time a new image is taken?
When I hit the “shutter button” all of the ESP32’s that are online will take a picture. I want all of those to have the same capture number. And then the “global” capture number increments by 1. So essentially I’m using it as a way to tell which group of images were taken at the same time.
How is the capture command (the shutter release command from the shutter button) communicated to the various devices?
Is this a Blynk widget button? If so is it connected to a virtual or physical pin?
Are each of the devices running Blynk code, and do they have separate Auth tokens?
Okay, is it feasible for you to designate one of the devices as the master device, and gave that take care of the numbering sequence?
If so, then I think I’d store the next sequence number in a central location. This could be either on the Blynk server or your FTP server.
Each device would then read this number, either via an API call or an HTTP call to your FTP server and use that the next time it saves a file.
The master device would then increment that number after it had taken a shot and saved it.
You slave devices could maybe save their image, wait a short time (so that the master device handles the number incremental in process) then reads the next number.