Skip to content

Feature request: communicate via serial port using WebUSB API #47

@askvictor

Description

@askvictor

It would be super useful to have the same place to access the device via a WebREPL if that has been set up, or directly via a serial port if it hasn't. The WebUSB API (https://developers.google.com/web/updates/2016/03/access-usb-devices-on-the-web) can be used for this; albeit it only has the single data channel unlike websockets where multiple data channels are possible.

Going even further, it would be nice to be able to flash the Micropython firmware onto a device directly from such a website.

One potential problem is that WebUSB requires an HTTPS connection, while the current WebREPL cannot have one.

Activity

rikvermeer

rikvermeer commented on Oct 31, 2021

@rikvermeer

It will only work on devices having a second USB port for this, that you have to control. My micropython esp32 is instantly serving as a serial connection, nothing else.

rafaelaroca

rafaelaroca commented on Feb 19, 2022

@rafaelaroca

I have implemented this feature in 2020 but only saw your message now. It has a pending pull request here:
#53

You can get it here:
https://github.com/rafaelaroca/webrepl

Anyway, if you can see it working on BIPES project at the console tab:
https://bipes.net.br/beta2/ui/

About directly flashing MicroPython from the web browser, we have this page fully functional!
https://bipes.net.br/flash/esp-web-tools/

Just go to the link, connect an ESP32 or ESP8266, click Install, wait, and you'll have MicroPython on the board!

regards
Rafael

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @askvictor@rikvermeer@rafaelaroca

        Issue actions

          Feature request: communicate via serial port using WebUSB API · Issue #47 · micropython/webrepl