• Hi,

    I'm new to Bluetooth (and awaiting delivery of my puck). A quick explanation on what I'm trying to do and request for some guidance...

    So - I'd like to code my puck so that it pairs with my mobile phone.

    Q1 - from what I can see this functionality is embedded in the device from the off?

    I then want to set some parameters (which I'll use later) - ideally from a Flutter app.

    Q2 - is this possible, or can you only code the device from the Esprino web IDE?

    I'll want the code that I've flashed to the device initially and the subsequent parameters which I have set from an app to send through the parameters as part of a REST API POST.

    Q3 - Is this possible directly from the button - using the bluetooth connection as a conduit to connect to the internet, or would the bluetooth button need to forward the code to an app which would subsequently make the API POST?

    Looking forward to get started once my button arrives!

  • @TomCooper,

    Check this out: https://www.youtube.com/watch?v=NfMO5PxL­4xc

    I assume a flutter cat get access to the blue tooth communication similar as a html5 page can.

  • Thanks @allObjects for your response.

    Yes, once a signal has reached the app, it can communicate with the internet (just like any other app does).

    I’m trying to work out if the puck needs to communicate with an app as a gateway or whether once it is connected to an internet capable Bluetooth device (such as a mobile phone with 3G or greater), it can send an API POST directly, without needing the app to interpret and forward the signal?

  • @TomCooper,

    With

    it can send an API POST directly, without needing the app to interpret and forward the signal?

    do you mean that your flatter app is transparent to puck and internet app running on server?

    I'm sure that you can come up with general purpose bridge in flatter running on the phone and some bridge heads on puck and internet app so that it looks puck is directly talking to internet app and vice versa. You could then say that your phone with flatter app acts like a gateway, proxy and protocol converter. You could shape the api of your bridge heads along the http protocol and then you could practically do 'whatever' you want even to the point where you do not even have to assign fixed roles for server and client or which side initiates a conversation over the connection, with, for example, some bidirectional MQ / mqtt setup to get away from server/client and enter the realm of peers in a mesh.

    The communication can then be used for application data as well as update over the air. Latter touches on your question whether PuckJS can be coded also from environments other than Espruino IDE. In the forum you find several conversations talking about remote updating PuckJS in the field.

  • Ideally - it would be great if the button could communicate independently (so it could connect up to any bluetooth bridge and just use its internet connection). But if this isn't possible with the tech (Puck or standard Bluetooth functionality) then I'll build something generic into the app like you mention.

    Thanks

  • Right now there's not really anything standard out there to get an internet connection over Bluetooth LE, so I'm afraid you would need to build something into your app.

    There is the HTTP Proxy spec: http://www.espruino.com/BLE+HTTP+Proxy

    But as far as I know there are no off the shelf implementations available, and even if there were it's pretty insecure to allow any device to access the internet via Bluetooth, which is basically unauthenticated.

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

Newbie to bluetooth - simple initial guidance request

Posted by Avatar for TomCooper @TomCooper

Actions