BangleJs 2 - Bluetooth stopped working

Posted on
Page
of 2
/ 2
Next
  • Hello,

    I hope someone (@Gordon) can help me: My BangleJs worked totally fine for a few days. I was able to program it via the WebIDE and I also got messages using the Android+Messages app + Gadgetbridge on my smartphone. Unfortunately, this morning, Bluetooth stopped working. The device can not be located, neither with my smartphone nor with my laptop - both worked fine before.

    I also ensured that nothing else is connected and I tried things mentioned in this post (http://forum.espruino.com/conversations/­370259/?offset=25#comment16286014). Unfortunately, nothing helped for me and it's not connectable at all. I can not even find the device / MAC, also nRf Connect shows nothing... I also ensured that (1) Is connectable and (2) BLE is ON (3) Programmable is ON and I also checked via whitelisting if a device is currently connected. I also tried to reset the setting, but this also didn't work...

    Not sure if its a useful information, but when my BangleJs boots I can see the message "-> Bluetooth"...I also enabled Debug but got not really more information about this problem.

    I really hope that you can help me because without Bluetooth I can barely use this otherwise really cool device...

    Cheers, David

  • [Update] I didn't install an update this morning and I also didn't install any new APP or o when the device stopped working. So I can not really say whats the reason for this behavior. I just realized it because I no more received messages...

  • Not sure if its a useful information, but when my BangleJs boots I can see the message "-> Bluetooth"

    Yes, that's hugely useful. Usually, what that means is Bangle.js is being connected to by another device.

    I think given you just installed Gadgetbridge, what I'd suggest is you go into Gadgetbridge and see what is says next to your Bangle. If it says 'connected' long-press on it in Gadgetbridge and it should disconnect - you can then connect to other devices just fine.

  • Thanks for your answer.

    I already tried that, but Gadgetbridge is definitely not connected. Gadgetbridge tries to connect (connecting) but it can never connect (this definitely worked before, I also u"FILESsed disconnect via longpress to start programming). So I uninstalled Gadgetbridge and disabled Bluetooth on my smartphone. Still, I can not connect with my Laptop (this device worked before, I used it for programming). I also tried the opposite: Disable Bluetooth on my laptop and tried to connect with my smartphone (Android) using both, gadgetbridge and the chrome browser. I even wlked a few 100m away from where I am because I thought that something else is connected or so.

    Note also that the bluetooth icon is shown in gray - so I don't think that something is connected right? Also if a device is connected, Settings->BLE->Whitelist->AddDevice should show me the currently connected device, right? But it tells me that "Connect device to add to whitelist" so I'm relatively sure that no device is connected...

    I'm really not sure what I should do now...

    Thanks, David

    [edit] I also disabled the whitelist in the settings to ensure that devices can connect [/edit]
    [edit2] Note that my Puck.js is working fine :) [/edit2]

  • Ahh, ok - thanks! So I guess the Bluetooth message is from when the console gets moved over to the Bluetooth device (away from the LCD screen).

    And you get that -> Bluetooth message even when doing the reset without loading code instructions?

    I've got someone else with a similar problem who is hopefully sending theirs back so I can look in more detail and try and see if it's a software or hardware problem. But if -> Bluetooth really is being displayed even after reset without loading code then it could actually be a software issue that hopefully we can work around.

    Do you remember doing anything before it broke? Installing a specific app or changing any settings? Or even doing something physical to the watch?

  • Hello,

    I followed this guide to reset without loading code. If I do this, then the mac etc. is shown, but "-> Bluetooth" is not shown... also in this mode I can't find the device via Bluetooth (not sure if this should be possible). I also found that if I disable LBE in the settings, "->NULL" is shown instead of "->Bluetooth".

    Do you remember doing anything before it broke? Installing a specific app or changing any settings? Or even doing something physical to the watch?

    Unfortunately not - it would be good I guess if an app or so caused this - but I definitely know that it worked yesterday evening, and stopped working this morning. But today I installed nothing and also didn't change any settings of my Bangle - it was "only" on my wrist and connected to Gadgetbridge. I don't think that any physical thing changed - The whole day I'm sitting in lockdown in front of my PC ^^ - I'm also really careful that its not getting wet etc. and I usually don't wear my Bangle during night.

    If I can somehow help you with debugging via USB (if this is possible), flash the device etc. let me know - I'm happy if I can help you a bit :) I also have some electronic equipment such as an oscilloscope (its quite old but it still works) etc. in case this could help...

    David

  • I have been able to connect with the IDE and was very happy with it. Today, first response was "found EMSCRIPTEN2, vxxx. and did not connect. Now it says "out of range". ble is on, discoverable is on, programmable is on. Check with regular bluetooth shows no bluetooth watch. I have reset the watch. I liked the IDE a lot. How to get it working?

  • Thanks @David, if you do the reset without loading code and Bluetooth isn't working then at least it's doing the right thing (not loading any code, so we can rule out anything you installed on the Bangle).

    It depends how willing to get deep into this you are, but you could wire up an SWD connection to your Bangle (https://www.espruino.com/Bangle.js2#hard­ware-swd). The easy solution is to use an nRF52DK as it 'just works' but you can just wire it up to a Raspberry Pi and mess around with software a bit.

    If you could do that then you could try two things very easily:

    • reading all of flash memory and sending it to me, so I can 'clone' your setup here and see if I lose bluetooth here
    • writing a totally clean Bangle.js image to your Bangle, which would rule out any corruption issues.

    Right now, if it's not a hardware failure (which seems amazingly unlikely) it's possible that either the bluetooth stack got corrupted, or maybe the pairing information in flash memory got corrupted in such a way that the Bangle thinks it should be doing private advertising. But I won't know really until I get some data, or a device back here to test with.

    Today, first response was "found EMSCRIPTEN2, vxxx. and did not connect

    In this case it's because you clicked the Emulator button rather than Web Bluetooth. Maybe if you're still struggling you could start a new post though?

  • Hi @Gordon,

    Right now, if it's not a hardware failure (which seems amazingly unlikely)

    I honestly also don't think that it's a hardware failure - BLE i part of nRF52840 right? So probably the whole Bangle won't work right?

    It depends how willing to get deep into this you are, but you could wire up an SWD connection

    Sure I'm definitely interested to get deeper into this :D Unfortunately, I don't have an nRF52DK in my equipment - but a Raspberry Pi :) So I will try to connect the RPI to my BangleJS and read all of flash memory. I don't have too much experience with this - but I used AVR ISP for a while and I would guess the procedure is the same right?

    I connect my RaspberryPI with Gnd, SWDCLK and SWDIO and then use OpenOCD to read the flash or write a totally clean image on the nRF52DK right?

    -> I hopefully have time this WE to do this...

    Best,
    David

  • That's be great! I think this tutorial should basically cover the process needed to use a Raspberry Pi: https://www.youtube.com/watch?v=R5wub5yw­zTU

  • Ok great, thanks for the very useful tutorial!
    I will come back to you when I tested this.

    Best, David

  • Hello,
    I received the watch this morning (Australia), no taxes !
    I had a very similar situation to PeerDavid's one. Bluetooth worked at first. After 10 minutes, I tried to pair the watch to my phone to load apps. Just Bluetooth pairing, without any app. Since then I had issues: Bluetooth is always greyed. At startup, I've been stuck for a while with:
    "Checking storage...
    Storage ok
    Bluetooth"
    (and nothing) it stops there, I need to restart.
    I restarted the watch a lot, fiddled around with BLE settings on the watch, on my phone and on my computer's bluetooth.
    I couldn't figure a pattern, I stumbled upon different message:
    "Checking storage...
    Storage ok"
    and it stops there, I need to restart.
    Or it starts like it should:
    "Checking storage...
    Storage ok
    Bluetooth..............."
    But it's not possible to interact with the watch.
    My webbrowser on my laptop sees the watch, offers to link to it, but the connection fails.
    Strangely, on my laptop, I can randomly see the bangle in my bluetooth settings.
    As PeerDavid, I'm left with not much of a smartwatch without bluetooth.
    And while I was typing this, I managed to connect the watch to the bangle app store with my laptop. The bluetooth icon on the watch is still grey and if I go to whitelist on the bangle, it says I'm not connected. But I could upload apps succesfully anyway !
    I think I'll try to reflash clean the bangle tomorrow, if it's possible.

  • Really interesting @Fteacher,

    but in my case, the Bangle not shows up as a Bluetooth device and I can not connect to it with any device... not sure if its the same problem - nevertheless, I will report here again after I hve written a new Bangle.js image onto my device.

    Cheers, David

  • @Gordon one more question - where do I find the hexfiles for banglejs2 - I would guess I need one for the bootloader and one for the system right? I found the binaries here (https://www.espruino.com/Download) but I think those are only for loading via the WebIDE right?

    Thanks a lot, David

  • @Fteacher I'm not entirely sure what happened in your case but it seems like the flash storage got corrupted somehow. In that case I'd do the https://www.espruino.com/Bangle.js2#rese­tting-without-loading-any-code and then connect from your phone/laptop. If you can't connect it's actually worth restarting your phone/laptop - it's not unheard of that especially with Mac and Linux, the bluetooth system can get messed up to the point where it won't connect properly.

    @PeerDavid yes, I don't generally supply the hex files because usually they're not needed and you can build them yourself pretty easily, but here's the one I'm currently using. If you erase all and then write that file it's all you need.


    1 Attachment

  • Thats great thank you!

  • Hi @Gordon,

    I'm now connected via SWD and my RPI. I can successfully read registers, and the target shows me "nrf52840.cpu, cortex_m". So I think the connection should be fine right?

    I tried to read the flash into a file via

    flash read_bank 0 bank0.bin
    

    , but I only get the message "Couldn't read CONFIGID register"

    Do you know how I can now read the flash such that I can provide the hex file to you?
    For writing I will then use "nrf5 mass_erase" followed by "flash write_image YOUR_HEX_FILE" right?

    Thanks a lot,
    David

  • That's great!

    I've not used OpenOCD yet but it looks like dump_image espruino_dump.bin 0 1048576 might do it.

    And yes, I think the mass erase and flash write should work

  • And here is the log when I connect with openocd:

    Open On-Chip Debugger 0.11.0+dev-00515-g1ad6ed38b (2021-12-02-15:52)
    Licensed under GNU GPL v2
    For bug reports, read
    	http://openocd.org/doc/doxygen/bugs.html­
    DEPRECATED! use 'adapter driver' not 'interface'
    DEPRECATED! use 'bcm2835gpio peripheral_base' not 'bcm2835gpio_peripheral_base'
    DEPRECATED! use 'bcm2835gpio speed_coeffs' not 'bcm2835gpio_speed_coeffs'
    DEPRECATED! use 'bcm2835gpio swd_nums' not 'bcm2835gpio_swd_nums'
    DEPRECATED! use 'adapter speed' not 'adapter_khz'
    Info : BCM2835 GPIO JTAG/SWD bitbang driver
    Info : clock speed 1004 kHz
    Info : SWD DPIDR 0x2ba01477
    Info : nrf52840.cpu: Cortex-M4 r0p1 processor detected
    Info : nrf52840.cpu: target has 6 breakpoints, 4 watchpoints
    Info : starting gdb server for nrf52840.cpu on 3333
    Info : Listening on port 3333 for gdb connections
    Error: Wrong parity detected
    Error: Wrong parity detected
    Info : SWD DPIDR 0x2ba01477
    Info : SWD DPIDR 0x2ba01477
    Info : SWD DPIDR 0x2ba01477
    Error: Wrong parity detected
    Error: Wrong parity detected
    Info : SWD DPIDR 0x3ba01476
    Error: Wrong parity detected
    Info : SWD DPIDR 0x2ba0146f
    Error: Wrong parity detected
    Error: Could not find MEM-AP to control the core
    Info : SWD DPIDR 0x2ba01477
    Error: Target not examined, reset NOT asserted!
    
    Info : Listening on port 6666 for tcl connections
    Info : Listening on port 4444 for telnet connections
    
    > targets
        TargetName         Type       Endian TapName            State       
    --  ------------------ ---------- ------ ------------------ ------------
     0* nrf52840.cpu       cortex_m   little nrf52840.cpu       halted
    
    > flash banks 
    #0 : nrf52840.flash (nrf5) at 0x00000000, size 0x00000000, buswidth 1, chipwidth 1
    #1 : nrf52840.uicr (nrf5) at 0x10001000, size 0x00000000, buswidth 1, chipwidth 1
    
    

    --> No idea why it tells me. that there are 6 breakpoints and 4 watchpoints...

  • Ok so executing dump_image gives me

    > dump_image espruino_dump.bin 0 1048576
    Target not examined yet
    
  • @Gordon

    I reduced the communication frequency to 100 kHz and now the connection is stable (juhuuu). I would guess my usb connection is not super stable so a lower frequency is needed.

    In the attachments you can find the dump that I created using the command you suggested.


    1 Attachment

  • Nevertheless, something is still weird: I flash the hex file and reboot, but its still my old image - I'm relative sure because my LCARS clock is shown ^^ Is there something else I have to execute - is this still in Ram or so?

    > flash write_image erase bangle.hex
    nRF52840-xxAA(build code: D0) 1024kB Flash, 256kB RAM
    Padding image section 0 at 0x00000a18 with 1512 bytes
    Padding image section 1 at 0x000253c8 with 3128 bytes
    Flash write discontinued at 0x0008e42c, next section at 0x000f7000
    Adding extra erase range, 0x0008e42c .. 0x0008efff
    Padding image section 3 at 0x000fd874 with 1932 bytes
    Padding image section 4 at 0x000fe324 with 3292 bytes
    Adding extra erase range, 0x000ff324 .. 0x000fffff
    Adding extra erase range, 0x10001000 .. 0x10001013
    Adding extra erase range, 0x1000101c .. 0x10001fff
    auto erase enabled
    wrote 616280 bytes from file bangle.hex in 68.578995s (8.776 KiB/s)
    
    > reset run
    
    
  • I also tried to find the device now via bluetooth - still the same problem :(
    I also tried if I'm able to find it via the NRF Toolbox app etc. but, unfortunately, nothing worked yet.

  • I think that's fine - if you got to the about screen, what firmware version is shown?

    The apps are stored on external SPI flash, so updating the firmware doesn't actually get rid of them at all.

  • Ah yea makes totally sense :) If I go to the about screen, it tells me 2V10.236.

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

BangleJs 2 - Bluetooth stopped working

Posted by Avatar for PeerDavid @PeerDavid

Actions