I have moved this script over from a gist to a repository.
I have also made it super easy to install this utility:
curl -fsSL https://git.io/vwRRf | bash
Additional functions have also been added, including OTA flashing and manual DFU control. Find out more in the repository, https://github.com/nrobinson2000/po-util
UPDATE:
This is now a repository. https://github.com/nrobinson2000/po-util/
Notes:
To fully make use of this script you must first download and save it to your home folder.
Make the script executable and create an alias for it in your .bashrc.
You next have to install the Particle toolchain and dependecies. All of this can be taken care with:
To format your working directory into a project folder run:
Next, put your device into dfu mode and install the firmware patch with:
replace _DEVICE_ with either _photon_ or _electron_
To compile and test your firmware run:
To compile and automagically upload your firmware with dfu-util run:
Discuss on Particle Forums