I am working on a gardening system with the Intel Galileo platform. I'm using local sensor data in combination with forecasts from openweathermaps. To display the results, I use Paraimpu to tweet if necessary. So far, so good. I'm now looking for a way to let my system react to incoming tweets that contain a trigger word. I managed to write a python script using Twython that checks for this trigger word. If there is a new tweet (within the last minute), the python script returns 1, if not 0.
[...]
if timedelta<triggertime:
erg = 1 #Neuer Tweet vorhanden
else:
erg = 0 #Kein neuer Tweet vorhanden
print erg
And here I'm stuck: When I call the python script itself, it works just fine. But when using the system function in the arduino code, I don't get the number, just some weird formatted stuff like: |cßBð¿ That's how I call the system function in my arduino code:
char* checkTweets() {
char result[1];
system("python /media/realroot/Files/tweetcheck.py > /media/realroot/result.txt");
FILE *tempFile;
tempFile = fopen("result.txt", "r");
fgets(result, 1, tempFile);
fclose(tempFile);
return (result);
}
I'm not very experienced in the Arduino / Python Interface. Thanks for any suggestions!