So we sell some boards which we flash with firmware prior to shipping. I use the Particle CLI to to setup the module for my network associate it with my account for testing, etc. This is quite a bit faster than using the GUI apps. I would also like to use the CLI to OTA flash my firmware to the Photon/Electrons. However recently I have not been able to accomplish that. Format I am using is as follows:
particle flash deviceID firmware.bin
From the Terminal everything looks like it went through fine but when I check available functions on the module I can see Tinker is still running so the firmware flash did not go through. Is anyone else using this? Am I doing something wrong?
For reference I get the binary file by downloading it from the build IDE. I can flash it from there and it works perfectly just does not work from CLI.
I generally test everything just like I were an actual user so I like to get it connected to the WiFi network(verify WiFi on module is good, have seen a couple bad ones), then monitor events published by the device and call cloud functions on the device. This ensures that everything works.
I could flash over USB I suppose, but shouldn’t I be able to flash OTA using the CLI? It seems like I did it that way in the past and it works. Although I believe I was doing a build from the modules directory and flashing OTA rather than submitting a binary.
Traviss-MacBook-Pro:NCD_Particle_Binaries travis$ particle binary inspect NCD1Relay.bin
NCD1Relay.bin
CRC is ok (80e11f94)
Compiled for core
This is a monolithic firmware number 0 at version 0
So how would I download a Binary from Build and ensure it has Photon set as the Target? I do not see any options for setting the compile Target when downloading the Binary on Build.
I’m not seeing anything on build for that. The only option similar to that is System Firmware Target version but that is device specific and not code specific, it does nothing for the download compiled binary button in the code view.
It appears that when I origionally downloaded these binaries from Build I must not have had a module stared. By doing so it defaulted to Core(makes perfect cents?).
Anyway I stared a Photon module, then downloaded binary from Build. Now Particle Binary inspect is showing the binary is targeted for Photon. I then flashed OTA using the CLI just as before and it succeed.
So long story short when you download a binary from Build by default that binary is targeted for Core.