Published © CC BY-NC-SA

What is my IP?

First impressions of a Raspberry Pi connected to the Particle Cloud.

BeginnerFull instructions provided1 hour2,637
What is my IP?

Things used in this project

Hardware components

Raspberry Pi 3 Model B
Raspberry Pi 3 Model B

Software apps and online services

Particle Cloud
Particle Pi
Particle Pi
porter app


Read more



copy-paste this code in your Particle IDE of choice
#include "application.h"

String externalip = "";

void setup() {
  // declare cloud variables
  // Up to 20 cloud variables may be registered and each variable name is limited to a maximum of 12 characters.
  Particle.variable("externalip", externalip);
  // declare cloud functions
  // Up to 15 cloud functions may be registered and each function name is limited to a maximum of 12 characters.
  Particle.function("whatismyip", whatismyip);


void loop() {
void loop() {
 // this delay will slow down this rasppi particle agent process so the pi keeps its cool ;)
 // without this delay, top (the command line util on the pi) shows 100% CPU use (of the firmware.bin process)
 // with this delay, top shows 2% CPU use, much better

int whatismyip( String dummyParameter ) {
  // source:
  Process proc = Process::run("curl");
  // The output is the external IP of the rasp PI
  String ipAddress = proc.out().readString();

  // publish it in the console
  Particle.publish("External IP", ipAddress );
  //refresh the cloud variable
  externalip = ipAddress;
  return 0;




32 projects • 294 followers
I focus on creating Particle IoT solutions coupled with mobile and web applications. Available for contract work at


Add projectSign up / Login