-
Using the Sched library would be really helpful to me but every timer/alarm I generate also appears in the alarms app which is a bit annoying since in the app I can't differentiate between them. Is there a way to generate custom alarms that don't show in the app?
Even better would be a possibility to have a kind of bangle.showMenu that shows the same option as the alarms app but only with alarms I selected eg. using appid.
-
Hey @Ganblejs, thanks for the feedback!
I like the idea of being able to input additional notes, though I'm not sure if that deviates too far from the original idea of the app. I'll play around with Noteify a bit and see.About the scheduler, I've originally intended to use it but after reading throuh the README.md I didn't find a way to hide the timers/alarms from the Alarm app. That made it really clunky to use. If possible it would definitely be useful since it saves resources. Since timing accuracy is really not important I was also planning to look into unloading as much as possible from ram but I'll need to read up more on JS...
-
I have finally gotten around to reading up on js and have written a small app that I've been needing for a while now. If you (like me) have the tendency to push off non-timecritical tasks long enough to completely forget them this may help you as well. Once activated (by executing the app) it will buzz every few minutes (buzz pattern and interval selectable) to remind you to take out the trash, write the annoying email or get up and finally drink a glass of water. I you want to ignore the task a bit longer the app will simply keep buzzing every x minutes until you deactivate it again. It is also great if you're currently doing something and someone wants you to do something afterwards. Just activate the app (I have it set to swipe right on the clock screen) and you won't forget about it immediately after they leave.
You can also set it to start buzzing at a certain time everyday eg. to remind you to take meds.
While active it will also show a widget, the app can be set to respect quiet mode.
You can find the app unter https://jonamb.github.io/BangleApps/?q=annoy
Feedback is greatly appreciated (also for a different name). Once I've used it a bit longer and made sure it works as advertised (and read up on GIT usage) I'll put in a PR. -
-
I'm writing a small app and for programming/debugging I'm using an unoly mix of GitHub editing, Notepad++, WebIde and alot of copy and paste. I'd love to use the WebIde for more but since it (to my knowlege) doesn't support editing multiple files at once and also I can't get the projects setup to work it is really cumbersome to use. Projects worked with the native windows version, however I had problems with the connection including dropped characters so I went back to the web version.
What setup would you recommend for someone who doesn't have alot of JS (and for that matter git) experience?
Thanks! -
-
-
I'm trying to program the settings for an app. All bigger numerical values show up and are selectable without any problems. However the last setting can be selected between Always/Alarms/Never. It shows up nicely in the menu but when I try to select an Item I get a horribly garbled error message in the console and nothig is saved to JSON. However the value in the variable is correctly set. The "Weekend Start Hour" menu works as it is supposed to however the "Follow DND" gives the error.
If I remove writeSettings() from line 31 the menu works as expected but of course it then doesn't save anything when switching apps.
This is the code in question:
( function(back) { var FILE = "annoy.json"; var dndChoices = ["Always", "Alarm", "Never"]; var settings = Object.assign({ // Default values wes: 13, dnd: 0}, require("Storage").readJSON(FILE, true) || {}); function WriteSettings(){ require("Storage").writeJSON(FILE, settings); } E.showMenu({ "" : {"title" : "Annoy"}, "Weekend Start Hour": { value: 7|settings.wes, min: 0, max: 23, onchange: v => { settings.wes = v; writeSettings(); }, format: v => v+"h", }, "Follow DND": { value: 0|settings.dnd, min: 0, max: 2, format: v => dndChoices[v], onchange: v => { settings.dnd = v; console.log(v, settings.dnd); writeSettings(); }, }, }); })(load);
And the error:
> |___| _ |_| espruino.com 1 1 Uncaught ReferenceError: "writeSings(); a.value);r.scroll=l.scroller.scry<a.y-4||(b=k(c.y),(0>f||0<=b)&&d from line 1 col 17 d.handled|
-
I timed every step as you said, the service discovery takes most of the time, up to 4 seconds.
Bonding does make a difference but below one second and since it's apparently necessary to do before doing anything else, I'll leave that in for now (when I moved it to later in the code, it didn't work anymore).When I have the primaryService, the characteristics take about 300ms each, and maybe I can even shorten that by just using getCharacteristics and directly assinging both instead of looking for both indivitually. But this is also small compared to the time it takes for the primaryService.
Is there any way to "cache" the primaryService for later use (and store it in a JSON or something like that)?
-
Hey fanoush,
thanks for the reply! I now tried to remove the startBonding step but if I omit that, nothing happens on the Device despite all other actions succeding.Here is the complete code I use to control the device. Maybe there are some steps that I could remove or speed up to save time, I'd be very grateful for any hints (or also JS best practice remarks, I haven't worked with JS before). Also, does console.log take up alot of time?
NRF.connect(ST_ADDRESS).then(function connectComplete(connection){ st = connection; console.log("Connected to", connection); return st.device.gatt.connect(); }).then(function(gatt) { st_gatt = gatt; console.log("connected"); return st_gatt.startBonding(false); }).then(function() { console.log("bonded", st_gatt.getSecurityStatus()); return st.getPrimaryService("51361500-c5e7-47c7-8a6e-47ebc99d80e8"); }).then(function serviceComplete(service){ st_service = service; console.log("Got Service", service); return service.getCharacteristic("51361501-c5e7-47c7-8a6e-47ebc99d80e8"); }).then(function statusComplete(data) { st_status = data; console.log("Status Success", st_status); return st_service.getCharacteristic("51361502-c5e7-47c7-8a6e-47ebc99d80e8"); }).then(function statusComplete(data) { st_motor = data; console.log("Motor Success", st_motor); ).then(function start() { return st_status.writeValue([1]); //Send enable byte }).then(vibrate, console.log);
I've heard about the security risks associated with these devices if nrf dfu remains possible, however this particular device (plug-ilicous 2) seems to use a realtek ic. Although I love the idea of a buttplug running js (the most direct way to tell someone to shove JS up their ass...) :D
-
-
I'm currently working on a small app that allows to control a ... marital aid of the satisfyer variety via BLE. After learning that the connection needs to be bonded (I'm not really experienced in BLE yet) I also managed to control the device quite well. However, everytime I restart the app or go back to clock, the device is disconnected and I need to re-bond it, which takes alot of time. Is there a way to have a persistent connection in the background that stays active (and send a keepalive every ~100ms) or at least be able to skip the bonding procedure to save time?
Thanks!Also, if I get the app to work more consistently, it shouldn't be that hard to change it to also work with sextoys from different brands and add features like control via accelerometer etc. I'd love to upload it once finished but due to the nature of the app I'm not sure if Gordon/the team would like something like this in the official store.
-
-
I've just begun trying to program my first app for bangle.js 2, a very simple reminder. Idea is, you activate it by pressing button 1 three times. While it is active, a small widget is shown and it vibrates every x minutes. You can deactivate it by pressing the button again three times. You can also automatically activate it at x o'clock, for example to gently remind you to take medicine or not forget something without needing to be "snoozed" like a mobile phone alarm.
I've realised it before with an Amazfit Bip and Tasker which was very convoluted but turned out to be really helpfull to remind me of stuff. (Timed activation to take afternoon medication, spontaneous activation to not forget doing x while doing something else).
I have the basic software running, but as I am completely new to js and bangle (but have experience in C an Python) I don't fully understand variable and action "scopes". I have the code saved as annoy.boot.js so it is executed automatically and just starts a listener for a button event. I've also defined variables there if the function is active or not. However, everytime I change back from the launcher to clock or app to clock, I think the settings are lost.
Is there a good primer on js/bangle.js, which "scope" (are they called frames in js?) is active at which status and what happens/what is deleted when switching from app to clock?
Thanks in advance and huge thanks to Gordon and the team for making it super easy to go from no idea in js to first prototype app running on actual hardware in about a day!
-
-
Since I've updated settings 0.33 => 0.35 and bootloader 0.36=>0.37 I've had problems with my locale not having any impact anymore. When setting the time with either gadgetbridge or Bangle.js App Loader, it always shows GMT instead of GMT + 1 (German time, which I set it to). I can manually set the time on the device to the correct value (advancing 1 hour) but the next time I connect via BLE, the time is overwritten.
The locale->TimeZone setting always stays at the correct value, it is just ignored.
I never had that problem before updating yesterday. I'm not exactly sure which versions I updated from but I've been doing updates very frequently so I think the version numbers should be correct.
I'm reasonably capble with the Web IDE so if there's any info/dump that would help, please let me know.
Edit: I'm using Bangle.js 2 btw.
Regards
IIRC the alarms app also doesn't show if an alarm has more info attached. So it is not immediately apparent if a Sched entry was made by alarms or a different app.
I think there are ways in which the alarms app could be extended to be very helpful for other apps as well. Every app that implements an own kind of alram could be added to a list and when creating a new alarm you could at the end have an option to select between a normal kind of alarm or a noteify/etc kind of alarm. Then if you activate an alternate app, there could be a link to a showMenu function of said app so you could configure the kind of alarm (eg. the message to be displayed by noteify) directly from a submenu of the alarms app.
The alarms app would then display all alarms sorted first by app (with own alarms first and then the ones by different app) with a seperator for every app.
In addition you should still be able to set any alarm to hidden if you don't want it modifiable by the alarms app.
That would for me be the perfect way to add custom functionality to alarms/sched without having to rewrite large parts of the software.