This is great news, thanks Gordon for the work in Gadgetbridge!
I already played with the ble-gateway on a esp32 for a smarthome-control-app but always had problems with coverage in my house. Over the phone should be much more reliable.
So I tried via Intents and an Android-App called "Broadcast to MQTT" but I only get one out of 10 messages arriving in this app. My watch is in 10-20 cm distance to my phone.
Can anyone guess what could be the problem?
Or is BLE in general as unreliable as I'm experiencing, so I would have to build a repeat-function on the bangle and then merge duplicates together on nodered? Or is there a possibility for a Callback (seems like global.GB = (event) => .. is currently not called with intents) to verify that gadgetbridge has recieved the message.
Below my test-code for my bangle2 :
var Layout = require("Layout");
var layout = new Layout( {
type:"v", c: [
{type:"txt", font:"6x8:2", label:"A Test", id:"label" }
]
}, {btns:[
{label:"One", cb: l=>httpCall("One"), cbl: l=>httpCall("One long press")}
], lazy:true});
g.clear();
layout.render();
var counter=0;
function httpCall(){ Bluetooth.println(JSON.stringify({t:"intent",action:"com.sonyericsson.alarm.ALARM_ALERT",extra:{key1:"asdfas",}}));
counter++;
setLabel(counter);
}
function setLabel(x) {
layout.label.label = x;
layout.render();
}
global.GB = (event) => {
if(event.t == "intent"){
if(event.err)
E.showAlert(event.err);
else
E.showMessage(event.resp +"from MQTT");
}else{
E.showAlert("Event was: "+event.t);
}
};
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
This is great news, thanks Gordon for the work in Gadgetbridge!
I already played with the ble-gateway on a esp32 for a smarthome-control-app but always had problems with coverage in my house. Over the phone should be much more reliable.
So I tried via Intents and an Android-App called "Broadcast to MQTT" but I only get one out of 10 messages arriving in this app. My watch is in 10-20 cm distance to my phone.
Can anyone guess what could be the problem?
Or is BLE in general as unreliable as I'm experiencing, so I would have to build a repeat-function on the bangle and then merge duplicates together on nodered? Or is there a possibility for a Callback (seems like global.GB = (event) => .. is currently not called with intents) to verify that gadgetbridge has recieved the message.
Below my test-code for my bangle2 :