Local Building Firmware over written when OTA flash

@peekay123, @BDub, Just wondering if I build locally to say version 0.4.3 then flash new user code to the device through the OTA Particle build environment, does the firmware version get downgraded to the current released version say 0.4.2?

@wesner0019, the system firmware needs to be higher or equal to the firmware your app is being compiled. Right now, the cloud auto-update feature is being tested. I will tell you that your Photon’s firmware is not up-to-date and offer to update it. There is no β€œdowngrading”. You can however manage the version of your system firmware and user firmware if you compile locally.

To add on to what @peekay123, there should also be a β€œi prefer this version” feature if i am not wrong so that people can rollback if there’s some issues

1 Like

The auto-updater does a dependency resolution on the firmware you’re compiling. Right now the dependency information provided by the user binary is something like:

Hey, I need a system-part1 version 2 or higher, and a system-part2 version 2 or higher for the photon platform.

The auto-updater will compare that to the system information on your photon, and try to determine if you need an update to run the new firmware.

I hope that helps!

Thanks,
David

1 Like

@dave, is there a way to determine what version is loaded on my P1 for verification?

Also does your explanation work with the β€œlatest or development” branch of the software?

Hi @wesner0019,

Good question! At the moment, the easiest way is to put your photon into listening mode, and open a serial connection to it. If you hit β€œs”, the photon will spit out a big chunk of dependency information, something like this:

[
      {
        s: 16384,
        l: "m",
        vc: 30,
        vv: 30,
        f: "b",
        n: "0",
        v: 3,
        d: []
      },
      {
        s: 262144,
        l: "m",              // location: main
        vc: 30,
        vv: 30,
        f: "s",               // <- function: system
        n: "1",              // <---- system part 1
        v: 3,                 // <---- version 3
        d: []
      },
      {
        s: 262144,
        l: "m",           // location: main
        vc: 30,
        vv: 30,
        f: "s",             // <- function: system
        n: "2",           // <--- system part 2
        v: 3,              // <--- version 3
        d: [
          {
            f: "s",
            n: "1",
            v: 3,
            _: ""
          }
        ]
      },
   ...
    ]

I built some tools recently to parse out this information from compiled firmware, and we’ll be building more tools to make this information more easily usable / readable. :slight_smile:

Thanks,
David

1 Like

@Dave, below is my output, so v is 3 does this mean 0.4.3?

β€œp”:8,β€œm”:[{β€œs”:16384,β€œl”:β€œm”,β€œvc”:30,β€œvv”:30,β€œf”:β€œb”,β€œn”:β€œ0”,β€œv”:3,β€œd”:[]},{β€œs”:262144,β€œl”:β€œm”,β€œvc”:30,β€œvv”:30,β€œf”:β€œs”,β€œn”:β€œ1”,β€œv”:3,β€œd”:[]},{β€œs”:262144,β€œl”:β€œm”,β€œvc”:30,β€œvv”:30,β€œf”:β€œs”,β€œn”:β€œ2”,β€œv”:3,β€œd”:[{β€œf”:β€œs”,β€œn”:β€œ1”,β€œv”:3,"":""}]},{β€œs”:131072,β€œl”:β€œm”,β€œvc”:30,β€œvv”:30,β€œu”:β€œxxxxxxx”,β€œf”:β€œu”,β€œn”:β€œ1”,β€œv”:2,β€œd”:[{β€œf”:β€œs”,β€œn”:β€œ2”,β€œv”:1,"":""}]},{β€œs”:131072,β€œl”:β€œf”,β€œvc”:30,β€œvv”:30,β€œu”:β€œxxxxxx”,β€œf”:β€œu”,β€œn”:β€œ1”,β€œv”:2,β€œd”:[{β€œf”:β€œs”,β€œn”:β€œ2”,β€œv”:1,"_":""}]}]

Hi @wesner0019,

I think (last I checked), version 3 of the system modules corresponds to 0.4.3, yeah. This line in your output:

{"s":131072,"l":"m","vc":30,"vv":30,"u":"xxxxxxx","f":"u","n":"1","v":2,"d":[{"f":"s","n":"2","v":1,"":""}]},

that β€œd” part is the dependencies, so it needs at least a system part 2, with version 1 or higher. So it should run / be okay.

Thanks,
David