Reading Photon SSID Connection

I would like to remotely read the WiFi SSID that my Photon is connected to.
I am able to read the RSSI using a “Particle.function” and WiFi.RSSI, I would like to do the same for the WiFi.SSID.
I read the Particle.function on the Particle App, Device Inspector, Data screen.

This is what I found in the Particle docs: " WiFi.SSID() returns the SSID of the network the device is currently connected to as a char* ."

I have tried the following, based on my success with the WiFi.RSSI() function:

void setup()
Particle.function("SSID", SSID);
truncated other lines...

char* SSID()
return WiFi.SSID();

It appears I am violating the formatting of the "char* ". :slightly_frowning_face:

Any thoughts would be greatly appreciated.

Image of the Particle App with RSSI:

Particle.function() returns a number not a string.

You could use a Particle.variable() or make your Particle.function() perform a Particle.publish() to send the string.

BTW, in your code the curly braces don’t match up - proper indentation would help spotting such errors :wink:
The Particle.function() handler also has to take a string parameter - that’s not optional. You can ignore it inside the function but it has to be passed.

Thanks for the help and tips, I will try the particle.variable approach.