WebUSB Problems

I was following another WebUSB thread as I’m running into a similar issue. However, I did a number of new things that I’ve not tried before that might be stalling me out.

Firstly, I’m using OS6.9 for the first time. Secondly, I’m using BladeDetect for the first time, so I’ve got duplicates of all my presets, but with the blade-in settings, I’m just using it to turn of several of my 11 blades and subblades for accents that wouldn’t be visible if the grip was on, etc. Thirdly, I’m using Fernando’s “using function” to have only a few bladestyles with some options that can be enabled and disabled.

I’ve confirmed all the above new functions work, so now I was going to use WebUSB to alter my preset colors and options so that the bladestyles would be different, but I cannot get into the website. I’ve followed some of the above advice, but nothing seems out of the ordinary.

I’ve eliminated the OS version as an obstacle by using my same config and just installing OS6.7. But I can’t really tell if the other two items are potential blocks. I can get the website to see the board, but I cannot get into it. I’ve tried to change some things in Edit Mode (from the saber itself), and check what’s updated on the presets.ini file…but I only see half of the presets. Yet, the updates I made affected both blade-in and blade-out presets of the same name/fonts/etc. So, my guess is the use of either or both BladeDetect and/or Using is making things difficult in WebUSB.

Any insight, reference material, or direction would be appreciated. I’ve uploaded one of the configs I’ve tried.
dk_starkiller_config_11_blades.h (65.9 KB)

What browser are you using?
If you right click somewhere and choose “inspect element” or something similar, then choose “Console” in the dev tools window, you can see if there are any red error messages while you use the page and report them here.

I tried in both Chrome and in Edge:

Chrome:

Service Worker Registered
sw.js:22 [ServiceWorker] Install
sw.js:26 [ServiceWorker] Caching app shell
app.html:1541 VERSION: $Id: a8791dbba17919247947abc910099ae8d5838cfc $
app.html:1542 03/10/2022 23:17:02
sw.js:33 [ServiceWorker] Activate
app.html:1307 USBAlternateInterface
app.html:1307 USBAlternateInterface
app.html:1307 USBAlternateInterface
app.html:1307 USBAlternateInterface
app.html:1322 OUT EP 5 IN EP 5
2sw.js:58 [Service Worker] Fetch https://profezzorn.github.io/lightsaber-web-bluetooth/app.html
sw.js:58 [Service Worker] Fetch https://profezzorn.github.io/lightsaber-web-bluetooth/manifest.json


Page layout may be unexpected due to Quirks Mode
One or more documents in this page is in Quirks Mode, which will render the affected document(s) with quirks incompatible with the current HTML and CSS specifications.
Quirks Mode exists mostly due to historical reasons. If this is not intentional, you can add or modify the DOCTYPE to be `<!DOCTYPE html>` to render the page in No Quirks Mode.
1 element
Document in the DOM tree	Mode	URL
document	Quirks Mode	https://profezzorn.github.io/lightsaber-web-bluetooth/app.html
Learn more: Document compatibility mode

Edge:

[Service Worker] Fetch https://profezzorn.github.io/lightsaber-web-bluetooth/app.html
sw.js:58 [Service Worker] Fetch https://profezzorn.github.io/lightsaber-web-bluetooth/Starjedi.ttf
app.html:1541 VERSION: $Id: a8791dbba17919247947abc910099ae8d5838cfc $
app.html:1542 03/10/2022 23:17:02
app.html:356 Service Worker Registered
sw.js:58 [Service Worker] Fetch https://profezzorn.github.io/lightsaber-web-bluetooth/manifest.json
sw.js:58 [Service Worker] Fetch https://profezzorn.github.io/favicon.ico
/favicon.ico:1 
        
        
        Failed to load resource: the server responded with a status of 404 (Not Found)
sw.js:58 [Service Worker] Fetch https://profezzorn.github.io/lightsaber-web-bluetooth/icon-256.png
app.html:1307 USBAlternateInterface
app.html:1307 USBAlternateInterface
app.html:1307 USBAlternateInterface
app.html:1307 USBAlternateInterface
app.html:1322 OUT EP 5 IN EP 5
app.html:1342  Uncaught (in promise) DOMException: Failed to execute 'claimInterface' on 'USBDevice': Unable to claim interface.
sw.js:58 [Service Worker] Fetch https://profezzorn.github.io/lightsaber-web-bluetooth/app.html
sw.js:58 [Service Worker] Fetch https://profezzorn.github.io/lightsaber-web-bluetooth/manifest.json

edit: didn’t know rules about screenshots, so tried to copy/paste what I saw

additional messages in Edge:
additional edge errors

edit: apologies about ignorance of screenshot rules; I couldn’t copy/paste additional error message into text format, so uploaded screenshot to imgur.

further edit: The main standout in the additonal errors seems to be this:

Uncaught (in promise) DOMException: Failed to execute 'claimInterface' on 'USBDevice': Unable to claim interface

Which I guess means my drive gets hung up communicating to the webpage?

Moved this to a new thread.
I will try to help once the screenshot violations are fixed.

apologies. I updated the responses, but couldn’t select the text of the additional errors.

If you can’t cut-n-paste then screenshots are ok.
(But please add a note saying that you tried cut-n-paste.)

It could also mean that there is another tab or program that has already claimed the interface.

If it’s simply Windows 10 OS, how would I ensure the browser could claim it? I can’t close Windows Explorer, which I assume is the only other app trying to keep access open to it. I’ve closed other browsers and apps that would possibly be accessing the drive.

Windows 10 wouldn’t do it by itself.
It may be some driver or app that you have installed that’s doing it though.
Not sure if there is any way to tell who/what has claimed an interface.

I’ve tried a number of things, most recently fully formatting the card with SD Association app recommended from other threads, and reflashing the config a number of times and different ways. However, I can’t get any browser to behave with this particular saber and the way it’s set up. I’m moving on. Just going to go a different route with my config and presets. I’ve already spent the entire day programming and testing and re-editing my code. I can’t justify spending anymore time using the methodologies I’d hope to.

I’ve no doubt you’re right, that something about my setup is causing the issue, but I can’t seem to pinpoint the particular cause. In the middle of coding a different config the entire machine just bugged out, and had to restart. I got Windows to admit there was a problem with the drive, upon reboot, but it didn’t do anything after running its checks/repairs. That’s when I decided to re-format the drive. It just keeps hanging up and the WebUSB app error messages still indicate “Failed to Open USB device”.

1 Like

It seems like this has been the case with several of my posts. My work computer sucks.

But I greatly appreciate both of you for your help and time.

But it works for other boards?
(Which is weird, I would either expect it to work for all boards, or none of them.)

Yes. I literally used WebUSB days ago for a different installation. However, because it is a work computer…it’s possible an operating system or other kind of update was pushed after hours, but is highly unlikely. Chrome has updated a few times since then, but I never use Edge, and it had the same issues. So…might be a board issue? I assumed with the new tricks I was employing in my config, that it was a config issue.

I just plugged my prototyping rig up and it worked like gangbusters… maybe I should flash the config on it and try connecting. nothing is wired the same, but that shouldn’t matter.

edit: just tried that…config is fine. So, my best guess is a bad SD card or issue with the board. my test rig took the config fine, and WebUSB opened right up without delay…why didn’t I think about this yesterday when I was all flustered?

There is also a possibility that the board itself has a problem.

I’ve seen boards that don’t work well with multiple USB endpoints for some reason. It’s like they never test part of the USB ram on the board or something. Not sure if this is an indication of poor quality control at ST-micro, or that it’s a counterfeit CPU or something…

Another possible theory would be that the computer dose something weird based on the serial number of the board. (Like it recognizes the serial number and installs a different driver for some reason?) Although I don’t know why it would do that. I know some people have to run zadig for every new board, but again, I don’t know why it works like that for them.

This was the third of a batch of boards I bought from Electronics123. They sent out SD cards that weren’t working well with the boards (the previous install where webUSB was fine had issues with sound quality). So, I had to use my last spare Sandisk, which came from a CFX that’s just been sitting in a drawer. I did do a full format before beginning this install, yet nothing other than the webUSB issues led me to believe the card had problems. But I’m more inclined to point to the SD card than the board in this issue. So, I’ll see if the next install with these proffies from E123 has a similar issue.

I didn’t need to run zadig, so I didn’t try to reset the board with it during the troubleshooting. If I run across a similar error, I’ll try that and chime in on this thread. But for now, the project is complete, and onto the next. I imagine the board was fine, and it was simply that SD card and this computer that were the root of the issues.