feat: initial stab on posix system support #20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prelude
This is my initial stab on getting the flash tool working on Posix-based systems. I had to make some minor changes to the UI (less flashing steps involved, since most is handled on the Rust side now), but overall it is working!
This definitely needs testing on Windows and potentially Mac, but I can't do that since I own neither :)
For anyone who did not follow discussions on Discord:
I initially tried to leave serial communication in place in the web view and just create a WebSerial wrapper, but that turned out to be quite a buggy experience, especially since
esptool-js
had some bugs on its own which gave me false-negative results. In the end I decided to move all serial communication, including the flashing itself to Rust, usingserialport-rs
andespflash
crates respectively.Work left to do
What's missing right now, and I seriously tried, but I had some issues with SolidJS, never worked with this framework before: Port selection. I'd hope that someone can pick this up and integrate the UI for that. It shouldn't be too much work, here's how it could work:
epsApi.availablePorts()
, which will return a list of ports; this always includes the port name, VID and PID. Additionally it can, based on the device, include manufacturer, product and serial number.VID:PID
.@todo
tag.Right now all port names in those places are hardcoded to
/dev/ttyACM1
, which was where my device is located. If you test this on your end without port selection being done, you need to adjust those values accordingly.I couldn't test the Wifi settings command here, but it's sending the same JSON format as before, so it should work, but someone should try it out.
Deprecation
I think the
containers/OperatingSystem
component can be scrapped completely at this point, but for now I only removed the Linux check.Notes:
On Linux, and probably Mac, the user needs to be in the
dialout
group in order to directly communicate with serial ports.