• Hi everyone,

    I'm trying to display minibus ETAs directly on my Bangle.js 2 smartwatch. It's inconvenient to always pull out my phone just to check these times. I've already implemented a Python script on Windows 10 using Cursor IDE, which fetches the ETA from a simple API (SERVER/endpoint). However, replicating this on Bangle.js 2 has been challenging.

    It appears that the typical approach involves using Gadgetbridge to fetch the API data, which then sends it to the Bangle.js 2 as a JSON packet. This method seems unnecessarily cumbersome. Is there a more straightforward way to enable Bangle.js 2 to directly retrieve information from the internet? I'm looking for any advice or alternatives that could simplify this process.

    For instance, in Python, I use the following function to fetch the minibus ETA:

    def get_stop_eta(route_id, route_seq, stop_seq):
        url = f"{BASE_URL}/eta/route-stop/{route_id}/{route_seq}/{stop_seq}"
        print(f"GET {url}")
        response = requests.get(url)
        return response.json()
    

    This line response = requests.get(url) specifically connects to the ETA API and retrieves the data. I'm looking to implement a similar direct connection on the Bangle.js 2 without having to route through Gadgetbridge. Any insights or advice on how to make this more direct would be greatly appreciated!

    Thanks for any help you can provide. It's frustrating that smartwatches aren't more autonomous in situations like this.

    P.S. It looks like I might not be able to complete this project, which is disappointing since a smartwatch can be more practical than a smartphone in instances like this.

  • found out there is Bangle.http although not working yet, in the web ide.

    close post thx

  • Bangle.http only works when running under Gadgetbridge

    If you want to develop, it's a lot easier if you use the Web IDE remote connection to allow you to communicate with your Bangle while it's connected to Gadgetbridge: https://www.espruino.com/Gadgetbridge#remote-debugging

  • The problem is Gadgetbridge maintainers have no interest in a Play Store listing, but it's kind of vital for some people, not to mention a lot less frightening for many users that are worried about going outside of the walled garden.

    I don't want to publish a 'Gadgetbridge' app on the Play Store, because then it looks like I'm just reproducing their work, so in a way having a Bangle.js Gadgetbridge app works out quite well

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

Is There a Simpler Method for Bangle.js 2 to Access Internet Data?

Posted by Avatar for ccchan @ccchan

Actions