Coding in Atom: How to choose firmware version & Memory Usage

Hi Everyone.
I have a couple of questions about coding in Atom vs build.particle.io.
In the web I can choose what firmware version I will use, how about in Atom? Is the last firmware
version available automatically used? Any way of change that?

Also, the web IDE shows an “info” icon that, when pressed, displays the memory usage of the
code. How I get the same information with Atom.

Finally, it will be very nice if the Dashboard display the firmware version of the owned devices.
Or the Particle app…any way that can be done remotely. I’m missing something?

Thank you for your help.

1 Like

If you are compiling in the cloud, yes. If you are advanced, and compiling locally, you can select your firmware version.

As far I know, this information can only be found in the web IDE.

You could make a cloud variable in your code that would make a Particle return what firmware version it is on using the System.version() method. This could be done with:

String firmwareVersion = System.version().c_str();

Particle.variable("version", firmwareVersion, STRING);

in your setup().

To find out the firmware version of a device, you would need to make a HTTP GET request to

https://api.particle.io/v1/devices/DEVICE_ID/version?access_token=PUT_TOKEN_HERE

You would then get a JSON response like:

{
  "name": "version",
  "result": "5.0.0",
  "coreInfo": {
    "name": "deviceName",
    "deviceID": "0123456789abcdef01234567",
    "connected": true,
    "last_handshake_at": "2015-07-17T22:28:40.907Z",
    "last_app": ""
  }
}
1 Like

Thank you dear Nathan for your swift reply.

1 Like

@gavpret:

Even when less advanced and want to build in the cloud you can use CLI to select the target version via

particle compile photon <buildPath> --target 0.5.0 --saveTo firmware.bin

Nope, with the above command you also get the memory overview and you'll also see warning/error messages better

particle serial inspect

would give you an overview of the installed module versions and particle identify or in a serial monitor v would tell you the overall system version.

Also putting your device into Safe Mode causes the publication of a spark/status/safe-mode event that contains this info (in a somewhat cryptic form tho')

So no need for a dedicated firmware flash to expose this info.

That's cool. :wink:

I just looked in the documentation, and it should be --saveTo

Oops, typo - I corrected that.

Thanks!