Nathan Robinson
Published © MIT

How To Run Particle On Raspberry Pi (Headless On Pi Zero W)

Use the most popular single-board computer with the most popular IoT tools.

IntermediateProtip1 hour9,392
How To Run Particle On Raspberry Pi (Headless On Pi Zero W)

Things used in this project

Hardware components

Raspberry Pi Zero Wireless
Raspberry Pi Zero Wireless
×1

Software apps and online services

Particle CLI

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Code

Retrive CPU Temperature

C/C++
# include "Particle.h"

int getTempC(String args)
{
  Process proc = Process::run("vcgencmd measure_temp");
  proc.wait(); // The output is temp=43.5'C, so read past the = and parse the number
  proc.out().find("=");
  float cpuTemp = proc.out().parseFloat();
  Particle.publish("cpu-temp", String(cpuTemp));
  return 0;
}

void setup()
{
  Particle.function("getTempC", getTempC);
}

void loop()
{
  // Nothing in the loop
} 

Wi-Fi Configuration

Plain text
network={
    ssid="MyWiFiNetwork"
    psk="the_password"
    key_mgmt=WPA-PSK
}

Credits

Nathan Robinson

Nathan Robinson

6 projects • 11 followers
Maker, Hacker, Student. I love building websites and developing on embedded devices. Currently an Embedded Developer for TankClarity.

Comments