GadgetBridge suggestion

Posted on
  • There is the feature currently built into GadgetBridge that allows a phone app to send a message to the com.bangle.uart.tx intent, and ultimately cause a single line of text to be sent to the watch's REPL.

    That's a potentially massively useful feature for me, but what would be really nice would be to have an additional feature in GadgetBridge that lets me enter a line of text and directly send that text to the watch. That would save me from having to write an Android app that basically does the same thing.

    I wouldn't even need to see the response from the REPL, for what I have planned I'd get feedback pretty quickly based on changes that would appear of the display.

    Any chance this feature could be added to GadgetBridge?

  • What is the thing you want to achieve, disregarding the technicalities?

    You can already send test notifications from Gadgetbridge. But I'd guess you already know that 🙂

  • One option for you is Gadgetbridge loads the 'App Loader', which is basically this file: https://github.com/espruino/BangleApps/b­lob/master/android.html

    The URL is configurable in settings, so you could fork the app loader, change it to be exactly how you want it (if that's deleting everything and replacing it with one big text box that would work fine, but you could do much more), and then change the URL in Gadgetbridge to your version hosted on GitHub pages and you're sorted.

  • What is the thing you want to achieve, disregarding the technicalities?

    I think the request is mostly clear
    "additional feature in GadgetBridge that lets me enter a line of text and directly send that text to the watch."

    I understand it like some textfield somewhere in GB where you could directly enter e.g. require("Storage").eraseAll();E.reboot()­ and watch is immediately erased and rebooted. Or maybe something more practical and less destructive is an option too :-)

    I think this is related to another previously mentioned feature - to have REPL console output available in the AppManager/Apploader in GadgetBridge. The "More .." tab has lot of advanced functionality so this could be there too.

  • What I am trying to achieve is the ability to send configuration data to the watch in the absence of an internet connection that gives me access to the app loader.

    The italicised text is the key item here. There are times when I wish to modify the configuration data for my watch face, but I do not have an internet connection available. Under these circumstances I can't use the app loader, so I need to do this locally.

    I could solve this by writing a custom Android app that sends text to the com.bangle.uart.tx intent, which would allow sending a line of text to the REPL. However I'm guessing that 99.9% of the work is already done in GadgetBridge, which means it might be a relatively quick and easy change.

    If not, then I'll just have to write an Android app which will allow me to get where I want to be.

  • I guess there could be an entry added in 'Device specific settings' -> 'Developer options' titled 'Run code directly on watch' or something that opened an input field for code to send and run? Like @fanoush said.

    Much of the Bangle specific stuff is in the BangleJSDeviceSupport class, e.g. communications with the watch. But not the 'Device specific settings' page I don't think. So I don't know every step of what would need to be added.

  • There are times when I wish to modify the configuration data for my watch face, but I do not have an internet connection available.

    So you do literally just want to send JS commands over to the watch, nothing else?

    If so, I'd say you should go to https://www.espruino.com/ide/ in Chrome on your phone, and click the Install button on the prompt that comes up and it'll create an icon on your phone's home screen. The IDE has been written such that it's a PWA and even though it's a webpage it can load everything it needs to run offline into your phone's memory - so once you've been once and installed it (I think even if you haven't installed) you can use it when your phone is offline (even though it's using the web browser).

    So to use it, just disconnect Gadgetbridge from the watch, load the IDE from the Android app list and connect. And now you get a terminal, syntax highlighted text editor, access to read/write storage files/etc.

    While somewhere we could add a text box to Gadgetbridge, the immediate question then is what about a terminal so you can see what the response is. Then maybe you want a syntax highlighted editor, access to files, etc and before we know it we've just reimplemented the IDE.

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

GadgetBridge suggestion

Posted by Avatar for dgnuff @dgnuff

Actions