Is it still possible to have a Xenon simply tell an Argon that's it's powered-up?

I have an Argon and some Xenons that I had working well, but haven't used for a couple of years. I know the Xenon is deprecated, but I'm wondering if it's at all possible to still get the Xenon to simply tell the Argon that it's powered on. I don't need anything beyond that.

The application is the Argon would be plugged into an outlet on my RV and will light-up an LED if it's powered up (which shows me the inverter is on.) I have another outlet that my Starlink is connected to and I can switch that on/off remotely. My idea is to connect the Xenon to the same outlet as the Starlink and when I turn on the power to the Starlink outlet, the Xenon would power up and tell the Argon that it, too, is powered up. So, in short, I would have two (2) LEDs, one that lights up when the inverter is switched on (Argon) and the other when the Starlink is switched on (Xenon.)

There are a couple different approaches to this.

If you have already paired the Xenon with the Argon and have a working mesh network, I think you may be able to reprogram the Xenon still, but this is a bit risky. Also you have to be careful to never upgrade the Argon, because then the mesh network would stop working.

The better solution is to use the Xenon in standalone mode running Device OS 1.5. It can still be flashed by USB. Then use BLE communicate with the Argon, which can be running modern Device OS.

If the two are close enough together, you could also skip the Xenon entirely and use a high voltage sensor hardwired to the Argon.

Oops. I probably should have asked first before playing around trying to figure it out on my own! I think I might have updated the Argon when I started playing around with it and was able to have it start flashing an LED. I'm not understanding your second paragraph (using BLE), but I can research that to bring me up to speed. I appreciate you pointing me in the right direction. Regarding how close they are to each other, pretty close but it would be difficult to run wires in a clean fashion.

Start with the BLE tutorial. There are some examples in that page.

Great! Thanks.

Hi, another alternative is to use this library:

It's pretty easy to use, and it was created by a former Particle employee to partially cover the void that mesh left. :cry:

best,

1 Like

Nice. Thanks. I'll check it out,

I’ve followed the document (Xenon Standalone | Archives | Particle), but I can’t get my xenon to even blink an LED. Go easy on me, I don't do much programming.

Here are the steps I’ve taken, following along with the standalone document:

  1. Put xenon into DFU mode (yellow flashing)
  2. Update xenon with CMD using “particle update”
  3. CMD says “Update success!”
  4. The xenon is now flashing blue
  5. I copy the program from the standalone document, i.e.,
*#include* "Particle.h" 

SYSTEM_MODE(MANUAL); 

const unsigned long BLINK_PERIOD_MS = 1000; 
unsigned long lastBlink = 0; 
bool blinkState = false; 

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

void loop() { 
if (millis() - lastBlink >= BLINK_PERIOD_MS) { 
lastBlink = millis(); 

digitalWrite(D7, blinkState); 
blinkState = !blinkState; 
} 
}
  1. This creates a file in my Downloads called “firmware.bin”
  2. Put the xenon back in DFU
  3. Type “particle flash --usb firmware.bin” in the CMD
  4. CMD says “Flash success!”
  5. No joy. The xenon status LED continues to flash blue, but User LED (on D7) does nothing.
  6. The document then says to run particle serial inspect, so I type “particle serial inspect” in the CMD.
  7. Everything comes back as PASS, as follows:
Platform: 14 - Xenon

Modules
  Bootloader module #0 - version 502
  Size: 41.944 kB
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
      System part module #1 - version 1102

  System part module #1 - version 1512
  Size: 596.936 kB
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
      Bootloader module #0 - version 501
      Radio stack module module #0 - version 202

  User part module #1 - version 6
  Size: 11.904 kB
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
      System part module #1 - version 1512

  Radio stack module module #0 - version 202
  Size: 0 kB
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS

I’m guessing I’m missing something pretty simple, but I can’t see what it is. Any ideas? I'm ready to throw the three (3) Xenon's I have in the trash, but I thought I would give it one more try.

Actually, that was really close, and you did the right debugging steps.

Because you don't have a mesh network, add this to setup:

// This clears the setup done flag on brand new devices so it won't stay in listening mode
// Only do this for 3.x and earlier
const uint8_t val = 0x01;
dct_write_app_data(&val, DCT_SETUP_DONE_OFFSET, 1);

I'm sorry, but maybe there's something else I need to do other than simply copy and paste what you gave me. Here's my current code, with your addition to setup:

#include "Particle.h" 

SYSTEM_MODE(MANUAL); 

const unsigned long BLINK_PERIOD_MS = 1000; 
unsigned long lastBlink = 0; 
bool blinkState = false; 

void setup() { 
    
// This clears the setup done flag on brand new devices so it won't stay in listening mode
// Only do this for 3.x and earlier
dct_write_app_data(&val, DCT_SETUP_DONE_OFFSET, 1);

pinMode(D7, OUTPUT); } 

void loop() { 
if (millis() - lastBlink >= BLINK_PERIOD_MS) { 
lastBlink = millis(); 

digitalWrite(D7, blinkState); 
blinkState = !blinkState; 
} 
}

When I try to compile it, I get the following error codes:

xenonusbtest.ino:13:21: 'val' was not declared in this scope
error
xenonusbtest.ino:13:26: 'DCT_SETUP_DONE_OFFSET' was not declared in this scope
error
xenonusbtest.ino:13:50: 'dct_write_app_data' was not declared in this scope

I checked with gptchat to see if it could help me with whatever I might be missing, and it had me add the following to the start of the program:

#include "dct.h"
#define SETUP_DONE_OFFSET DCT_SETUP_DONE_OFFSET

I now get:

xenonusbtest.ino:16:21: 'val' was not declared in this scope

Not to flood this with all my attempts, but I did notice you suggested something similar back in 2019. My current code (that compiles and flashes) is:

#include "Particle.h" 

#include "dct.h"

SYSTEM_MODE(MANUAL); 

const unsigned long BLINK_PERIOD_MS = 1000; 
unsigned long lastBlink = 0; 
bool blinkState = false; 

void setup() { 
    
// This clears the setup done flag on brand new devices so it won't stay in listening mode
// Only do this for 3.x and earlier
    const uint8_t val = 0x01;
    dct_write_app_data(&val, DCT_SETUP_DONE_OFFSET, 1);

pinMode(D7, OUTPUT); } 

void loop() { 
if (millis() - lastBlink >= BLINK_PERIOD_MS) { 
lastBlink = millis(); 

digitalWrite(D7, blinkState); 
blinkState = !blinkState; 
} 
}

Unfortunately, my xenon is still flashing blue.