Cannot OTA Flash Any 3rd Generation Devices

Hi there,
I have recently bought a couple of Argons and Xenons to use in mesh networks but none of them seem to work.

I cannot properly OTA flash any of the devices. I have started with one of the Argons, whenever I try to OTA flash it, the onboard RGB LED turns solid magenta and remains that way for around a minute, then going dark. It then seems to reboot after staying dark for a couple of minutes.

Occasionally the flash is successful and after the board reboots, the application starts running and the device sends an event to the cloud stating that the flash was successful. But usually, the flash fails and when the device reboots, the previous application runs and a failed event is sent to the cloud.

I started looking for similar issues on the forum and found a couple, I tried re-installing the binaries for the OS, I tried reinstalling 1.1.0 first but the issue was still there. I then tried 1.1.1 and 1.3.0 rc1 all of which had the same behaviour. I flashed all the binaries including the bootloader which I flashed through serial and then using a jTag.

I have also tried including SYSTEM_THREAD(ENABLED) in the applications I was trying to flash with no success. I have also tried un-claiming and claiming the device again with no success.

I figured it might be something with the device, I contacted support and support managed to reproduce the error using the code I have provided (the one I used for testing it), which is below. The error was fixed when they flashed a different code though it does not fix when I try to flash something else.

void setup()
{
    Serial.begin(9600);
    while(!Serial) {};
    
    Serial.println("");
    Serial.println("");
}

void loop()
{
    Serial.println("hello world");
    delay(1000);
}

I though it might be the while loop in setup but other applications without a while loop don’t work wither.

So I claimed another argon which acted the same, I tried the Xenons and all of them have the same behaviour. I can flash all of them using USB in DFU mode and Serial in the CLI. It is essential to flash the devices using OTA as they are meant for operation on the field.

There must be something I am doing wrong, can you OTA flash the devices when an application is running or does the device have to be in a particular mode when flashing? I have been using the code below for testing the devices recently. I have also tried OTA flashing blank sketches and it still did not work.

SYSTEM_THREAD(ENABLED);

void setup()
{
    pinMode(7, OUTPUT);
}

void loop()
{
    digitalWrite(7, HIGH);
    delay(1000);
    digitalWrite(7, LOW);
    delay(1000);
}

Thank you.

This prevents all the cloud/mesh tasks. You need to allow them to run in order to OTA flash
Try this

while(!Serial) Particle.process();

(although the !Serial test isn’t really reliable - you may rather want !Serial.isConnected())

Not surprising, as this never cures such issues.

To exclude your application code you can always try Safe Mode.

Could it be that your conncetion is flaky?

However, I agree that the magenta flashing indicators (“stalling” for prolonged times) have thrown me off before too.

Tried that and it did not work, the device behaves the same with every code. I don’t think it would be the connection as the device can be signalled and interacted with using tinker successfully.

Can you run particle serial inspect on your device(s) (in Listening Mode) and post the output?
I just tried flashing a 1.3.0-rc.1 BLE test sketch OTA which also triggered a device OS update 1.1.0 to 1.3.0-rc.1 without issue.

I ran the command in listening mode, output below.

Platform: 12 - Argon
Modules
  Bootloader module #0 - version 301, main location, 49152 bytes max size
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
  System module #1 - version 1104, main location, 671744 bytes max size
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
      Bootloader module #0 - version 201
  User module #1 - version 6, main location, 131072 bytes max size
    UUID: C0298DBE6DB3DA0D8C6433D1C51D2BE44AF270ECBA83C5D858593C608F4A32CA
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
      System module #1 - version 1104
  User module #1 - version 5, factory location, 131072 bytes max size
    UUID: 0000000000000000000000000000000000000000000000000000000000000000
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
      System module #1 - version 403
  NCP module #0 - version 5, main location, 1536000 bytes max size
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS

That looks OK.
Can you update OTA from Web IDE while in Safe Mode?

That’s no proof as neither of these require a lot of bandwidth and can succeede even with a flaky connection. There is a lot more data transferred for a OTA update than for a mere function call.

I can’t update OTA with the device in safe mode

Are you an environment which has a very busy WiFi spectrum (lots and lots of wifi network traffic going on)? Some others have noted problems in situations like that.

I am in an area with quite a lot of traffic indeed, I will have to test it in a less busy area