Avatar for edb

edb

Member since Apr 2022 • Last active Jun 2022
  • 0 conversations
  • 5 comments

Most recent activity

  • in Projects
    Avatar for edb

    I realized I didn't use much of the pebbleKit things, so once I saw your intent broadcast receiver I just used that instead, but with \u0010 so it would execute a javascript line. So I didn't change anything at the Gadgetbridge side.

            val jsonData = JSONObject(data)
            logger.info(jsonData.toString())
            jsonData.put("t", "bangleOSM")
            sendDataIntent.putExtra("line", "\u0010GB($jsonData)\n")
            sendBroadcast(sendDataIntent)
    

    and indeed the app loading also works (created an android app to load the tasks from OpenTasks into the todolist watch app and open it)

     sendDataIntent = new Intent("com.banglejs.uart.tx");
     sendDataIntent.putExtra("line", "\u0010load(\"todolist.app.js\");\n");
     sendBroadcast(sendDataIntent);
    
  • in Projects
    Avatar for edb

    I've made a first test version of navigation with the lcars app together with OsmAnd

    watch App
    Companion android code

    @Gordon it uses your gadgetBridge commit to allow sending intents to the watch, I don't know if this is the intended use though. You can do whatever you want on the watch from intents now, which is nice, but might be a bit of a security issue.
    I guess for most purposes it would be enough to have the current line method but it won't allow executing of code and a method which accept a json body and a type and send that to the gb function. Maybe an intent to start/stop apps on the watch, for example to start a navigation app when navigation is started on the phone.

  • in Bangle.js
    Avatar for edb

    Updating firmware worked fine on my chromium on Ubuntu after enabling both chrome flags.
    Sometimes I do need to pair the watch first in the bluethooth manager before it wants to connect in chromium.

  • in Projects
    Avatar for edb

    pebbleKit is not notification based, but intent based, it was made by pebble not so much for notifications, but for communication to companion apps running on the phone (e.g. using the watch as a camera viewer or adding pebble support to your existing apps)

    Basically gadgetbridge will listen to pebblekit broadcast intents which have an application specific payload and an UUID per app. On the watch the applications will listen to their own UUIDs. It also works the other way around, an app on the watch sends a message to gadgetbridge with its UUID and gadgetbridge will broadcast an intent and a android app will react on messages with its own UUID.

    https://developer.rebble.io/developer.pe­bble.com/guides/communication/index.html­

    Basically what I did was modify the existing pebbleKitSupport in gadgetBridge to support bangle
    https://github.com/Freeyourgadget/Gadget­bridge/blob/master/app/src/main/java/nod­omain/freeyourgadget/gadgetbridge/servic­e/devices/pebble/PebbleKitSupport.java

    basically it does something like this (pebblekit always packs the data in a array, guess it can just as well be without it) For now I just implemented the send to bangle part

         int transaction_id = intent.getIntExtra("transaction_id", -1);
         uuid = (UUID) intent.getSerializableExtra("uuid");
         String jsonString = intent.getStringExtra("msg_data");
         LOG.info("json string: " + jsonString);
         try {
                JSONArray jsonArray = new JSONArray(jsonString);
               mBangleDevice.uartTxJSON("pebble kit app send", new JSONObject().put("t", "pebbleKit").put("uuid", uuid).put("message", jsonArray));
                sendAppMessageAck(transaction_id);
                 } catch (JSONException e) {
                           LOG.error("failed decoding JSON", e);
                }
    

    OsmAnd has pebbleKit support so that would work (though I want some more info as it provides) Google maps won't work as that doesn't have pebbleKit support

    OsmAnd doesn't add images for turns, it has a defined a set of 14 turn types you need to render yourself (it can also give the angle of the next turn)

  • in Projects
    Avatar for edb

    I'm trying to add navigation to the lcars watch (using the bottom panel for next turn arrow, distance to next turn and eta/distance left) based on navigation info from OsmAnd and right now repurposing the pebblekit support in gadgetbridge for the communication.

    I wonder if I could/should use this built in notifications in Messages for it, or are you working on another way to communicate to the phone with gadgetbridge, I guess something like bangleKit could be added to gadgetbridge in the same way as pebble has pebblekit.

Actions