I’m on Pebble Time 2 and am building a watchface with custom gesture detection. I’m trying to get data to train a model (accelerometer sampling for gesture recognition training data). App installs and runs fine via .pbw sideload, but no data is reaching my collector that is a python flask app running on my Mac.
Setup:
- Pebble Time 2, app installed via
.pbwupload (not CloudPebble Install and Run, which fails separately with connection errors) - C watchapp samples accelerometer at 50Hz into 75-sample windows, then sends via AppMessage in 5-sample chunks
- PebbleKit JS
appmessagelistener forwards each chunk viaXMLHttpRequestPOST to a local Flask server on my Mac - Flask server confirmed working via
curl(same network, same IP) — POSTs succeed and write to CSV correctly outside of the watch
Any ideas what I’m missing?
--
var MAC_URL = “http://192.168.0.22:5050/chunk”; // Change to your Mac’s IP
Pebble.addEventListener(“ready”, function() {
console.log(“PebbleKit JS ready”);
});
Pebble.addEventListener(“appmessage”, function(event) {
var payload = event.payload;
var xhr = new XMLHttpRequest();
xhr.open(“POST”, MAC_URL, true);
xhr.setRequestHeader(“Content-Type”, “application/json”);
xhr.onload = function() {
console.log("HTTP " + xhr.status);
};
xhr.onerror = function() {
console.log(“HTTP failed”);
};
xhr.send(JSON.stringify({
window_id: payload.WINDOW_ID,
label: payload.LABEL,
offset: payload.OFFSET,
chunk: payload.CHUNK
}));
});