circuitpython / web-editor

Online web editor for CircuitPython
https://code.circuitpython.org
MIT License
33 stars 17 forks source link

Unable to access the Open diaglog when connecting via bluetooth (hangs on open and save with spinner) #183

Open wuftymerguftyguff opened 6 months ago

wuftymerguftyguff commented 6 months ago

CircuitPython Version

Adafruit CircuitPython 8.2.10 on 2024-02-14; Adafruit ItsyBitsy nRF52840 Express with nRF52840
Board ID:itsybitsy_nrf52840_express
UID:1027F3CECE5BC1D4

Workflow(s)

BLE

Browser(s)

Version 124.0.6367.78 (Official Build) (x86_64) (mac + windows)

Console Log


index.js:37 Load different workflow
context-menu-content-scripts.js:25 Using workaround to get event.path
index.js:35 Getting existing permitted Bluetooth devices...
index.js:35 > Got 1 Bluetooth devices.
index.js:35 Watching advertisements from "CIRC"...
index.js:35 > Received advertisement from "CIRC"...
index.js:35 Connecting to GATT Server from "CIRC"...
index.js:35 > Bluetooth device "CIRC connected.
index.js:35 
BluetoothDevice {id: 'WVH+/a5nYxWRtA9KJo1lqQ==', name: 'CIRC', gatt: BluetoothRemoteGATTServer, ongattserverdisconnected: null, watchingAdvertisements: false, …}
index.js:35 connected 
BluetoothRemoteGATTServer {device: BluetoothDevice, connected: true}
index.js:35 
(2) [BluetoothRemoteGATTService, BluetoothRemoteGATTService]
index.js:35 Initializing File Transfer Client...
index.js:35 DOMException: GATT operation failed for unknown reason. undefined
index.js:35 Connected!
2
context-menu-content-scripts.js:25 Using workaround to get event.path
index.js:21 caught connection error DOMException: GATT operation failed for unknown reason. undefined
index.js:21 caught write error TypeError: Cannot read properties of null (reading 'writeValueWithoutResponse')
    at wS._write (index.js:21:6026)
    at wS.listDir (index.js:21:12322)
    at async ZS.showBusy (index.js:35:106432)
    at async Za._openFolder (index.js:35:95507)
    at async Za.open (index.js:35:95119)
    at async ZS.openFileDialog (index.js:35:108201)
    at async ZS.openFile (index.js:35:107915) TypeError: Cannot read properties of null (reading 'writeValueWithoutResponse')
    at wS._write (https://code.circuitpython.org/assets/js/index.js:21:6026)
    at wS.listDir (https://code.circuitpython.org/assets/js/index.js:21:12322)
    at async ZS.showBusy (https://code.circuitpython.org/assets/js/index.js:35:106432)
    at async Za._openFolder (https://code.circuitpython.org/assets/js/index.js:35:95507)
    at async Za.open (https://code.circuitpython.org/assets/js/index.js:35:95119)
    at async ZS.openFileDialog (https://code.circuitpython.org/assets/js/index.js:35:108201)
    at async ZS.openFile (https://code.circuitpython.org/assets/js/index.js:35:107915)
index.js:21 caught write error TypeError: Cannot read properties of null (reading 'writeValueWithoutResponse')
    at wS._write (index.js:21:6026)
    at wS.listDir (index.js:21:12343)
    at async ZS.showBusy (index.js:35:106432)
    at async Za._openFolder (index.js:35:95507)
    at async Za.open (index.js:35:95119)
    at async ZS.openFileDialog (index.js:35:108201)
    at async ZS.openFile (index.js:35:107915) TypeError: Cannot read properties of null (reading 'writeValueWithoutResponse')
    at wS._write (https://code.circuitpython.org/assets/js/index.js:21:6026)
    at wS.listDir (https://code.circuitpython.org/assets/js/index.js:21:12343)
    at async ZS.showBusy (https://code.circuitpython.org/assets/js/index.js:35:106432)
    at async Za._openFolder (https://code.circuitpython.org/assets/js/index.js:35:95507)
    at async Za.open (https://code.circuitpython.org/assets/js/index.js:35:95119)
    at async ZS.openFileDialog (https://code.circuitpython.org/assets/js/index.js:35:108201)
    at async ZS.openFile (https://code.circuitpython.org/assets/js/index.js:35:107915)


Steps

  1. Power on board and select bluetooth workflow.
  2. create new connection or reconnect NOTE "Bond" button never enables
  3. editor opens with blank document, but will not save
  4. Trying to use open button also hangs with spinner

Description

No response

Additional information

No response

makermelissa commented 6 months ago

I'm pretty sure the actual error is in https://github.com/adafruit/ble-file-transfer-js. It could be something like the BLE connection was disrupted and that lib isn't handling it very well.

wuftymerguftyguff commented 6 months ago

Are you able to recreate the problem? Or does the BLE workflow work for you?

makermelissa commented 6 months ago

I haven't actually started working on this problem yet. I am working on fixing some more generalized bugs and revamping some of the file transfer stuff. BLE probably needs some work done and is the most frustrating workflow in my experience. In the meantime, you can check out this troubleshooting section: https://learn.adafruit.com/wirelessly-code-your-bluetooth-device-with-circuitpython/device-setup#troubleshooting-connection-issues-3106121. The guide is getting a little old, but hopefuly still helpful.

wuftymerguftyguff commented 5 months ago

I have followed the guides you mention with no real joy.

I have a thread in the forum too

makermelissa commented 3 months ago

Ok, I was working with BT Workflow last week and it definitely needs better error handling (i.e. returning control to user and displaying what happened).