-1

I have Two Arduinos, One with the help of sensors it will dynamically updates in to my server database. Other Arduino, reads the stored contents from the server database and sends sms to phones.

Now, I have a text file in my server which updates dynamically for every 5 min - 10 min. I am trying to read that text file contents.

I want my server to be always connected, So It must be in setup() function. I want update only to my text file which dynamically changes, so it must be loop() function.

How to implement this ? Any Suggestion ?

  • Does the content change via web interface or with a sensor/other function on the Arduino? – Anonymous Penguin May 12 '14 at 20:36
  • Is the Arduino the server or the client? – Ignacio Vazquez-Abrams May 12 '14 at 21:11
  • I have Two Arduinos, One with the help of sensors it will dynamically updates in to my server database. Other Arduino, reads the stored contents from the server database and sends sms to phones. – Manihatty May 13 '14 at 12:22
  • Is your server actually running on an Arduino? – Peter Bloomfield May 13 '14 at 12:33
  • 1
    I want the server connection in setup() and In loop() I want to updated only current content in the text file. How to update the client.print("GET /current.txt"); dynamically in loop() – Manihatty May 13 '14 at 18:06
0

It's difficult to answer without details of how your server works.

If your arduino is simply connected to the server, the server could open the arduino serial port (e.g.: COM5: or /dev/ttyUSB0) and simply read data. The arduino would only need to serialWrite() data for the server to parse and store.

If your arduino is not connected but has ethernet support you could do a HTTP request to your server, and pass the data as a parameters to the request, e.g.:

http://your.server.ip/send_data?param1=10.3&param2=5.6&param3=foo

When your server processes this HTTP request, it appends param1, param2, param3 to that text file.

The arduino could also beam data back to your server via IR, or bluetooth, etc.

There's lots of ways to do this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.