Creating coordinated Christmas light displays with mesh networking

I posted on youtube before coming here. Almost complete newbie, I am hoping to make a sensor net on my 10-acre property, using xenon to capture the PIR and Boron to send out. I’ll figure out how to log later. I found only this regarding Particle and PIR:
PIR and Photon
It has only 4 lines of code (webooks-push.ino),

void setup() {
    pinMode(D0, INPUT);
}

void loop() {
    if (digitalRead(D0) == HIGH) {
        Particle.publish("office-motion", "OFFICE", 60, PRIVATE);
        while (digitalRead(D0) == HIGH); // hang tight here until motion stops
    }
}

I connected the pins on the PIR to the D0, 3.3v and Grnd. When flashed to Xenon, it keeps sending it into safe mode. I have to flash different code to get it out of safe mode.

So I’m not sure where to go. If I can solve that, I’ve already played with simple Particle.publish functions in examples. The Mesh.publish() will be next.

Looking for other examples or troubleshooting advice.