Skip to content

Conversation

razvanphp
Copy link

@razvanphp razvanphp commented Sep 15, 2025

This bug was happening for big files in the LittleFS, specifically bigger than the max chunk size of 4096.

Here is the log before, where it was entering a loop and timed out after 6 MB uploaded:

[16:33:43][OCPP] [MO] Send: [2,"0d7b3dcc-40d7-3e73-543b-1365e315b46c","DiagnosticsStatusNotification",{"status":"Uploading"}]
[16:33:43][OCPP] [MO] debug (FtpMbedTLS.cpp:585):
[16:33:43][OCPP] RECV: 220 ProFTPD Server (HTB FTP Server) [18.x.x.x]
[16:33:43][OCPP] [MO] debug (FtpMbedTLS.cpp:619):
[16:33:43][OCPP] select user tmpqbqduay86vs5l
[16:33:43][OCPP] [MO] debug (FtpMbedTLS.cpp:438):
[16:33:43][OCPP] SEND: USER tmpqbqduay86vs5l
[16:33:43][OCPP] [MO] Recv: [3,"0d7b3dcc-40d7-3e73-543b-1365e315b46c",{}]
[16:33:43][OCPP] [MO] debug (FtpMbedTLS.cpp:585):
[16:33:43][OCPP] RECV: 331 Password required for tmpq[...]
[16:33:43][OCPP] [MO] debug (FtpMbedTLS.cpp:622):
[16:33:43][OCPP] enter pass xP***
[16:33:43][OCPP] [MO] debug (FtpMbedTLS.cpp:438):
[16:33:43][OCPP] SEND: PASS ***
[16:33:54][OCPP] [MO] debug (FtpMbedTLS.cpp:585):
[16:33:54][OCPP] RECV: 230 User tmpqbqduay86vs5l logged in
[16:33:54][OCPP] [MO] debug (FtpMbedTLS.cpp:625):
[16:33:54][OCPP] select directory /
[16:33:54][OCPP] [MO] debug (FtpMbedTLS.cpp:438):
[16:33:54][OCPP] SEND: CWD /
[16:33:54][OCPP] [MO] debug (FtpMbedTLS.cpp:585):
[16:33:54][OCPP] RECV: 250 CWD command successful
[16:33:54][OCPP] [MO] debug (FtpMbedTLS.cpp:628):
[16:33:54][OCPP] enter passive mode
[16:33:54][OCPP] [MO] debug (FtpMbedTLS.cpp:438):
[16:33:54][OCPP] SEND: PASV
[16:33:54][OCPP] [MO] debug (FtpMbedTLS.cpp:585):
[16:33:54][OCPP] RECV: 227 Entering Passive Mode (18,159,181,113,234,166).
[16:33:54][OCPP] [MO] debug (FtpMbedTLS.cpp:654):
[16:33:54][OCPP] request upload for Diagnostics_SNASTR2548_2025-09-15T13:33:49Z_1027442110.log
[16:33:54][OCPP] [MO] debug (FtpMbedTLS.cpp:438):
[16:33:54][OCPP] SEND: STOR Diagnostics_SNASTR2548_2025-09-15T13:33:49Z_1027442110.log
[16:33:54]Modbus error:228
[16:33:54][OCPP] [MO] debug (FtpMbedTLS.cpp:585):
[16:33:54][OCPP] RECV: 150 Opening ASCII mode data connection for Diagnostics_SNASTR2548_2025-09-15T13:33:49Z_1027442110.log
[16:33:54][OCPP] [MO] debug (FtpMbedTLS.cpp:664):
[16:33:54][OCPP] data connection accepted
[16:33:54][OCPP] [MO] debug (FilesystemAdapter.cpp:382):
[16:33:54][OCPP] File open successful: /tx-2-0.json
[16:33:54][OCPP] [MO] debug (DiagnosticsService.cpp:458):
[16:33:54][OCPP] upload diag chunk (4096B)
[16:33:54][OCPP] [MO] debug (FilesystemAdapter.cpp:382):
[16:33:54][OCPP] File open successful: /tx-2-0.json
[16:33:54][OCPP] [MO] debug (FilesystemAdapter.cpp:382):
[16:33:54][OCPP] File open successful: /tx-1-9.json
[16:33:54][OCPP] [MO] debug (FilesystemAdapter.cpp:382):
[16:33:54][OCPP] File open successful: /tx-1-8.json
[16:33:54][OCPP] [MO] debug (FilesystemAdapter.cpp:382):
[16:33:54][OCPP] File open successful: /tx-1-7.json
[16:33:54][OCPP] [MO] debug (FilesystemAdapter.cpp:382):
[16:33:54][OCPP] File open successful: /tx-1-10.json
[16:33:54][OCPP] [MO] debug (FilesystemAdapter.cpp:382):
[16:33:54][OCPP] File open successful: /sd-2-0-1.jsn
[16:33:54][OCPP] [MO] debug (FilesystemAdapter.cpp:382):
[16:33:54][OCPP] File open successful: /sd-2-0-0.jsn
[16:33:54][OCPP] [MO] debug (DiagnosticsService.cpp:458):
[16:33:54][OCPP] upload diag chunk (4096B)
[16:33:54][OCPP] [MO] debug (FilesystemAdapter.cpp:382):
[16:33:54][OCPP] File open successful: /sd-2-0-0.jsn
[16:33:54][OCPP] [MO] debug (FilesystemAdapter.cpp:382):
[16:33:54][OCPP] File open successful: /sd-1-10-1.jsn
[16:33:54][OCPP] [MO] debug (FilesystemAdapter.cpp:382):
[16:33:54][OCPP] File open successful: /sd-1-10-0.jsn
[16:33:54][OCPP] [MO] debug (DiagnosticsService.cpp:458):
[16:33:54][OCPP] upload diag chunk (4096B)
[16:33:54][OCPP] [MO] debug (FilesystemAdapter.cpp:382):
[16:33:54][OCPP] File open successful: /sd-1-10-0.jsn
[16:33:54][OCPP] [MO] debug (FilesystemAdapter.cpp:382):
[16:33:54][OCPP] File open successful: /reservations.jsn
[16:33:54][OCPP] [MO] debug (FilesystemAdapter.cpp:382):
[16:33:54][OCPP] File open successful: /ocpp-config.jsn
[16:33:54][OCPP] [MO] debug (DiagnosticsService.cpp:458):
[16:33:54][OCPP] upload diag chunk (4096B)
[16:33:54][OCPP] [MO] debug (FilesystemAdapter.cpp:382):
[16:33:54][OCPP] File open successful: /ocpp-config.jsn
[16:33:54][OCPP] [MO] debug (DiagnosticsService.cpp:458):
[16:33:54][OCPP] upload diag chunk (4096B)
[16:33:54][OCPP] [MO] debug (FilesystemAdapter.cpp:382):
[16:33:54][OCPP] File open successful: /ocpp-config.jsn
[16:33:54][OCPP] [MO] debug (DiagnosticsService.cpp:458):
[16:33:54][OCPP] upload diag chunk (4096B)
[16:33:54][OCPP] [MO] debug (FilesystemAdapter.cpp:382):
[16:33:54][OCPP] File open successful: /ocpp-config.jsn
[16:33:54][OCPP] [MO] debug (DiagnosticsService.cpp:458):
[16:33:54][OCPP] upload diag chunk (4096B)
[...]
16:34:52][OCPP] [MO] debug (FilesystemAdapter.cpp:382):
[16:34:52][OCPP] File open successful: /ocpp-config.jsn
[16:34:52][OCPP] [MO] debug (DiagnosticsService.cpp:458):
[16:34:52][OCPP] upload diag chunk (4096B)
[16:34:52][OCPP] [MO] debug (FilesystemAdapter.cpp:382):
[16:34:52][OCPP] File open successful: /ocpp-config.jsn
[16:34:52][OCPP] [MO] debug (DiagnosticsService.cpp:458):
[16:34:52][OCPP] upload diag chunk (4096B)
[16:34:52][OCPP] [MO] debug (FilesystemAdapter.cpp:382):
[16:34:52][OCPP] File open successful: /ocpp-config.jsn
[16:34:52][OCPP] [MO] debug (DiagnosticsService.cpp:458):
[16:34:52][OCPP] upload diag chunk (4096B)
[16:34:52][OCPP] [MO] debug (FilesystemAdapter.cpp:382):
[16:34:52][OCPP] File open successful: /ocpp-config.jsn
[16:34:52][OCPP] [MO] debug (DiagnosticsService.cpp:458):
[16:34:52][OCPP] upload diag chunk (4096B)
[16:34:52][OCPP] [MO] warning (DiagnosticsService.cpp:99):
[16:34:52][OCPP] Upload timeout or failed
[16:34:52][OCPP] [MO] info (DiagnosticsService.cpp:466):
[16:34:52][OCPP] FTP upload failure (2)
[16:34:52][OCPP] [MO] debug (DiagnosticsService.cpp:112):
[16:34:52][OCPP] end upload routine (no more retry)
[16:34:52][OCPP] [MO] verbose (RequestQueue.cpp:74):
[16:34:52][OCPP] front 5 len 0
[16:34:52][OCPP] [MO] Send: [2,"4f8a0792-f1af-7a97-1277-5e527e329e13","DiagnosticsStatusNotification",{"status":"UploadFailed"}]
[16:34:52][OCPP] [MO] Recv: [3,"4f8a0792-f1af-7a97-1277-5e527e329e13",{}]

now it works beautifully 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant