stgeorge:
I agree though, once I get this working, I'm going to need a simple, effective way to just shoot one call out every time it is actually pressed.
The issue is that you are probably going to be making a bunch of calls, one right after the other, and that could possibly cause issues that would not show up if you just made a single call. As a compromise until you get proper debouncing working, you could add a delay() call immediately after calling runCurl(). For a "production" system, this would not be a good thing, but as a quick proof of concept it should work. If you add a delay(1000); after the runCurl() call, then it will call the function only once if you press the button less than a second, and will call it once a second if you hold the button down. You could make the delay longer if you want to make sure it's only called once for a longer press. But this delay will tend to make the program unresponsive, so you don't want it to be longer than necessary.
So, I replaced "curl" with the "/usr/bin/curl" and connected the pin (i.e. pressed the button), and nota.
Well, it was worth a try.
For the echo - do I put the while statement just below runCurl(); in the loop and yes, call Serial.begin() in setup...is that all?
No, put it inside runCurl() after the p.run() call. If you put it outside of runCurl(), the p object will not be defined. Not only will this cause a compile error, but even if you could call it from there, the p object will be automatically destroyed when runCurl() exits, along with any data you would be trying to read.
Also- why #include <Bridge.h> and <Process.h> at the start- I sort of figured that needed to be there, but I don't really understand what they are doing.
Those files define the Bridge and Process classes, respectively. It's telling the compiler that the classes exist, and what their interface is - the functions and data that the class provides. This lets the compiler check that you are calling any functions properly, and it tells the compiler how to generate the proper code to call those class functions.
Without those include statements, it won't know about the Bridge object and how to call Bridge.begin(), and it won't know about the Process class and won't know how to create the p object of that class, nor what functions can be called in that class.
stgeorge:
I think I'll need to add 9600 baud rate?
Yes, you will need to add some baud rate, and it generally must match what you are using in the Serial Monitor. The exception is when the USB port is managed directly by the AVR chip, like when using a '32U4 processor that is on a Leonardo, Pro Micro, or genuine Yun board - in that case, the baud rate is meaningless and can be anything, but something must still be provided.
Also- p.available needs to be called out ahead someplace, right? It's getting hung on that too.
You probably went ahead and put the p.available() loop in your loop() function after calling runCurl(). The compiler does know about the available() function as it applies to the Process class (because you did the #include of Process.h.) What it's no doubt complaining about is that it doesn't know what the "p" object is. Inside the runCurl() function it's defined to be an object of the Process class, but that variable declaration does not extend outside of the runCurl() function. Therefore, the compiler doesn't know what type it is, doesn't know that it's a Process object, and therefore doesn't know that the available() function is available for that object.
The answer is to put that available loop at the end of runCurl(), after the p.run() command, and before the function's closing curly brace.