Skip to content

Conversation

@tyeth
Copy link

@tyeth tyeth commented Oct 27, 2025

This switches to using the file web api response to get the writable state, which is returned whenever the listDir api is used.

On the lilygo T-Display S3 the HTTP PUT failed due to not being writable, and the http response was something like "USB ACTIVE, try reseting board" or something like that, but the response text is not displayed in console nor to user.

Looking deeper, the PUT request should have been skipped, due to writable: false being part of the listDir response for "/".
Checking the current readOnly code, it checks for an HTTP OPTIONS query and inspects the returned methods for DELETE, which was present when my device was not writable. The JSON property was correctly returned.

This switches to using the /fs/ API check instead of relying on HTTP DELETE method being supported.

It's probably worth refactoring this into a class level flag thats updated with each listDir and then cached, until a disconnect event or failed write call at which point it's forcefully refreshed.

Calling like it currently does at each call of readOnly is actually fine (at least on a responsive wifi network).

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