-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature request: Webusb dfu and github artifacts api integration #236
Comments
If it's possible it's beyond me. I understand it relies on WebUSB which isn't support in Firefox and therefore not something I've explored. Do you know that this supports UF2? If it's as simple as discovering/opening a USB device and feeding in the file data then that sounds doable (but a PoC would be super helpful). ZMK has gotten started on work for ZMK Studio which will support runtime keymap updates (no compilation needed) which people have been looking forward to for some time and may be available before I can get much done here. |
sorry my bad, the file system api example i copied for trying it out was for text files. updated it to handle binary stream and it worked... <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>test</title>
</head>
<body>
<input type="file" id="fileInput">
<button id="saveBtn">Save to Different Folder</button>
<script >
document.getElementById('fileInput').addEventListener('change', handleFileUpload);
document.getElementById('saveBtn').addEventListener('click', saveFileToDifferentFolder);
let fileContent;
let fileName;
async function handleFileUpload(event) {
const file = event.target.files[0];
if (file) {
fileName = file.name;
fileContent = await file.arrayBuffer();
alert(`file "${fileName}" uploaded successfully.`);
}
}
async function saveFileToDifferentFolder() {
if (!fileContent) {
alert('please upload a file first.');
return;
}
try {
const handle = await window.showDirectoryPicker();
const fileHandle = await handle.getFileHandle(fileName, { create: true });
const writable = await fileHandle.createWritable();
await writable.write(new Uint8Array(fileContent));
await writable.close();
alert('file saved');
} catch (error) {
console.error('Error:', error);
}
}
</script>
</body>
</html> we could store the location to localstoage, so user only have to pick location one time, but here also the issue issues are;
(for temporally getting secure context i used http://localhost.run to a make ssh tunnel to get link with tsl ) |
so better to wait for zmk studio :) |
Thanks for this wonderful project
I came here to ask if it is possible to directly flash firmwire to keyboard from webeditor?
i know i can have a local set up for making the interation easier, but it's seems even more convient..
will it be possible to integrate
https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28
https://devanlai.github.io/webdfu/dfu-util/
i was thinking of trying to impliment it myself, but i came to realize that repo is no longer open source :( , though i can make a poc website and share it here...
The text was updated successfully, but these errors were encountered: