Page 1 of 1

send file to server with esp32

Posted: Sat Jul 27, 2019 12:04 pm
by mehrdadco
hi
I'm working on a project that reads online data from sensors and sends them to a webserver(with post.req)
also, the data are saving in an sd card at the same time.

now I want to send the file that created in sd card to the webserver

is it possible

it would be great if someone can help me with the same example or any information

Thanks

Re: send file to server with esp32

Posted: Sat Aug 03, 2019 8:57 am
by mehrdadco
is it possible to convert a file to json?

I am trying to send a CSV file to my website

i can read a file at first and send the data on a file to my website but its not clean!

Re: send file to server with esp32

Posted: Mon Aug 05, 2019 3:37 am
by ESP_Sprite
I don't get your question? Your data is already saved as a csv to the filesystem, right? What's stopping you from stashing the contents of that csv in a post request and sending it over? What would be not 'clean' about that?

Re: send file to server with esp32

Posted: Sat Aug 24, 2019 1:09 pm
by mehrdadco
I don't know why I didn't receive any emails that you answered
sorry for delay
now because that i solved some of my issues i should change the question
1-the program send online data(ONE LINE DATA)
2-the data are saved at the same time in a csv file
3-issue- after 13kb file lengths (200LINE DATA) it can not be sent and i get this -3 that come from
HTTPC_ERROR_SEND_PAYLOAD_FAILED (-3)

my idea
1 - we may can seperate the content of the file in sd and then send it with post.req
2- looking for another way of sending

Re: send file to server with esp32

Posted: Mon Aug 26, 2019 2:17 am
by ESP_Sprite
Ah, gotcha, this is with the Arduino http client, right? If any, you could try to see if the native ESP-IDF http client has the same limitations; it may very well not have that. Alternatively, you could indeed cut up your data and e.g. post every n lines.

Re: send file to server with esp32

Posted: Tue Aug 27, 2019 1:38 pm
by mehrdadco
is it possible to send a N line of a file and then another N line of the same file?
for me i think its difficult to save a specific line in a file and then read after that