Skip to content

Conversation

ericzundel
Copy link
Contributor

@ericzundel ericzundel commented Jul 26, 2025

This PR attempts to provide user friendly feedback during the USB connection using WebSerial and selecting a filesystem mount point.

image

I worked on this PR when noticing some hiccups when trying to connect my microprocessor via USB. See #327, although it's not a great solution to the read-only issue as the element I created to show status isn't visible after the connect part of the workflow finishes.

Copy link
Collaborator

@makermelissa makermelissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. This is great. I'd like to see the status message functionality available for all of the workflows. Would this be too much trouble to update it?

@ericzundel
Copy link
Contributor Author

I just tried the Web workflow. This is mysterious to me! I did get it to work after a few tries and filed issue 370. However, I confess that I don't yet understand how the redirection to the microprocessor's port 80/code/ URL works. Does the microprocessor proxy to http://code.circuitpython.org/ to get the UI? I can see the UI as a part of this codebase, surely it isn't all compiled into circuitpython executable?

For the purposes of this PR, It isn't clear to me that anything can go wrong in the current web workflow that can be made visible to the user. If you can't connect to the uP IP address:80/code/ you just get a timeout from the browser.

I'll look at BLE next.

@ericzundel
Copy link
Contributor Author

I think I can add the status calls to the BLE workflow. I filed a couple of bugs, I'll try to submit any fixes for those I find along the way (like adding a link to the online documentation)

- Removed some catching of exceptions inside the workflow
  to catch at outer function so we can report.
- Added an element to the dialog to hold status messages.
- Catch and analyze exceptions to print user friendly
  messages if possible.
@ericzundel ericzundel force-pushed the zundel/usb-readonly-update branch from 1487720 to 90c157b Compare September 8, 2025 18:28
Make all workflows able to use the connect status area in the modal
connect dialog.

- Replicated the connect status section to all workflows in index.js
- Updated a few places where showMessage() is used to use
  showConnectStatus() instead.
- Added some calls in the BLE workflow to take advantage of
  showConnectStatus()
Added note about how to connect via wifi via IP address if
.local dns resolution doesn't work.
@ericzundel
Copy link
Contributor Author

I've added changes to support all workflows, although I didn't see an opportunity to add something to the web.js workflow, as I mentioned.

I addressed the issues I logged for issue #370 and issue #371

@makermelissa
Copy link
Collaborator

I just tried the Web workflow. This is mysterious to me! I did get it to work after a few tries and filed issue 370. However, I confess that I don't yet understand how the redirection to the microprocessor's port 80/code/ URL works. Does the microprocessor proxy to http://code.circuitpython.org/ to get the UI?

Yes, that's exactly what it does. The device code contains a very basic page and uses https://github.com/circuitpython/web-editor/blob/main/public/assets/js/device.js to bootstrap the rest of website. This makes it very maintainable and tricks the browser into thinking the code is running on the device because the devices don't currently support https for web workflow.

I think I can add the status calls to the BLE workflow. I filed a couple of bugs, I'll try to submit any fixes for those I find along the way (like adding a link to the online documentation)

Thank you

Copy link
Collaborator

@makermelissa makermelissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thank you.

@makermelissa makermelissa merged commit de34003 into circuitpython:main Sep 9, 2025
1 check passed
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.

2 participants