- Jun 6, 2020
- 11,559
- 4,422
Hi all,
this is a code snippet but even an help request to improve it, so I post here.
For my 3D printing app host I had necessity to transfer files from Android to ESP8266-ESP32 micro sd card (over network).
Because I don't wanted to use an FTP library on ESP side to just upload a file, I wrote a raw code that read a file in chunks and then
send one by one using a TCP socket.
Because I even want to pass some infos from Android to ESP before send a file I send an info string that contain some variable I want to pass,
it even contain a file name, size etc... and other variables I've put here just as an example, you can put yours.
This worked well for a long time, now I've changed something and sometime the transfer fails,
sometime Android (TCP CLIENT) send info string and ESP (TCP SERVER) do not receive it or receive but then do not receive a file chunks,
when this happen sometime Android app completely stall, no errors, completely hang, the only way is to use Android menu to...
this is a code snippet but even an help request to improve it, so I post here.
For my 3D printing app host I had necessity to transfer files from Android to ESP8266-ESP32 micro sd card (over network).
Because I don't wanted to use an FTP library on ESP side to just upload a file, I wrote a raw code that read a file in chunks and then
send one by one using a TCP socket.
Because I even want to pass some infos from Android to ESP before send a file I send an info string that contain some variable I want to pass,
it even contain a file name, size etc... and other variables I've put here just as an example, you can put yours.
This worked well for a long time, now I've changed something and sometime the transfer fails,
sometime Android (TCP CLIENT) send info string and ESP (TCP SERVER) do not receive it or receive but then do not receive a file chunks,
when this happen sometime Android app completely stall, no errors, completely hang, the only way is to use Android menu to...
برای دیدن لینک ها باید ثبت نام کنید
برای دیدن لینک ها باید ثبت نام کنید