Hi,
I've written a simple flashing script that calls,
particle flash --local "path/to/firmware.zip" -v
on a new Photon 2. The Photon 2 shipped with 5.6.0, but my binaries were compiled with 6.3.3.
The CLI mentions that it will "update Device OS as needed" if I don't pass a --target parameter, but I would have expected it to update from 5.6.0->6.3.3 because that's how my firmware was compiled.
Do I have to use --target for it to update? Since I'm using a script that I'd prefer to only change the zip file name between updates, instead of also keeping track of the Device OS version it was compiled with too. But if --target is needed I'll just keep track of that too when I update firmware.
particle binary inspect ./path/to/firmware.zip
firmware.bin ... depends on a system module number 1 at version 6304
That should work properly. Could you get the whole particle binary inspect output, as well as the particle serial inspect before and after flashing? And does the device update Device OS OTA after boot, or does it not have Wi-Fi credentials yet so it can't do OTA?
Does it work if you do specify --target? There is a possibility that it's not automatically updating because you're using a bundle instead of a plain .bin file, but that's just a guess.
I'll have to check the other 2 new Photon 2's tomorrow, but I had a different P2 module laying around that was on 5.8.0, and when I ran the --local command the first thing it did was download v6.3.3. Though, this was after I updated the CLI because I was getting a memory allocation error when trying to run any of the usb commands on the initial Photon 2 I was having issues with. Looking back, the CLI not being able to identify this particular Photon 2 correctly is probably why it couldn't fully tell which version it was running and may have silently skipped the update step because of it.
I'll try on the other 2 new devices tomorrow and report back.
As for your questions, it was right out of the box so no Wi-Fi credentials yet, I would expect it updates Device OS OTA. If the other devices don't work tomorrow I'll try --target as well as post the rest of the inspect output.
Next device worked fine. I think it just failed silently when I didn't update the CLI to the latest.
Thanks!
Perhaps I spoke too soon...
Part of my issue was indeed that the Photon 2 was looking for another asset that I had removed from the zip file. So it was "waiting" for the final asset to come, and not leaving listening mode because of that. After replacing the asset that I had removed back into the zip file, it flashed without issue and entered user code. Not sure if that also had to do with the device being unreachable by the CLI earlier, but I got it sorted.