You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.html
+26-6Lines changed: 26 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -221,16 +221,23 @@ <h1>Web Bluetooth not available!</h1>
221
221
<divclass="step-number"></div>
222
222
<divclass="step-content">
223
223
<h1>Request Bluetooth Device</h1>
224
-
<p>CircuitPython boards with <ahref="https://circuitpython.org/downloads?features=Bluetooth%2FBTLE">nrf chips need
225
-
CircuitPython 7.0.0 or newer</a>. The first time a device is connected to your host,
226
-
you'll need to enable public broadcasting by pressing reset when the faster, blue blink
227
-
is happening on start up. The device will reset and the second, blue blink will be solid
228
-
when done successfully.</p>
229
-
<p>
224
+
<p> See the <ahref="https://learn.adafruit.com/wirelessly-code-your-bluetooth-device-with-circuitpython/device-setup">online documentation</a>
225
+
for platform specific notes on how to use Bluetooth. Note that CircuitPython boards with <ahref="https://circuitpython.org/downloads?features=Bluetooth%2FBTLE">nrf chips need
226
+
CircuitPython 7.0.0 or newer</a>.
227
+
</p>
228
+
<p> The first time a device is connected to your host, you'll need to enable
229
+
public broadcasting by pressing reset (or bootsel on some devices) when the faster, blue blink
230
+
is happening on start up. The device will reset and the second, blue blink will be solid
231
+
when done successfully.</p>
230
232
<buttonclass="purple-button" id="requestBluetoothDevice">Request Bluetooth Device</button>
// Analyze an exception and make user friendly suggestions
282
+
_suggestBLEConnectActions(error){
283
+
if(error.name=="TypeError"&&
284
+
(error.message.includes("getDevices is not a function")
285
+
||error.message.includes("watchAdvertisements is not a function"))){
286
+
return"Bluetooth API not available. Make sure you are loading from a secure context (HTTPS), then go to chrome://flags/#enable-web-bluetooth-new-permissions-backend to enable.";
287
+
}
288
+
return`Connect via Bluetooth returned error: ${error}`;
console.log("Read Loop Stopped. Closing Serial Port.");
374
378
}
375
379
380
+
// Analyzes the error returned from the WebSerial API and returns human readable feedback.
381
+
_suggestSerialConnectActions(error){
382
+
if(error.name=="NetworkError"&&error.message.includes("Failed to open serial port")){
383
+
return"The serial port could not be opened. Make sure the correct port is selected and no other program is using it. For more information, see the JavaScript console.";
384
+
}elseif(error.name=="NotFoundError"&&error.message.includes("No port selected")){
385
+
return"No serial port was selected. Press the 'Connect to Device' button to try again.";
386
+
}elseif(error.name=="SecurityError"){
387
+
return"Permissions to access the serial port were not granted. Please check your browser settings and try again.";
388
+
}
389
+
return`Connect to Serial Port returned error: ${error}`;
390
+
}
391
+
392
+
// Analyzes the error from the FSAPI and returns human readable feedback
393
+
_suggestFileConnectActions(error){
394
+
if(error.name=="SecurityError"){
395
+
return"Permissions to access the filesystem were not granted. Please check your browser settings and try again.";
396
+
}elseif(error.name=="AbortError"){
397
+
return"No folder selected. Press the 'Select New Folder' button to try again.";
398
+
}elseif(error.name=="TypeError")
399
+
return`Connect to Filesystem returned error: ${error}`;
0 commit comments