0

I have Arduino UNO with Adaruit wifi shield. I store some data on the sd card successfully and now I need to import that data on to the computer.

I am sending some token, say "1", to the UART port of Arduino (COM port), there is a code written on the Arduino which responds to that token and sends data (byte by byte) in the bulk amount on the serial of the Arduino. I have to accept bytes and store in a file on the local machine (computer) and upload to the server ultimately at the same time.

(It will be good if the process has the browser support i.e I will send request from web browser to API and that API will connect to serial port/ COMP port of my Computer and somehow the file will be created on the local machine and the data from the Arduino will be saved in that file; the file created will be uploaded to the server ultimately.)

What is the proper way to this, is there any API or software for it?

Please help me out.

Thanks in advance!

0

There is an example for the ESP8266 (using the Arduino IDE) called SDWebServer which might give you some ideas, I would suggest you try it but I doubt the libraries would work on an Arduino.

If you are going to support a web API, I would suggest you implement a REST API on the Arduino, that is a commonly used API for these type of things.

  1. The client (PC) sends a HTTP GET request to the server (Arduino) with the token you want.
  2. The server responds with the data the token corresponds to.

You are using standard HTTP (you can do it through a browser), so it should go through firewalls without a problem. Its a very common format, there are plenty of tools to debug it and tutorials for all sorts of platforms that you should be able learn from.

The problem is REST API isn't the best solution for Serial comms, I'm not saying its impossible you could send the network messages via serial, but it wouldn't be pretty. I think you would be better keeping your custom interface for the serial and moving as much of the code into common functions so you can share it between the two interfaces.

Hope that helps

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.