Cloud functions

Get public IP

Using this feature, the device can programmatically know its own public IP address.


SerialLogHandler logHandler;
bool nameRequested = false;

// Open a serial terminal and see the IP address printed out
void subscriptionHandler(const char *topic, const char *data)
{"topic=%s data=%s", topic, data);

void setup()
    Particle.subscribe("particle/device/ip", subscriptionHandler);

void loop() {
    if (Particle.connected() && !nameRequested) {
        nameRequested = true;

Note: Calling Particle