-
-
I'm hoping to use Bluetooth LE and my Bangle.js 2 to let my Linux laptop detect whether I'm it. I've read all kinds of Linux tutorials on using hcitool, gattttool, and other command-line tools, but I've never been able to get one of them to detect the watch. (It detects my phone and other devices just fine.) Does anyone know of a way to detect whether the watch is nearby on the Linux command line?
Thanks for any clues.
-
Thanks for all of your help.
I had already studied the modules README carefully and at length. I had also checked my search path. But those were good ideas.
Over night, I got another idea, and it worked: I cleared all of my cookies from
espruino.com
. After that, I was able to use the IDE to store the app without an error in the Chrome console.However, all
Bangle.http
requests failed without even appearing in the web server's logs. Another form of resetting solved that problem: I rebooted the phone and the watch. The app immediately started communicating.Whew! I don't know how many times I'm going to have to learn this lesson: whenever something doesn't work, just turn it off and on again before trying anything else.
-
I'm wondering whether the problem is just that my code isn't being loaded by the IDE when I hit the
Send to Espruino
button. When I press the button, the left panel flickers, but there's no indication that anything is uploaded to the watch. Also, when I open the console in Chrome Developer Tools, I see this stack trace whenever I hitSend to Espruino
:index.js:93100 Uncaught TypeError: Cannot read properties of undefined (reading '0') at nextCh (index.js:93100:15) at Object.getLexer (index.js:93107:5) at getModulesRequired (index.js:98985:35) at loadModules (index.js:99110:20) at Array.<anonymous> (index.js:98949:7) at cb (index.js:92893:15) at Object.callProcessor (index.js:92898:5) at Object.getEspruinoCode (index.js:95560:14) at index.js:100584:30 at Object.ensureConnected (index.js:100846:7)
-
I updated all the apps on my watch for the first time in months, and now I'm unable to use the web IDE to load the custom Bangle.js 2 watch face I wrote that has been working fine for over a year. I'm probably missing something obvious, but I haven't been able to figure out the problem after hours of trying. The basic problem is that
require("Layout")
fails withUncaught Error: Module "Layout" not found
. When I look at the IDE's "board information" in Settings (see below), it shows the correct board, i.e.BANGLEJS2
, butMODULES
doesn't includeLayout
. But the documentation still talks aboutLayout
, and that library is used in many examples, so it doesn't appear to have been deprecated. Am I missing something obvious?Thanks very much.
VERSION 2v20
GIT_COMMIT fcc9ba4f1
BOARD BANGLEJS2
RAM 262144
FLASH 1048576
SPIFLASH 8388608
HWVERSION 2
STORAGE 8388608
SERIAL 76b4caad-5ff7556e
CONSOLE Bluetooth
MODULES Flash,Storage,heatshrink,crypto,tensorflÂow,locale
EXPTR 495068
APP_RAM_BASE 536884832 -
Wow, I hadn't heard of the Widget Editor app. That is a great idea.
What I ended up doing was to define my own
Bangle.drawWidgets
that makes widgets clear only their own space. Then I made my watch face use the entire display. Since it's circular, there's still room at the corners. All the widgets that I use fit in that space without modification, so I'm done. But with Widget Editor, it will be possible to squeeze even more widgets onto the screen.Thanks.
-
You're absolutely right, of course. I've modified my own app with a modified
drawWidgets
, as you suggest. That's working nicely. In my case, having the widgets clear only the area that they use is great because it leaves the space between them for the top of my clock face, which can now use the full screen area. As long as I don't install too many widgets, there won't be any overlap. -
-
-
I've followed the instructions on uploading modules, but I get
Uncaught ReferenceError: "exports" is not defined
when I try that withwidget_utils.js
. -
Cool. But I tried
require("widget_utils").swipeOn();
and got this:>Uncaught Error: Module widget_utils not found
That happened both in the emulator and on the watch. The same thing happened when I tried loading the Pebble watch, which uses that API, through the IDE.
I hope I'm not missing something obvious.
-
I have an app that has a round face. I've shifted it down to make space for the widgets at the top of the screen. However, if I were able to move the widgets inside the circle, I'd be able to take full advantage of the height of the screen. Is there any way to do that, or might it be a feature in the future?
Thanks.
P.S.: I love hacking my Bangle. It's such a pleasant programming experience, without a lot of unnecessary complexity. It's possible to write interesting programs in just a few kilobytes of RAM. It brings me back to the days of my TRS-80, but with JavaScript instead of Z80 assembly language!
-
In
apps/antonclk/app.js
, this comment appears:Must be inside our own scope here so that, when we are unloaded, everything disappears.
Does anyone know what that means, exactly? In the previous version of the clock, that comment appeared, and the functions inside it were declared using the usual
function foo() {
syntax, which made the IDE complain. Now they're all defined likelet foo = function() {
, which makes the IDE stop complaining, but I don't understand the reason for the containing block.I apologize if I missed this somewhere obvious in the documentation.
-
-
-
Yes, thank you. I did, indeed, make that mistake one time, but I figured that out.
I tried the IDE using my Mac, too, and have never succeeded there. It may not have BLE support, although it does sometimes show the Bangle.js 2 as a pairing option. But I prefer to write code under Linux.
Anyway, thanks to everyone for the suggestions. So far, no go.
-
-
I hope I'm not missing anything obvious, but connecting Bangle.js 2 to the browser IDE under Linux via Bluetooth consistently takes twenty minutes of fiddling, and I never know what I've done that finally makes it work. On the other hand, I almost never have trouble connecting with my phone. I've read and followed the instructions on the various Bluetooth pages, and I've dived into
bluetoothctl
and other tools, but nothing seems to improve the situation. I'm running Chrome under Pop!_OS 22.04 LTS.Does anyone have a magic incantation that makes connecting to the IDE under Linux quick?
I've been having a great time hacking my Bangle, but twenty minutes of fiddling is a lot, especially now that I'm writing code that needs GadgetBridge features that aren't supported in the emulator.
Thanks for any suggestions.
For about a month now, every few days, my Android Pixel 7 phone and Bangle.js 2 get into a strange state: the phone makes a "ping" sound and pops up a notification that says "Pairing request\nTap to pair with null." This happens once per minute until I reboot both the phone and the watch.
Curiously, after I reboot, the watch has disappeared from the list of paired devices. I use Device Unlock to keep the phone unlocked when my watch is near. Because the watch is no longer paired, I have to set that up again.
I'm not sure where to start debugging this problem. I haven't changed the watch's software in a long time, so I'm wondering whether an update to Gadgetbridge or Android is the cause.