Read from php script


I have a php script that fetches from an external sql database and echoes an integer depending on if new data has been found. It runs fine from /mnt/sda1.

I need this script to run every 5 seconds, and I need the Atmega-side to be alerted if there is new data.

My question is how I do this the right (most smooth, fastest) way.

Should I have the Atmega-side running the script in a process and fetch he integer each time? How do I fetch the data here? I only know how to run a process with parameters, but now how to get anything in return.

Can the linux-side run the script and then just alert the Atmega-side when there is new data?

Another way?

Thank you :slight_smile:

I'd call a process each 5 secs from arduino witht proccess library (start a script on linux side called from atmega). For more info check the process examples.

Thanks :) It works perfectly!