Substituting an Argon for a Xenon

I had two defective Xenons that were bricked while having their firmware updated. Particle replaced them after two months but they sent me 2 Argons instead.

I do not wish to wait another 2 months for the correct replacement. So if I use the Argon in the place of the Xenon, what changes do I need to do to the code to ensure that power consumption remains low? I am not putting the Xenon to sleep, I just want to make sure that the WiFi radio does not drain the battery.

For example, do I check for the platform ID then turn WiFi off using:

#if (PLATFORM_ID == 12) WiFi.off();

Or is this not needed? The system is running off solar so reducing power consumption is very important.

Thanks in advance for the community’s help.

Even if you wanted to wait you would not get replacement Xenons from Particle anymore as they don't have any left and won't produce them anymore.

When you put the device in proper sleep mode WiFi will not be on anyhow.

What SYSTEM_MODE are you using?
When using non-AUTOMATIC the WiFi wouldn't/shouldn't be activated automatically anyhow, so no need to switch it off.

1 Like

Hi @Jimmie -

I have 10 Xenon’s that I have no use for, but suspect it will be quite a challenge to get them to you. Honestly, I would be happy to have them be replaced with Argons :smile:

@ScruffR made a good point, specifying a SYSTEM_MODE other than AUTOMATIC, will leave WiFi of unless specifically called later in your code, which I assume is not the case as you have been using Xenons. This is probably the easiest ‘solution’.

So in my humble opinion, unless you are using SYSTEM_MODE(AUTOMATIC); i.e SYSTEM_MODE(SEMI_AUTOMATIC); or SYSTEM_MODE(MANUAL); there should be no need for changing code.

Regards,
Friedl.

1 Like

Thank you @ScruffR and @friedl_1977.

For the Argon, I am using the default SYSTEM_MODE(AUTOMATIC) because the system it is joining has multiple Xenons connected to a Boron, so I need the mesh network to be on.

When setting up the Argon, I never stored any WiFi credentials as it had been set up as another mesh unit. It is breathing cyan (after connecting to the mesh). So in this case, does it still keep looking for WiFi?

Thanks again.

Hi @Jimmie -

EDIT:: This thread might be useful.

Regards,
Friedl.

Thank you @friedl_1977.

Yes, I had set up the Argon on a mesh network and it is working as a Xenon.

The only thing I am concerned about is if it is spending time looking for a WiFi network and the resulting impact on power consumption.

I tried the following in setup() but it causes the Argon to flash a white light and not join the mesh network …

#if (PLATFORM_ID == 12)    //Argon
    WiFi.off();
#endif

Hi @Jimmie -

I was suspecting something might be not so obvious. As with Photons, it seems the Argon (even after running the instruction via CLI) is still first and foremost looking for connection to the cloud via Wifi. This then seems to block the rest of your code.

In my opinion you have two options. You can implement either SYSTEM_MODE(SEMI_AUTOMATIC); or SYSTEM_THREAD(ENABLED);

Personally I would go with adjusting the SYSTEM_MODE first as it has fewer "consequences" :smile: This will allow your code to run even if no connection is established to Particle Cloud. My guess is then your Mesh should come online. Also quite easy to fix if it does not work. See below from the docs:

The semi-automatic mode is therefore much like the automatic mode, except:

  • When the device boots up, setup() and loop() will begin running immediately.
  • Once the user calls Particle.connect() , the user code will be blocked while the device attempts to negotiate a connection. This connection will block execution of loop() or setup() until either the device connects to the Cloud or an interrupt is fired that calls Particle.disconnect() .

THREAD ENABLED might cause you code to behave different than initially intended.

I hope this helps!
Regards, Friedl.

Thank you @friedl_1977. I am using SYSTEM_THREAD(ENABLED); and getting a breathing cyan so I have a suspicion that the Argon is not looking for a WiFi connection.

I guess I can also use SYSTEM_MODE(SEMI_AUTOMATIC) and Particle.connect() but that may cause the Argon to look for a Wifi connection ...?

Hi @Jimmie -

Just to confirm; You are running in SYSTEM_MODE(AUTOMATIC); with SYSTEM_THREAD(ENABLED);but when you use WiFi.off(); in setup the Argon does NOT connect to the Mesh and remains blinking white (which means WiFi off) and never proceed to blinking Cyan?

I would give SYSTEM_MODE a go, but I am not sure whether it will turn on WiF when you call Particle.Connect(); , I suspect it might. You might want to try something along these lines as apposed to Particle.connect(); with SEMI_AUTOMATIC … I have not tested it yet and my C++ is by no means out of this world… :joy:

//connect argon to mesh
selectExternalMeshAntenna();

Mesh.connect();
while(Mesh.connecting()){;}

Serial.println("Mesh connected");

Regards,
Friedl

Thank you very much @friedl_1977.

Definitely worth investigating…

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.