T
In case someone else comes across this post looking for help:
I solved the issue by using a different third party FTP library that was suggested to me on the Stack Overflow post I made:
https://stackoverflow.com/questions/67011710/ftpwebrequest-to-microcontroller-always-results-in-451-local-error-in-processi/67079870#67079870
Not exactly sure what the underlying issue was, it might've been that the fipy explicitly wants you to change your working directory to the flash directory before uploading or it might've been something else in the library that handled it better. Either way, my FTP log now more closely matches the one from FileZilla and no more errors!
My New Code:
FtpClient client = new FtpClient("ftp://192.168.4.1");
client.Credentials = new NetworkCredential(UserId, Password);
client.DataConnectionType = FtpDataConnectionType.PASV;
client.Connect();
client.SetWorkingDirectory("/flash");
client.UploadFile(appFilepath, "rwis_config.py", FtpRemoteExists.NoCheck);
client.Disconnect();
New FTP Log Output:
# Connect()
Status: Connecting to ***:21
Response: 220 Micropython FTP Server
Command: USER ***
Response: 331
Command: PASS ***
Response: 230
Command: FEAT
Response: 211 no-features
Status: Text encoding: System.Text.ASCIIEncoding
Command: SYST
Response: 215 UNIX Type: L8
# SetWorkingDirectory("/flash")
Command: CWD /flash
Response: 250
# UploadFile("rwis\rwis_config.py", "rwis_config.py", NoCheck, False, None)
# OpenWrite("rwis_config.py", Binary)
Command: TYPE I
Response: 200
# OpenPassiveDataStream(PASV, "STOR rwis_config.py", 0)
Command: PASV
Response: 227 (192,168,4,1,7,232)
Status: Connecting to ***:2024
Command: STOR rwis_config.py
Response: 150
Status: Disposing FtpSocketStream...
Response: 226
Status: Testing connectivity using Socket.Poll()...
Command: QUIT
Response: 221
Status: Disposing FtpSocketStream...