Xenon Mesh External Antenna enable

Im attempting to use an external mesh antenna on one of my Argon & Xenons, is it correct that all I need to do is add this function to my code and call the function in my setup?

void selectExternalMeshAntenna() {

#if (PLATFORM_ID == PLATFORM_ARGON)
    digitalWrite(ANTSW1, 1);
    digitalWrite(ANTSW2, 0);
#elif (PLATFORM_ID == PLATFORM_BORON)
    digitalWrite(ANTSW1, 0);
#else
    digitalWrite(ANTSW1, 0);
    digitalWrite(ANTSW2, 1);
#endif
}

** it did seem to work code wise, but I didnt get any extra range from what I could tell (across the house connection)

Yes and it does work.

Enable system threading at the top of your sketch, that’s what I did. Not sure if it’s required.

That code tripled the BLE range on a Xenon, same for the MESH.

I included system threading and added antennas to both sides (on argon and xenon). Things are much happier. TYVM for the help!

1 Like

If you feel that your request/issue is solved can you tick the Solution box?

1 Like

I have successfully used this code to increase the performance of my Argon to Xenon mesh network communications.

I have a basic coding question however that I can’t seem to figure out with google or the docs.

Why is there a # symbol in front of the IF statement blocks, and why is the else if, shortened to eleif.
What is special about the use of the symbol?

TIA
John

When a # symbol is in front it’s a preprocessor directive.

http://www.cplusplus.com/doc/tutorial/preprocessor/

It’s a standard C/C++ feature not exclusive to Particle.

Thanks! I thought it would be a C/C++ thing, but couldn’t get close enough for google to help me out.

1 Like