ESP8266 Module log data to network drive

Hi all.... I dont know about you, but I have seen my share of esp8266 forum posts, so apologies for yet another.

I have a few questions - the first is feasability. I have torn into google tooth and nail to find a similar project, yet I cannot find anything.

What I am trying to accomplish is to use the ESP8266 (ESP-01) module to connect to my companies accesspoint, access a common shared folder in a server on our domain, and log to a text (or excel) file.

I have seen a lot about html pushes using esp8266, yet I have no idea how they work - or if they can accomplish what I am trying to do.

Alternatively, I could use the esp module to send a txt file which is in a microsd card reader attached to the arduino which is already logging data just fine in csv format.

TL:DR/I want to get ESP8266 ESP-01 to connect to companies AP, and either send txt file or string line containing data in csv format ("data1,data2,data3...") to either a text or excel file on a drive in my companies network (in a server on our domain).

Thanks in advance, you all are champions if you can help me even slightly

This is on an Arduino Mega 2560, btw - the data string would just be inputs from various peripherals such as load cells, water sensors, temperature probes etc (all which are working and displaying fine)

I'm definitely not a pro on this...

but my initial though is...... 'no'..

You would need to connect/send this date to 'something' (like a server side script.,.. ie: php file) that takes the data and creates/saves the text file for you.

Most likely would need some sort of local web server running.. (like installing WAMP/LAMP on some machine that is located on said network)

I'd say it's probably possible but it depends on the receiving end - primarily the communication protocol expected by the server.

So ideally, we have a test pc setup next to a test frame, I would like to send to that computer. It runs most of our tests, and logging these tests there would be ideal. It is always on and would just need to receive the data. If not this, sending it to the shared drive would be a close second.

Thats my point.. what server? Did I miss something?

Connecting to a network/AP doesnt mean there is any web server at all.. (or end point to send data to).. the ESP can NOT create a text file.

Edit: we posted at same time...

Install WAMP on your 'text PC'.. and use that to send data to a PHP that will in turn create/save the text file to you desired directory.

xl97:
the ESP can NOT create a text file.

It can just fine. It's even got it's own on-board file system (SPIFFS) to store files.

Really? (I was not aware of this)

Can you show/share some links on how this is done?

I wasnt aware that an ESP had the ability itself to create and save a text file by itself to a directory on some network.

I understand it can use SPIFFS as a local file system... to save/load data/images..etc (like when hosting its own webpage..or logging data to an internal/local .txt file......etc)

But I'm not referring (nor do I think the OP is as well) about creating/saving a .txt file to itself.. but on his LAN somewhere..

The ability to saving files to a directory on a network also depends on the server, what it has available.

There exist ftp clients for the ESP8266, that allows you to read/write files directly. I've also seen applications of using an ESP8266 as file server by itself. I've also had one do the opposite: read plain text files from the network and storing it on its local SPIFFS storage.

Thats exactly what I stated then.

You need 'something' to capture/parse/create/save this text file on the network.

  • install WAMP/LAMP on the machine that is on this network (and have a server side script to the work)
  • possibly to perhaps use a terminal program such as Putty...etc..

An ESP can -not- by itself create a text file and save it to the 'pc' as the OP stated.

So, to clarify, if I have some data string, could I in theory push it using html and receive using a PHP script or Putty on a network PC? I figured I could do something like this, could the receiving pc update real time some text or excel file?

If this is possible, what kind of library would I use to push the html requests? Ive seen the ESP8266WiFi is for configuration and that ESP8266wifi is for actual communication... This has confused me for a while considering most people seem to use the ESP8266 12E as their board while Im using the mega to run the ESP-01 and numerous other Arduino peripherals. What library could run all of this data capture (through serial and digital ports) and then push the data string to html?

Thank you guys very much for investing your time!
Matt

The ESP would have to initiate an http connection, through the ESP8266HTTPClient or WiFiClientSecure libraries, then create a POST request to send the data to your server.

Then on the server side your web server has to initiate some script that knows what to do with your data. Remember: data is data, format and (file) type is irrelevant at that point.

wvmarle:
The ESP would have to initiate an http connection, through the ESP8266HTTPClient or WiFiClientSecure libraries, then create a POST request to send the data to your server.

Then on the server side your web server has to initiate some script that knows what to do with your data. Remember: data is data, format and (file) type is irrelevant at that point.

^ this.
You can use your ESP to send some data to a PHP (or whatever) script that is running on your target PC..
Your target PC needs to be runnign some sort of 'web server' type software (which is why I recommended WAMP)..
Your PC and hence localhost will have an IP that use when sending data to the PHP script..
Form that point.. you can do what you like with it..

  • log to a database
  • create/update a text file..etc..etc