Issuing a firmware update to multiple P1's at once without PRODUCT_ID


#1

Hello,
I found this API to flash a bin file on a specific particle device.

curl -X PUT https://api.particle.io/v1/devices/?access_token= -F file=@firmware.bin -F file_type=binary

This API is working perfectly fine. I wrote a small python script which calls this API. For each deviceID in the list I am creating a thread and invoking this API. But when I run the script only the first device in the list gets the firmware update. I don’t see any response like Update started or TimedOut for the rest of the devices.

I am aware of the API’s which flash all the devices with have a specific PRODUCT_ID. I have tried it and that’s working good. I don’t want to add a product id in the firmware. Just looking if there is any API which can do the same by spawning threads and calling one API per thread.

Any ideas?

Thanks
Dheeraj


#2

Never mind, found a solution. I should wait for the thread to finish before starting a new thread. thread.join() after thread.start() (in the code) fixed the issue.