[micropython tutorial] {ESP32} Using FTP for file synchronization in MicroPython[Copy link]
This post was last edited by 47857872 on 2018-6-14 11:57 Currently, most ESP32 modules on the market communicate with PCs through the virtual serial port of CP2012. Therefore, the file upload and download in ESP32 is highly dependent on small software such as uPyLoader. The principle is to run a file operation program in ESP32 to communicate with the computer through the serial port. Here I will introduce another method, which is to use the network communication function of ESP to connect to wifi and use the FTP method for communication. (Actually, I have to use FTP, because after recording relatively large test data, uPyLoader cannot read large files. I recorded the files for two days and the size is close to 1MB...) First, you need to flash the updated firmware below, which is based on loboris. I usually only use ftpsvr websvr telnetsvr and other functions. I have used them for general purposes. The update method is a little different from the official firmware, you need to: 1. erase flash 2. esptool.exe --chip esp32 --port COM8 --baud 921600 --before default_reset --after no_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 bootloader/bootloader.bin 0xf000 phy_init_data.bin 0x10000 MicroPython.bin 0x8000 partitions_mpy.bin Or use ESPFlashDownloadTool 12, 01, 01, 12, 12, 12)) rtc.ntp_sync(server= "", rst = machine.rtc() rtc.init((2018, 01, 01, 12, 12, 12)) rtc.ntp_sync(server= "", rst.init((2018, 01, 01, 12, 12, 12)) rtc.ntp_sync(server= "", rst.init((2018, 01, 01, 12, 12, 12)) rtc.ntp_sync(server= "", rst.init((2018, 01, 01, 12, 12, 12)) rtc.ntp_sync(server= "", tz=my_timezone, update_period=3600) time.sleep(5) print(rtc.now()) network.ftp.start(user="micro", password="python", buffsize=1024, timeout=300) network.telnet.start(user="micro", password="python", timeout=300) print("IP of this ESP32 is : " + sta_if.ifconfig()[0]) [/code] These two are programs. There is no psRAM in the general node esp32, so just use the first one
MicroPython_LoBo_esp32_all.zip(1.13 MB, downloads: 75)