Can Particle.io + Linux on a Pi both acess GPIO?

I have been working on a voice activate universal remote, but have hit a wall. I used the guide at http://alexba.in/blog/2013/01/06/setting-up-lirc-on-the-raspberrypi/ to setup LIRC on my pi and that worked great, but once I installed particle on the pi it no longer worked. The plan was to use the following code, but after installing particle even running LIRC via SSH no longer works.

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

void loop()
{
}

int irSend(String command) {
    Process proc = Process::run("irsend "+command);
    proc.wait();
        return 0;
}

If you’re using a Raspberry Pi 1, there’s a known issue with the Particle agent locking up the Raspberry Pi 1. You can use a Raspberry Pi 2, 3 or Zero.

Thanks for the reply. I am using a pi3, and the problem seems to be that particle doesn’t want to share the GPIO pins. I can still SSH into the pi and run commands, but I have lost GPIO functionality. I changed The topic name to reflect what I believe is the issue.

Currently the Particle firmware sets all pins as input on start, but you should be able to use usual commands to set them back to outputs and use them.

Can you give an example of what doesn’t work that you expect should work?

Aha! Setting the appropriate pin to output did the trick. I wouldn’t have thought of that, thanks!

1 Like