mas.to is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hello! mas.to is a fast, up-to-date and fun Mastodon server.

Administered by:

Server stats:

12K
active users

#webusb

1 post1 participant0 posts today

Это под силу даже веб-разработчику! Размышляю, как создать драйверы на JavaScript с API WebUSB

Привет! Я Игорь Кечайкин, руководитель группы разработки во Frontend-команде Flocktory. Недавно, решая задачу, связанную с API WebUSB для Fingerprint-атрибуции пользователя, задался совершенно не связанным теоретическим вопросом: а как создать с этим API драйверы на JavaScript? Чтобы разобраться, изучил спецификацию API WebUSB, а теперь принёс на Хабр выжимку самых важных элементов. В статье я расскажу о принципах работы решения и том, что с ним делать веб-разработчику, который хочет напрямую реализовать на сайт функцию, например, 3D-принтинга с пользовательских девайсов. А также вы узнаете, насколько это безопасно — для сайта, внедряющего API, и для девайсов юзера. Если интересно, как расширить возможности своих сайтов и избавиться от головной боли с адаптацией под всевозможные устройства, заходите в статью.

habr.com/ru/companies/flocktor

ХабрЭто под силу даже веб-разработчику! Размышляю, как создать драйверы на JavaScript с API WebUSBПривет! Я Игорь Кечайкин, руководитель группы разработки во Frontend-команде Flocktory. Недавно, решая задачу, связанную с API WebUSB для Fingerprint-атрибуции пользователя, задался совершенно не...

Dear folks of #JavaScript #async #programming. This #Promise stuff is still voodoo to me. Any simple solution to set a timeout on this byte-receiving loop? I have to collect data from an USB IN endpoint... and let's assume(!) I don't know when I am done (how much data to receive) so that I always have to cancel the last started `transferIn` (#WebUSB) after a timeout (let's say 500 milliseconds). How would you do it? I've trued hacky Promise/timeout stuff, but don't feel comfortable with it.

Wrote a "high level USB decoder" which sits on top of Saleae's USB LS/FS analyzer so that I can see the really relevant data. Should help getting me the #LEGO #USB Infrared Tower for the #Mindstorms #RCX analyzed better... and maybe provide #WebUSB support on #WebPBrick some day. Sometimes you cannot to see the wood for the trees. (I was surprised recently that this saying could be translated from German to English 1:1.) Planning to open source the tool.

@joao @martijnbraam @justinkd

Well, yeah. I'm a staunch FIrefox user and avoid Chrome / Chromium wherever I can. That said, I'm not going to suggest that Mozilla having not implemented WebUSB yet, means that Mobile Linux users shouldn't have access to a fast, easy way to try recent advancements because they'd need to use Chromium for a few minutes. That seems like "baby with the bathwater" behavior to me. 🤷

Some more experiments with bringing #LEGO #Mindstorms #RCX access into the webbrowser - without the need of some Windows virtual machine or UBS driver hacks. I drafted a browser compatibility test page. And more importantly: I ran first experiments with the Web USB API! And success: 🥳

"Size: 8, error code: 0
LEGO USB Tower firmware version is 1.0 build 134" 🧱 💡
(The numbers really are from the USB device.)

Thankfully, there's a Linux USB driver for inspiration.

Continued thread

Of course I had to try #GrapheneOS too. The website reads nice, lots of docs (way more than #CalyxOS who put things on #Matrix. Which is just not for me), lots of information. A #WebUSB installer (if you run a #chromium for it, but please no #flatpak, ...) and not hard to switch too. So after some days CalyxOS i put GrapheneOS on yesterday evening.

Ahwell. I'm already back on Calyx. GrapheneOS is really ... pretty damn low level. It comes with basically nothing, except their own app store, from which you can get the google services/playstore stuff.
Which then directly kept crashing here, whenever I tried using the store to get anything installed.

So grapheneos does want / allow you a much more barebones start, which is nice, but right now just nothing for me. No time. I want it 85% done, and just put the few specials on top, not start near empty. At another time I think I would love that way, but not right now and the near/middle future...
2/x