mirror of https://github.com/espruino/BangleApps
Merge pull request #835 from hughbarney/master
Gadgetbridge Troubleshooting in README, Findphone fixed for Bangle 2pull/838/head^2
commit
367a03e00a
|
@ -2058,7 +2058,7 @@
|
|||
"name": "Find Phone",
|
||||
"shortName":"Find Phone",
|
||||
"icon": "app.png",
|
||||
"version":"0.02",
|
||||
"version":"0.03",
|
||||
"description": "Find your phone via Gadgetbridge. Click any button to let your phone ring. 📳 Note: The functionality is available even without this app, just go to Settings, App Settings, Gadgetbridge, Find Phone.",
|
||||
"tags": "tool,android",
|
||||
"readme": "README.md",
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
0.01: First Version
|
||||
0.02: Remove HID requirement, update screen
|
||||
0.03: Fix for Bangle 2, toggle find with top half of screen, exit touch bottom half of screen
|
||||
|
|
|
@ -6,3 +6,8 @@ Ring your phone via GadgetBridge if you lost it somewhere.
|
|||
2. Lose phone
|
||||
3. Open app
|
||||
4. Click any button or screen
|
||||
|
||||
## On a Bangle 2
|
||||
|
||||
- You can touch the top half of the screen to toggle Find / Stop
|
||||
- You can touch the bottom half of the screen to exit the app.
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
//notify your phone
|
||||
|
||||
const fontSize = g.getWidth() / 8;
|
||||
var finding = false;
|
||||
|
||||
function draw() {
|
||||
// show message
|
||||
g.clear(1);
|
||||
require("Font8x12").add(Graphics);
|
||||
g.setFont("8x12",3);
|
||||
g.clear(g.theme.bg);
|
||||
g.setColor(g.theme.fg);
|
||||
g.setFont("Vector", fontSize);
|
||||
g.setFontAlign(0,0);
|
||||
|
||||
if (finding) {
|
||||
g.drawString("Finding...", g.getWidth()/2, (g.getHeight()/2)-20);
|
||||
g.drawString("Click to stop", g.getWidth()/2, (g.getHeight()/2)+20);
|
||||
|
@ -17,17 +19,37 @@ function draw() {
|
|||
g.flip();
|
||||
}
|
||||
|
||||
function findPhone(v) {
|
||||
Bluetooth.println(JSON.stringify({t:"findPhone", n:v}));
|
||||
}
|
||||
|
||||
function find(){
|
||||
finding = !finding;
|
||||
draw();
|
||||
Bluetooth.println("\n"+JSON.stringify({t:"findPhone", n:finding}));
|
||||
findPhone(finding);
|
||||
}
|
||||
|
||||
draw();
|
||||
|
||||
//register all buttons and screen to find phone
|
||||
setWatch(find, BTN1, {repeat:true});
|
||||
setWatch(find, BTN2, {repeat:true});
|
||||
setWatch(find, BTN3, {repeat:true});
|
||||
setWatch(find, BTN4, {repeat:true});
|
||||
setWatch(find, BTN5, {repeat:true});
|
||||
|
||||
if (process.env.HWVERSION == 1) {
|
||||
setWatch(find, BTN2, {repeat:true});
|
||||
setWatch(find, BTN3, {repeat:true});
|
||||
setWatch(find, BTN4, {repeat:true});
|
||||
setWatch(find, BTN5, {repeat:true});
|
||||
}
|
||||
|
||||
if (process.env.HWVERSION == 2) {
|
||||
Bangle.on('touch', function(button, xy) {
|
||||
|
||||
// click top part of the screen to stop start
|
||||
if (xy.y < g.getHeight() / 2) {
|
||||
find();
|
||||
} else {
|
||||
findPhone(false);
|
||||
setTimeout(load, 100); // exit in 100ms
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -52,3 +52,62 @@ Activity reporting
|
|||
You'll need a Gadgetbridge release *after* version 0.50.0 for Actvity Reporting to be enabled.
|
||||
|
||||
By default heart rate isn't reported, but it can be enabled from `Settings`, `App/Widget Settings`, `Gadgetbridge`, `Record HRM`
|
||||
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
1. Switch to using one of the stock watch faces like s7clk or wave on a Bangle 2.
|
||||
|
||||
2. Check that the battery charge level is being seen by the Gadgetbridge App on the phone. This proves that data is getting to your phone.
|
||||
|
||||
### You can test the notifications on the Bangle
|
||||
|
||||
First disconnect from Gadgetbridge on your phone. Then connect
|
||||
through the IDE and enter the following code. You should get a pop
|
||||
up screen on your Bangle. This proves that the watch is correctly
|
||||
setup for notifications.
|
||||
|
||||
|
||||
GB({"t":"notify","id":1575479849,"src":"Hangouts","title":"A Name","body":"message contents"})
|
||||
|
||||
|
||||
NOTE: On a Bangle 2, this will fail if you have not installed 'Notifications Fullscreen'.
|
||||
|
||||
### Check that notifications are getting through to your Bangle
|
||||
|
||||
* Disconnect your Bangle from Gadgetbridge on your phone.
|
||||
* Connect through the IDE
|
||||
* Run the following bit of code
|
||||
|
||||
var log = [];
|
||||
function GB(d) {
|
||||
log.push(JSON.stringify(d));
|
||||
}
|
||||
|
||||
* Disconnect from the IDE
|
||||
* Connect your Bangle to Gadgetbridge
|
||||
* Call your phone to get a missed call
|
||||
* Disonnect your Bangle to Gadgetbridge
|
||||
* Connect through the IDE
|
||||
* Run the following bit of code
|
||||
|
||||
log;
|
||||
|
||||
If notifications are getting through then you should see something like.
|
||||
|
||||
|
||||
>log
|
||||
=[
|
||||
"{\"t\":\"call\",\"cmd\"" ... "r\":\"0191xxxxxxx\"}",
|
||||
"{\"t\":\"call\",\"cmd\"" ... "r\":\"0191xxxxxxx\"}"
|
||||
]
|
||||
|
||||
|
||||
IMPORTANT: Now reset your Bangle using a BTN3 long press so that the GB() function is restored.
|
||||
|
||||
## References
|
||||
|
||||
[Bangle Gadgetbridge Page](https://www.espruino.com/Gadgetbridge)
|
||||
|
||||
[Gadgetbridge Project Home](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Home)
|
||||
|
||||
|
|
Loading…
Reference in New Issue