Gadgetbridge for Android

Gadgetbridge is an Android application that allows you to use smartwatch-style notifications and health monitoring without the need for a proprietary application or web service.

If you like Gadgetbridge, please consider donating to help support its continued development

We've added a 'Bangle.js' device to Gadgetbridge which allows you to connect your phone to Bangle.js (or any Bluetooth-capable Espruino).

How to set up

  • Install Gadgetbridge on your Android phone. Do not install the Play Store version as it is not the official one. Instead download and install the F-droid version manually.
  • On Bangle.js, install the Gadgetbridge Widget, and ensure you disconnect your computer from Bangle.js
  • Start the Gadgetbridge app and click the blue + in the bottom right
  • Choose your Bangle.js device from the list
  • Right now we'd suggest choosing Don't pair when prompted in order to get the most reliable connection
  • Everything should now be working. From the menu in the top-left of the Gadgetbridge Android app you can choose Debug and can test out notifications/etc

Weather

You can also get weather from Gadgetbridge. Install the Weather Widget and check out the Read more... link on the app page for more information. An additional app is required to forward the current weather into Gadgetbridge.

How it works internally

Messages sent to Bangle.js from Phone

Messages are wrapped in the text "\x10" + "GB(...)\n", so that if they're sent to a normal Espruino REPL the GB function will be executed with the supplied data as the first argument.

Currently implemented messages are:

  • t:"notify", id:int, src,title,subject,body,sender,tel:string - new notification
  • t:"notify-", id:int - delete notification
  • t:"alarm", d:[{h,m},...] - set alarms
  • t:"find", n:bool - findDevice
  • t:"vibrate", n:int - vibrate
  • t:"weather", temp,hum,txt,wind,loc - weather report
  • t:"musicstate", state:"play/pause",position,shuffle,repeat - music play/pause/etc
  • t:"musicinfo", artist,album,track,dur,c(track count),n(track num) - currently playing music track
  • t:"call", cmd:"accept/incoming/outgoing/reject/start/end", name: "name", number: "+491234" - call
  • t:"act", hrm:bool, stp:bool, int:int - Enable realtime step counting, realtime heart rate. 'int' is the report interval in seconds

For example:

// new message
GB({"t":"notify","id":1575479849,"src":"Hangouts","title":"A Name","body":"message contents"})
// message changed
GB({"t":"notify~","id":1575479849,"body":"this changed"})
// remove message
GB({"t":"notify-","id":1575479849}); 
// maps navigation
GB({"t":"notify","id":1,"src":"Maps","title":"0 yd - High St","body":"Campton - 11:48 ETA","img":"Y2MBAA....AAAAAAAAAAAAAA="})
// music
GB({"t":"musicstate","state":"play","position":0,"shuffle":1,"repeat":1})
GB({"t":"musicinfo","artist":"My Artist","album":"My Album","track":"Track One","dur":241,"c":2,"n":2})
// Call coming in 
GB({"t":"call","cmd":"accept","name":"name","number":"+441234123123"})

Messages from Bangle.js to Phone

Any line beginning with { will be parsed as JSON by Gadgetbridge, so to send a command, simply use Bluetooth.println(JSON.stringify(json)).

Available message types are:

  • t:"info", msg:"..." - display info popup on phone
  • t:"warn", msg:"..." - display warning popup on phone
  • t:"error", msg:"..." - display error popup on phone
  • t:"status", bat:0..100, volt:float(voltage) - status update
  • t:"findPhone", n:bool
  • t:"music", n:"play/pause/next/previous/volumeup/volumedown"
  • t:"call", n:"ACCEPT/END/INCOMING/OUTGOING/REJECT/START/IGNORE"
  • t:"notify", id:int, n:"DISMISS,DISMISS_ALL/OPEN/MUTE/REPLY",
    • if REPLY can use tel:string(optional), msg:string
  • t:"ver", fw1:string, fw2:string - firmware versions - sent at connect time
  • t:"act", hrm:int, stp:int - activity data - heart rate, steps since last call

For example:

Bluetooth.println(JSON.stringify({t:"info", msg:"Hello World"}))

will display a message on your phone's screen.

Building Gadgetbridge

If you want to build Gadgetbridge yourself there's proper documentation at https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Developer-Documentation

Once you have the Android development tools on your system, all you need to do to build is:

./gradlew assembleDebug
adb install app/build/outputs/apk/debug/app-debug.apk

This page is auto-generated from GitHub. If you see any mistakes or have suggestions, please let us know.