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.)
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.
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:
Put xenon into DFU mode (yellow flashing)
Update xenon with CMD using “particle update”
CMD says “Update success!”
The xenon is now flashing blue
I copy the program from the standalone document, i.e.,
This creates a file in my Downloads called “firmware.bin”
Put the xenon back in DFU
Type “particle flash --usb firmware.bin” in the CMD
CMD says “Flash success!”
No joy. The xenon status LED continues to flash blue, but User LED (on D7) does nothing.
The document then says to run particle serial inspect, so I type “particle serial inspect” in the CMD.
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:
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;
}
}