-
Notifications
You must be signed in to change notification settings - Fork 84
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
Replace Scratch-Link with Web-Bluetooth API #194
Comments
WebBluetooth is not supported on any of the four main browsers that Scratch support (Edge 16, Chrome 63, Firefox 57, Safari 11) - and three of the four doesn't have it on latest version either. (note that we still fully support Legacy Edge) Opera, Vivaldi, and Samsung Browser are not supported. |
According to following link, it is supported on Chrome from version 56,
Edge 79, opera 43 and Samsung 6.0.
https://developer.mozilla.org/en-US/docs/Web/API/Web_Bluetooth_API
…On Wed, Apr 14, 2021 at 7:23 PM apple502j ***@***.***> wrote:
WebBluetooth is not supported on any of the four main browsers that
Scratch support (Edge 16, Chrome 63, Firefox 57, Safari 11) - and three of
the four doesn't have it on latest version either. (note that we still
fully support Legacy Edge)
Opera, Vivaldi, and Samsung Browser are not supported.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#194 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAREYOKP5UB5JYLDTF67S3TTIW6OVANCNFSM4246574A>
.
|
Given that Chrome alone has a market share around 70%, I think that using
web-bt api should at least be offered as alternative to installing
Scratch-link (keeping Scratch-link for browsers not supporting bt api).
This will give support for platforms not currently supported, Android,
Linux, smart tv (Chrome, opera, Samsung browsers)
My personal experience with Scratch-link has not been great, with it often
failing to find Mindstorm EV.
בתאריך יום ד׳, 14 באפר׳ 2021, 20:44, מאת Nathan Rona ***@***.***
…:
According to following link, it is supported on Chrome from version 56,
Edge 79, opera 43 and Samsung 6.0.
https://developer.mozilla.org/en-US/docs/Web/API/Web_Bluetooth_API
On Wed, Apr 14, 2021 at 7:23 PM apple502j ***@***.***>
wrote:
> WebBluetooth is not supported on any of the four main browsers that
> Scratch support (Edge 16, Chrome 63, Firefox 57, Safari 11) - and three of
> the four doesn't have it on latest version either. (note that we still
> fully support Legacy Edge)
>
> Opera, Vivaldi, and Samsung Browser are not supported.
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#194 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAREYOKP5UB5JYLDTF67S3TTIW6OVANCNFSM4246574A>
> .
>
|
I have recently bought Lego Boost. Scratch Link does not work (unable to connect) on macOS. I managed to connect using Web Bluetooth API and everything works... The problem is... my son is not able to use it because it's javascript (not scratch). In my opinion... If scratch-link does not work for me... it's better to use something universal like Web Bluetooth. |
Hi notAPanda, could you link a gist of your code? |
This is the javascript I used to make a Unity plugin for web-blutooth https://github.com/healthGamez/WebBTCscSensorPlugin--public/blob/main/Assets/HealthGamez/WebBTCycleSpeedCadencePlugin/Plugins/jspre.jspre |
thanks! An argument against the idea is that one wants it to work not only in the browser but also in the scratch offline app. And Scratch-Link is expected to link other devices not only BLE... So perhaps the point could be to try to change the BLE module in Scratch Link to work via the web bluetooth api?? Not sure, just thinking aloud. |
@arivero , don't understand that argument. Given that scratch-desktop is based on Chromium, which include the API, why should web-ble API not work for scratch-desktop? |
Well, you are correct that desktop and web is the same. In fact now that I have compiled scratch-link I find easy to connect from chrome than from the desktop app, because both of them reject the self-signed certificate, but it is easier to tell chrome to proceed. My main argument was that all device management, not only ble, was supposed to be delegated in an external app, namely this one, scratch link. In theory this is more flexible as allows for usb and wifi connected robots. In practice, one must keep updated versions of everything. |
There is a web-API for usb as well https://developer.mozilla.org/en-US/docs/Web/API/USB. As for wifi, no need for browser API (or scratch link) as it is IP communication to begin with. |
Basically what is needed to adapt to web-ble is to rewrite https://github.com/LLK/scratch-vm/blob/5aa83b912ff09b4f2d57a31fe37fcbb4c43fab43/src/io/ble.js#L3 to use the the web-ble api instead of scratch-link web-socket. I've forked and try to see what I can do. |
Ah I see what you mean. I had expected scratch link to act as a central hub
for the extensions, but no, it only provides communication. So really the
point is to rewrite the ble-based extensions to use web-ble. It makes sense.
Meanwhile, at bricklife it seems they are trying to update scratch-link to
work in newer versions on MacOS.
El mar, 25 ene 2022 a las 15:49, Nathan Rona ***@***.***>)
escribió:
… Basically what is needed to adapt to web-ble is to rewrite
https://github.com/LLK/scratch-vm/blob/5aa83b912ff09b4f2d57a31fe37fcbb4c43fab43/src/io/ble.js#L3
to use the the web-ble api instead of scratch-link web-socket. I've forked
and try to see what I can do.
—
Reply to this email directly, view it on GitHub
<#194 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAKRJR4GQX2FYGONEHOJE3UX2Z6PANCNFSM4246574A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Not the extension but the ble io-class of the core (also bt class). Extensions such as microbit and lego uses this class methods to establish link, so if you rewrite it there is no need to modify the extensions themself. |
With the Web-bluetooth API (https://web.dev/bluetooth/)the need to install Scratch-link helper program on computer in order to access bluetooth interface. I.e. the use of Scratch-link can be replaced with using the Bluetooth API to directly connect to Bluetooth. The API is currently supported in Chrome (with derivatives such as Edge and Brave), Opera and Samsung browsers.
There are several advantages:
/Nathan
The text was updated successfully, but these errors were encountered: