Connecting to Bluetooth devices

Posted on
  • Hi There

    I was wondering if anyone could offer some advice. I looking to connect to external bluetooth device using javascript. I have it working on my mac in javascript however is it possible to upload this to espruino and it work ?

    If so what board would it be best to use I am guessing it will be a MDBT42Q

    I am afriad i very new to Espruino and my Javascript is a little basic but i been messing about with arduino for years

    Any help would be greatly appricated

    Cheers

    James

  • With Espruino you get the event drivenness all the way thru. There is no main loop like in Arduino (checking flags in your app, flags that can be set by events or other loop participants).

    If you have it running in browser, there is great chance to get it relatively easy and quickly working in/on any BLE supporting Espruino environment/board. I did the opposite already several times: develop on Espruino boards, but for speeding up and logic testing, I setup a cross development environment in browser / html5. Things unavailable in browser, I'm 'shimming' / 'backfilling'... see conversation about Modular and extensible UI framework and ui elements.. In most recent version - not published/updated on that conversation - I even implement typical Espruino hardware dependent items, such as setWatch(). (I'm attaching current version - in transitional work / not all things work yet again - which includes major updates, last but not least in favor of resourcefulness and increased portability - .../uixdev/uiExample.html?example=all and .../uixdev/uiExample.html?example=allPix­l work, allPixl needs to be initialized with onInit button click). For details how to use attached zip see conversation mentioned above.


    1 Attachment

  • Mon 2019.11.11

    Hello @user104759 and thank you for your interest in Espruino!

    'looking to connect to external bluetooth device'
    'what board would it be best to use'

    It would be nice to know a bit more on what is to be accomplished. If one has a desire to attach other peripheral devices such as a temperature module or GPS unit, then I highly recommend the MDBT42Q breakout board for easy connectivity. If you need a viewable screen, the Pixl is ready to go there. Or maybe just a small 36mm or 1.5" diameter pendant button, then take a look at the Puck.

    http://www.espruino.com/MDBT42Q
    http://www.espruino.com/Pixl.js
    http://www.espruino.com/Puck.js

    or estimated deliverable in March 2020 the First Programmable Watch Bangle.js

    http://forum.espruino.com/conversations/­340703/#comment14980434

    Take a peek at the 100+ (and growing) tutorials to get the juices flowing:

    http://www.espruino.com/Tutorials


    'i been messing about with arduino for years'

    You don't have to apologize, we'll still welcome ya ;-)

    I just jumped in two years ago with the purchase of the Pico (now I have 'em all) without the foggiest of where I wanted to go. The WebIDE is easy and intuitive and you will love the ease of real-time debugging/update without having to sit and wait for a compile process to complete. Having a breakout board makes life easier for connectivity.

    Read over the forums to see what other are doing:

    http://forum.espruino.com/microcosms/139­/

    Tell us a bit more . . . . better yet, just get started!!

  • Thanks Both, I've ordered a MDBT42Q so will give it a go

    'i been messing about with arduino for years
    ' You don't have to apologize, we'll still welcome ya ;-)

    I didn't mean that but He he

  • If you've got the code working on your computer with Web Bluetooth then when you get your Espruino device you should find the code you need is basically identical.

    As an example, check out the NRF.requestDevice docs

  • Wed 2019.11.13

    'I didn't mean that but He he'

    Hey @user104759, both our responses could be interpreted differently. I had to re-read and re-think your response, and I actually 'then understood' why it was worded the way it was! ;-)

    My intent was that as you had been developing in a compiled environment for such a long time, that you shouldn't find the need to apologize, now that you have discovered the word of interpreted development. Was trying to keep things light and humorous, but it appears that wording can be mis-leading.

    Hope you chose the breakout board version of the MDBT42Q with all the available circuit board through holes for wires or headers.

    I'm sure you'll appreciate the speed of development after a few tutorials. Thank you for supporting Espruino with the purchase of an official supported board and, . . . Welcome aboard!!

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

Connecting to Bluetooth devices

Posted by Avatar for user104759 @user104759

Actions