Bangle.js cannot connect via BLE.

Posted on
  • Today I tried connecting to the web IDE to upload a new JSON file to storage. I clicked the button on the top-left corner and selected my device from the menu. It connects. I click the storage icon, but the loading bar reaches the halfway and promptly disconnects. I try this with other browsers and the same thing happens. I then try connecting to the app loader but it isn't able to connect at all.

    This issue persists even after reloading default settings.
    Before disconnecting, the dev console gives me the following error message:

    BT> SEND ERROR: NotSupportedError: GATT operation failed for unknown reason.
    

    How can I fix this?

  • Fri 2021.09.17

    Hi @Asynchronous there are a few tid-bit details that would assist others as I may not have a definitive answer to your specific issue. This will allow those to get a better feel for your environment.

    It appears the WebIDE still has comm with your Bangle as it is indicated that you are able to connect. So lets do that, and please respond by posting the results of process.env and process.memory() for starters. This will indicate the current flashed version and amount of free memory.

    and, . . . are we working with a version 1 Bangle?    (yes?)

  • Hey Robin, thank you for reading!

    This is really strange, I tried connecting this afternoon and everything worked perfectly.
    You are absolutely right about the Bangle device. It's a Bangle.js 1.0.

    I also ran the commands you gave me:

    >process.env
    ={
      VERSION: "2v09",
      GIT_COMMIT: "7247a2c4",
      BOARD: "BANGLEJS",
      FLASH: 524288, SPIFLASH: 4194304, STORAGE: 4194304, RAM: 65536,
      SERIAL: "c3f57bae-4b29eb8b",
      CONSOLE: "Bluetooth",
      MODULES: "Flash,Storage,hea" ... "tensorflow,locale",
      EXPTR: 536882372 }
    >process.memory()
    ={ free: 782, usage: 1318, total: 2100, history: 30,
      gc: 0, gctime: 5.06591796875, blocksize: 16, stackEndAddress: 536922336, flash_start: 0,
      flash_binary_end: 457148, flash_code_start: 1610612736, flash_length: 524288 }
    
    

    Do you see anything of note, or was this probably random?

    (Thanks again!)

  • Sat 2021.09.18

    Thank you for posting the memory status @Asynchronous    Nothing appears out of the ordinary there.

    My next thought was to determine the amount for free storage remaining using getFree().

    http://www.espruino.com/Reference#Storag­e

    http://www.espruino.com/Reference#t_l_St­orage_getFree

  • Is there a possibility of mixing modes during a write to Storage that might have caused a confict?

    ref: http://www.espruino.com/Bangle.js+Storag­e#line=59

    4th bullet below heading 'A few things are going on here:'

    'A file created with require("Storage").open is different to one created with require("Storage").write since it is designed to be appended to. As such you can only access the files with require("Storage").open and not with require("Storage").write/read/erase/etc'­

  • I think this is probably totally unrelated to Storage.

    BT> SEND ERROR: NotSupportedError: GATT operation failed for unknown reason.

    This is actually an error from the Operating System (not from Bangle.js). I think maybe sometimes the bluetooth connection can get into an odd state (the OS thinks it's connected when it isn't) and then things like that happen.

    This sort of thing would then affect the IDE and app loader...

    This is really strange, I tried connecting this afternoon and everything worked perfectly.

    That's great. Possibly if you walked out of bluetooth range of the computer, the connection broke and then next time you connected it was fine.

    If you hit this again, it might be worth just toggling Bluetooth off on your PC for 5 seconds then turning it back on - sometimes that's enough to fix it.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Bangle.js cannot connect via BLE.

Posted by Avatar for Asynchronous @Asynchronous

Actions