OSC Messages or HTTP Post

Posted on
  • Hey,
    i am Trying to send some Open Sound Controll (OSC) Messages from my Bangle.js 2.
    But OSC is based on UDP, so i didn't find a Way.

    My next Idea was to use Companion for me to send these OSC Messages, but i need an HTTP Post request to trigger companion.
    Is this possible to with the Gadgetbridge integration to send a POST ? I couln't find anything related to the Bangle.js with HTTP Post.

    Thanks already in advice
    _pasi

  • I've just updated the docs in the Android Integration app - it was possible but just nobody wrote about it:

    * `Bangle.http = function(url,options)` - make an HTTPS request to a URL and return a promise with the data. Requires the [internet enabled `Bangle.js Gadgetbridge` app](http://www.espruino.com/Gadgetbridg­e#http-requests). `options` can contain:
      * `id` - a custom (string) ID
      * `timeout` - a timeout for the request in milliseconds (default 30000ms)
      * `xpath` an xPath query to run on the request (but right now the URL requested must be XML - HTML is rarely XML compliant)
      * `return`  for xpath, if not specified, one result is returned. If `return:"array"` an array of results is returned.
      * `method` HTTP method (default is `get`) - `get/post/head/put/patch/delete`
      * `body` the body of the HTTP request
      * `headers` an object of headers, eg `{HeaderOne : "headercontents"}`
    

    If there's an Android app that'll do OSC then you might be able to use Android Intents to communicate with it too

  • thanks that helps already a lot.
    I checked, but i dint' find Intents to trigger some things in the OSC app i use.

    with companion and the post should work. I just now need to get companion avilable with https.... :)

    thank you

  • So i just found some time to go after my little project.
    I got a Self Signed Certificate in Companion. But i get:
    NoConnectionError: javax.net.ssl.SSLHAndshaeExeption .... Trust anchor for certification....

    Is there a way, that i can allow the Self Signed Certificates in Gadgetbridge ?

  • Is there a way, that i can allow the Self Signed Certificates in Gadgetbridge ?

    I don't know - but you could google javax.net.ssl.SSLHAndshaeExeption and see if it turns up anything?

    Basically the Gadgetbridge code just calls into Android, so the HTTPS-only restriction appears to be from Android, and it's possible the self signed cert issue is built in too (but it may be there's some flag that can be set on the HTTPS request to ignore it)

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

OSC Messages or HTTP Post

Posted by Avatar for _pasi @_pasi

Actions