-
I don't know exactly what I was doing on the beginning that I'm not doing anymore, but sometimes I had to run this command below to make linux forget the connection and start over. May be new firmware, but I haven't needed to run the command since mid-January
sudo rm -rf /var/lib/bluetooth/04\:6C\:59\:0D\:2B\:D5/ && sudo service bluetooth restart
(The device address should be different)
-
-
-
-
-
-
-
Also, I've just made a pex (executable) file from the sample script I've sent earlier, it's attached, if you want to try it out.
The pex is just a glorified zip file, so you can open it and check out inside, but you can execute with:
./send_time.pex 'aa:bb:cc:dd:ee:ff'
The usage:
usage: send_time.py [-h] [--correction CORRECTION] address Bangle send time positional arguments: address bluetooth address to connect optional arguments: -h, --help show this help message and exit --correction CORRECTION milliseconds to add to time to compensate for connection time
-
Sorry, @Numerist, I think I was still a bit programmy on my response.
In more broad terms, the script above when executed on a computer with bluetooth sets the clock on the bangle to the time of the computer.As the communication of the command between pc and bangle is kind of fast, there's little need for compensating (50ms in my tests, but you can antecipate and correct for that if you wanted)
-
This is one approach: it connect to bangle then sends the computer time (hopefully a good time)
within the command to update bangle. Then you have only the delay of the communication with the device, which can be measured and adjusted.On my device, this is the average for 100 samples: 0.05636221885681152s, so I could adjust to add 50ms on the time sent to the device to compensate.
-
-
Hi, the code below should work to send the time to the device: it opens the connection, sends the command to update date, and then closes the connection.
import asyncio from time import time from bleak import BleakClient UUID_NORDIC_TX = "6e400002-b5a3-f393-e0a9-e50e24dcca9e" UUID_NORDIC_RX = "6e400003-b5a3-f393-e0a9-e50e24dcca9e" async def main(address): buffer_size = 20 print(f"Connecting to {address}...") async def send_command(command): c = command while len(c) > 0: await client.write_gatt_char(UUID_NORDIC_TX, bytearray(c[0:buffer_size]), True) c = c[buffer_size:] async with BleakClient(address) as client: print("Connected") print(f"Time: {time()}") await send_command(bytes(f"setTime({time()});\n", "utf-8")) asyncio.run(main("d8:ee:7c:31:a9:c0"))
I'm using something similar to this to periodically sync weather data and my personal agenda with the device
-
-
Yes, I think that's it: there is more touch area to the right of the screen that I can reach with touch or drag, but is seems to be definitely offscreen.
And then there is the other thing with touch, where sometimes the touch is a little bit off the touch point, that's what misguided me to think I needed to readjust the positions, some confirmation bias I guess.
-
@rigrig I don't intend to do anything like that anytime soon, BUT I really liked the concept here, thanks for the idea in general.
-
@Gordon just tested, and it worked fine. I don't have a stylus so you'll have to take this with a grain of salt, :P
After this, I've made a second test with the following codes:
Bangle.on("touch", function (button, tap) { g.setColor("#000"); g.fillCircle(tap.x, tap.y, 5); }); Bangle.on("drag", function (tap) { g.setColor("#000"); g.fillCircle(tap.x, tap.y, 5); });
What I've found is: drag is really consistent, touch has a few odd positions here and there.
-
+1 for the idea, I also think it's a good solution.
One thing to notice, I don't know how many of you do the same, but I've changed my apps.json to only show the apps that I've changed on my github, so it's easier to understand, move around, etc.
On local file, it's easy: just edit the apps.json, but on github, how would that be done? Removing the metadata from everything else? Maybe some kind of whitelist config I can push?
-
How does the coordinate reported match up with where your finger is? Is it actually underneath?
I've made a 3x3 launcher, and was misfiring the launcher on the middle column of apps, mainly because as my range on x was 0-191, the column was a few pixels (around 5?) more to the left, and another 5 or so pixels short, making it that the last 10 or so pixels was already for the next column.
Something like the attached image, where green was the drawn and expected grid, red was the touch feedback. Certainly not as precise but definitely noticeable, and when I compensated for it, it started behaving much better.
-
-
I've made this into an option on Languages:
diff --git a/apps/locale/locale.html b/apps/locale/locale.html index 90a2e8d4..fa857d9f 100644 --- a/apps/locale/locale.html +++ b/apps/locale/locale.html @@ -10,6 +10,9 @@ <select id="languages" class="form-select"> </select> </div> + <div class="form-group"> + <input id="translations" type="checkbox" checked /> <label for="translations">Mark this option if you want translations for commont text like "Yes", "No", "On", "Off".</label> + </div> <p>Then click <button id="upload" class="btn btn-primary">Upload</button></p> <script src="../../core/lib/customize.js"></script> @@ -106,12 +109,18 @@ exports = { name : "en_GB", currencySym:"£", const lang = languageSelector.options[languageSelector.selectedIndex].value; console.log(`Language ${lang}`); + const translations = document.getElementById('translations').checked; + console.log(`Translations: ${translations}`); + const locale = locales[lang]; if (!locale) { alert(`Language ${lang} not found!`); return; } + if (!translations) + locale.trans = null; + const codePageName = "ISO8859-1"; if (locale.codePage) codePageName = locale.codePage;
-
Hi, I've made a fork of the Languages app just to change the pt-br locale so it will only use formatting, not translation of text. I.e. I added en-br where I removed the "trans"from the json (commit).
trans: { yes: "sim", Yes: "Sim", no: "não", No: "Não", ok: "certo", on: "ligado", off: "desligado" }
What motivated me was the fact that I want formatting in pt-br, but showing a few menu options in portuguese mixed with english text was odd.
Is this common? Could this be a use case that justifies having this as an option for the users?
-
-
Also tested, my ranges are:
x ∈ [0,191]
y ∈ [0,189]range_x = [50,50]; range_y = [50,50]; Bangle.on('touch', (button, xy) => { if (xy.x < range_x[0]) range_x[0] = xy.x; if (xy.x > range_x[1]) range_x[1] = xy.x; if (xy.y < range_y[0]) range_y[0] = xy.y; if (xy.y > range_y[1]) range_y[1] = xy.y; console.log("ranges are", range_x, range_y); });
-
This is definitely something I changed here, and it might have made all the difference.