Bleutooth LE on MacOS mid-2014

Posted on
  • Hello,

    I could not detect my pixl.js from the IDE, in Chrome on my macbook pro mid-2014 model. See bluetooth specs attached.

    I checked the troubleshooting https://www.espruino.com/Troubleshooting­+BLE and tried to activate the Experimental Web Platform features as per http://forum.espruino.com/conversations/­356192/#comment15677897 without luck.

    Also, I tried with both the chrome app and the online IDE. It all works fine on my Android phone and another computer running windows.

    My questions:

    • is this a known issue and do you have an idea how solve it?
    • do you have a recommendation for a recent bluetooth adaptor that will work on macOS and can be bought in the UK? (I saw your list here: https://www.espruino.com/Quick+Start+BLE­#with_web_bluetooth and I understand I need one based on Broadcom BCM20702A1 but the links are US based and they do not seem available in the UK.)


    Thank you for your work. I just discovered espruino and I find the idea to be able to code and upload directly from the browser fantastic!


    2 Attachments

    • Screenshot 2021-03-17 at 17.16.26.png
    • Screenshot 2021-03-17 at 17.16.34.png
  • Just to complement, I saw that you there is https://shop.espruino.com/accessories/us­b-bluetooth on the official shop, but it seems to have the Chipset CSR8510A10 which is not recommended if I understood well from https://www.espruino.com/Quick+Start+BLE­#requirements.

    Any specific recommendation from the community would be of big help here.

  • Hi,

    I'd have thought that a 2014-era Mac would support Bluetooth LE just fine out of the box (and your screen capture seems to imply it should be ok) - but you're right, the USB adaptor on the shop is CSR and isn't supported by newer Mac OS (it was originally, but Apple removed the drivers for later OSes).

    If you go to https://www.espruino.com/ide/, click connect in the top left, then click 'Status', does 'Web Bluetooth' show as 'Ok', or something else?

    Is the Mac a 'company' laptop? Sometimes IT departments can choose to lock down Chrome and disable all but the core features.

  • Thanks for the quick reply. Yeah it all looks like it should work, it is quite mysterious.

    WebBluetooth status is showing as Ok. It goes through the motion of scanning for devices but end-up finding nothing and asking for a re-scan. It works well on my Android phone in the exact same condition. I attached screenshots.

    It is my personal laptop so no IT restriction. And the Bluetooth works fine with my usual headphone/speakers, etc.

    It is quite strange, I will keep searching. Please let me know if something pops to mind. I am ok to go for a BLE USB dongle, if you have any recommendation.


    3 Attachments

    • Screenshot 2021-03-18 at 09.24.20.png
    • Screenshot 2021-03-18 at 09.25.26.png
    • Screenshot 2021-03-18 at 09.33.05.png
  • Are you sure your Chrome is up to date? And are you using Chrome Beta/Canary or something like that?

    Maybe you could try something like https://github.com/jnross/Bluetility (or there must be other Mac OS apps too) and see if that can find Pixl.js?

    Also worth noting - I doubt this is the issue - but if you're connected on your phone already then the Mac won't be able to see the Pixl.

  • Yes Chrome up to date, no funny version either.

    The Bluetility can find the Pixl.js, which is good news but this seems to confirm it is a Web Bleutooth issue most probably coming from Chrome.

    Multiple connection is not the issue here, I have been careful to cut my phone Bluetooth to be sure. Also tried rebooting the computer.


    2 Attachments

    • Screenshot 2021-03-18 at 14.24.14.png
    • Screenshot 2021-03-18 at 14.24.27.png
  • Thanks for checking that out! That is a very strange one. Is it possible the Pixl.js is paired in Mac OS's own Bluetooth menu? I'm pretty sure I've heard of problems because of that.

    But I don't think a USB Bluetooth dongle is likely to solve it for you then, since it seems the existing Bluetooth is more than capable.

    Have you used node.js before? You could install the Espruino CLI from https://www.npmjs.com/package/espruino and then run espruino -d Pixl --ide and you should be able to connect to http://localhost:8080 and get the IDE.

  • Thanks Gordon for providing so much help!

    Pixl.js does not appear in Mac OS's own Bluetooth menu. I could not see it anywhere but in Bluetility so far.

    I tried Espruino CLI with node.js with no luck either. Pixl is not listed in the espruino --list command either. See attached.

    If of any use to try an alternative method, I am reading these info from Bluetility

    identifier: 7C699A5C-4CE1-44B8-893B-EC81B93996E1
    MAC: E2-89-0F-82-FC-86
    Local Name: Pixl.js fc86 Service
    UUIDs: 6E400001-B5A3-F393-E0A9-E50E24DCCA9E

    I have no idea how Bluetility can see it but not the other tools.

    Let me know if you have other thoughts, but I do not want to take too much of your time on this as very few people still run macbookpro mid-2014.


    2 Attachments

    • Screenshot 2021-03-18 at 18.22.31.png
    • Screenshot 2021-03-18 at 18.28.50.png
  • You could try espruino --verbose and see if it mentions anything there about Noble and whether it's not working for some reason?

    But you probably wouldn't expect the Pixl to appear in the Mac OS bluetooth settings because it doesn't provide any services (like keyboard or voice) that the Mac is interested in.

    You could try uploading this from your phone: https://espruino.github.io/EspruinoApps/­#blehidkey

    It'd turn the Pixl into a bluetooth keyboard (only for 'Enter') and then it's possible the Mac would see it in the OS menu. It doesn't help you program it but it would at least prove it was an issue with Chrome.

    Another option is to install https://github.com/espruino/EspruinoHub on a Raspberry Pi, and then you can connect to the raspberry pi (again via web address) and program the Pixl.js that way

    ... or, if you have USB-TTL converter you can program Pixl.js via serial port as well.

  • Same version of mac and same version of google chrome. On my mac it looks like this:

    In the first picture I choose Web Bluetooth (Bluetooth Low Energy)

    In the next picture I choose my Pixl and vupti

  • Billede


    1 Attachment

    • billede1.png
  • billede


    1 Attachment

    • billede2.png
  • billede

    mac and upload is not my strong point


    1 Attachment

    • billede3.png
  • It works now! It was the most stupid thing as often, it was due to MacOS "Security & Privacy"settings but no warning was shown in Chrome.

    I tried espruino --verbose and indeed found Noble issues.

    Noble: getPorts - initialising... Noble: module couldn't be loaded, no
    node.js Bluetooth Low Energy Error: Cannot find module
    '@abandonware/noble'

    It was not installed, so tried installing it which didn't work at first. I followed the tracks and tried resintalling xcode (https://medium.com/@mrjohnkilonzi/how-to­-resolve-no-xcode-or-clt-version-detecte­d-d0cf2b10a750). Could install noble in the end but still did not work.

    I then looked at npm page for noble (https://www.npmjs.com/package/@abandonwa­re/noble#os-x), which says:

    On newer versions of OSX, allow bluetooth access on the terminal app:
    "System Preferences" —> "Security & Privacy" —> "Bluetooth" -> Add
    terminal app (see Sandboxed terminal)

    I went there and found Chrome app unchecked :/, checked it and everything worked. I could use the app loader and uploaded the t-rex app.

    Somehow Bluetility was in the list and already activated but not the two other apps there. I don't remember having done so for Bluetility otherwise I would have understood . There was no warning in Chrome either to indicate this could be an issue, it was blind to the macOS settings. Even chrome://bluetooth-internals/#adapter was showing Bluetooth as available and working. So I am not sure how you could catch that and show a message from the WebIDE.

    Good to have this mystery sorted!

    Thanks again for your time Gordon and apologies if this is a known issue and I missed it in the documentation.


    1 Attachment

    • Screenshot 2021-03-19 at 10.18.32.png
  • Glad you got it working - and thanks for reporting back in such detail. I'll update the Bluetooth Troubleshooting and Quick Start guides to mention that.

    I seem to recall this came up right after Big Sur was released (I should have seen that's what you'd put in your screenshot and remembered!).

    I think what happens is right after the Big Sur upgrade, every app you start pops up a window asking if it can have permissions for what it needs. Obviously for most people, if your web browser asks for Bluetooth permissions you click 'Hell No' without even batting an eyelid. When you finally do get a bluetooth device you want to use with the web browser, clicking that button could have happened over a year ago alongside a barrage of other questions about app permissions :)

    It's a shame it looks like we can't detect it, or the Web IDE could pop up a message explaining the problem :(

  • Obviously for most people, if your web browser asks for Bluetooth permissions you click 'Hell No' without even batting an eyelid. When you finally do get a bluetooth device you want to use with the web browser, clicking that button could have happened over a year ago alongside a barrage of other questions about app permissions :)

    That is for sure what happened here ;)

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

Bleutooth LE on MacOS mid-2014

Posted by Avatar for jgrizou @jgrizou

Actions