0

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 ?

asked May 12, 2014 at 20:26
7
  • Does the content change via web interface or with a sensor/other function on the Arduino? Commented May 12, 2014 at 20:36
  • Is the Arduino the server or the client? Commented May 12, 2014 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. Commented May 13, 2014 at 12:22
  • Is your server actually running on an Arduino? Commented May 13, 2014 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() Commented May 13, 2014 at 18:06

1 Answer 1

1

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.

answered Jun 25, 2014 at 7:48

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.