I am working on a project where an esp32 takes Voltage and current sensor data of a house. I am storing these sensor values in a text file(CSV format) in the esp32 internal flash memory. I want to transfer the CSV file my PC via LAN/Wifi/COM(Priority-LAN -due to distance issues) so that I can perform further analysis on them.

Can we access PC's filesystem using micropython? How can i attempt to transfer files via wired/wireless medium to PC hard disk?

If you can live with initiating the transfer from the PC side (it sounds like you want the opposite), the WebREPL is the easiest way to transfer files wirelessly from and to ESP boards, using either the HTML or command-line client.

If you need to initiate the transfer from the microcontroller side, then some kind of HTTP POST would probably be easiest, but I have no experience with that.

To transfer files over a serial connection (also initiated from the PC side), there are several options, rshell and ampy being among the more popular ones.

If you would rather transmit measured data continuously than collect it in a file, look into MQTT.

This sounds like it would be really useful for the device-initiated case described here?

Yes, you are right, if the PC can be online all the time that could be used too.

No, I haven’t spent any time on it since then. I did get a little farther than the comment you quote – it does work over a serial connection now – but got stuck on making it work over WebREPL, see two comments down. Let’s see if I can make some time for that…

Have you considered sending the data using MQTT in real time?
I am doing something similar with temperature readings, using Node-Red to receive the MQTT messages and pass them to an InfluxDB database for analysis with Grafana.
I was pleasantly surprised how easy it is to set up MQTT on MicroPython.

If you can live with initiating the transfer from the PC side (it sounds like you want the opposite), the WebREPL is the easiest way to transfer files wirelessly from and to ESP boards, using either the HTML or command-line client.

If you need to initiate the transfer from the microcontroller side, then some kind of HTTP POST would probably be easiest, but I have no experience with that.

To transfer files over a serial connection (also initiated from the PC side), there are several options, rshell and ampy being among the more popular ones.

If you would rather transmit measured data continuously than collect it in a file, look into MQTT.

I was trying a microcontroller initiated transfer. I was thinking about storing it into files so that i can arrange the data day wise and so on.