element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum read data in text file on arduino
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 10 replies
  • Subscribers 401 subscribers
  • Views 1779 views
  • Users 0 members are here
  • arduino_duo
  • change_i/o
  • .txt
  • fpt
  • arduino
  • seeed_wifi
  • text
Related

read data in text file on arduino

Former Member
Former Member over 12 years ago

Hi all

 

in my project i am using a Arduino Duo and Seeed Wifi shield. i want to recive .TXT(text) file from FTP server and read the data inside it.

the data is basically instructions for my arduino to manipulate I/O

How can i do this

please guide

  • Sign in to reply
  • Cancel

Top Replies

  • Former Member
    Former Member over 12 years ago in reply to Former Member +2
    Hi Anand, Check these examples for webclient on arduino. http://arduino.cc/en/Tutorial/WiFiWebClient ( single request ) http://arduino.cc/en/Tutorial/WiFiWebClientRepeating ( poll method ) for this project…
  • shabaz
    shabaz over 12 years ago in reply to Former Member +1
    Its on page 75 of their reference guide (google wifly user manual, first hit).
  • shabaz
    shabaz over 12 years ago in reply to Former Member +1
    Hi Anand, The server listens, it will respond to requests from the client RN-171. You pass the information you desire in the server response. If you don't know when the server has information to supply…
Parents
  • phoenixcomm
    0 phoenixcomm over 12 years ago

    you are going to have to devise a protocol.

    that is what a message will contain.

     

    Read my blog posts of protocol design.. there are 4 post that will be helpful.

    http://www.element14.com/community/people/phoenixcomm/blog/2013/02/15/nexgen-rss-continued-the-protocols

    parts 1, 2, & 3

    and

    http://www.element14.com/community/people/phoenixcomm/blog/2012/12/29/flight-simulator-101-or-back-to-college-part-v--protocols parts 1 & 2

     

    and why do you want to use ftp??? how far away are the two devices? FTP means that you are going to use the Ethernet shield

    you can do it easier if you just use serial communication ala RS232 with level shifters.. or virtual Com port over USB..(painless)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to phoenixcomm

    thanks for the reply but designing a protocol is not in my capablities. althought i have a alternative idea.

    I am using seeed wifi shield with arduino uno.

     

    i want to read data from a webserver to change status of digital pin of arduino board.

     

    for eg. i have connected a LED to my arduino board and connected the seeed wifi shield, so i want to be able to turn on and turn off the LED from internet using a web site.

     

    how does the wifi shield receive data from web server???

     

    please guide

     

    P.S. seeed wifi shield based on RN-171

     

    regards

     

    Anand Vartak

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to Former Member

    it says in the datasheet of RN 171 that it supports HTTP client to send and recive data from a web server but there is no information about how to get data from the web server. The datasheet only describes posting data on web server.

    please help.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 12 years ago in reply to Former Member

    Its on page 75 of their reference guide (google wifly user manual, first hit).

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to shabaz

    actually i had been through that datasheet but i could not understand how things are happening. i dont know much HTML. can u tell me how the web server makes connection to the module? do i have to first connect the web server as client and then keep the port open for the web server to communicate back.

    can u explain the process to me

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 12 years ago in reply to Former Member

    Hi Anand,

     

    The server listens, it will respond to requests from the client RN-171. You pass the information you desire in the server response.

    If you don't know when the server has information to supply, then you can periodically poll the server with requests from the client. This is not always an appropriate method but it's the easiest and most likely to work for you with the built-in functionality in your device. If you want to learn this in detail, look for http via google.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to shabaz

    hi shabaz,

     

    given my hardware configuration what is the best method for turning on an LED from internet.

     

    you said the server listens and sends response, is it possible to send a user defined response

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to Former Member

    Hi Anand,

     

    Check these examples for webclient on arduino.

     

    http://arduino.cc/en/Tutorial/WiFiWebClient  ( single request )

    http://arduino.cc/en/Tutorial/WiFiWebClientRepeating  ( poll method )

     

    for this project to succeed you need to learn atleast basics of how a webserver/browser communicate.

     

    mostly you will need the commands GET and host: and the server response

    https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol

     

    After getting a document on the server you wil need to cut some lines from the input to get to the values, even if the webserver hosts only a simple txt file.

     

    hope this helps

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 12 years ago in reply to Former Member

    It's a server, it will serve up anything you wish but the format will (should) be a valid formatted response. It's basic http. Hint: read up on HTTP GET method and 200 OK. The response from the server you can search using your arduino for any appropriate text - just depends on how good you are at parsing the response. Given limited RAM, Arduino's are not really geared for this but people do manage to get by - and your RN-171 may store the packet (I don't know). As mentioned earlier, you'd need to periodically poll to query the server.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to shabaz

    i have been in contact with the seeedstudio tech support guys and even they dont have anything to say about the http connection. i am successful in creating a tcp socket in java. now trying to integrate it with my web server. my friend is helping me with it.

     

    can anyone suggest a better hardware for wifi. the arduino wifi shield is a great option i guess but its too costly

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Former Member
    0 Former Member over 12 years ago in reply to shabaz

    i have been in contact with the seeedstudio tech support guys and even they dont have anything to say about the http connection. i am successful in creating a tcp socket in java. now trying to integrate it with my web server. my friend is helping me with it.

     

    can anyone suggest a better hardware for wifi. the arduino wifi shield is a great option i guess but its too costly

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube