I am working on a project with Particle Photon P1 chip and I am trying to determine from the software/firmware side what (chip, or External) antenna is being used.
Reading upon the datasheets, and browsing the forums, I came across 2 possible solutions :-
WiFi.selectAntenna(ANT_EXTERNAL) and WiFi.selectAntenna(ANT_INTERNAL) functions return 0 when antenna is present a negative value(-1005) when antenna is not present, but in my case I am always receiving 0 irrespective of the antenna I am using
SPDT RF switch that controls the selection of antenna. I am wondering if there is a way I can read if SW_ctrl1 is active or SW_ctrl2, through firmware/software.
As some additional piece of information : currently, there is a Startup Function to wrap (WiFi.selectAntenna(ANT_EXTERNAL)) before SETUP and Loop able to switch to External Antenna upon startup, and if I unplug/pull out the external antenna, P1 falls back to chip antenna.
Any help in either why I am recieving all zeroes in approach 1 and any further insights into step 2, in addition to any other knowledge/guidance is much appreciated.