-
How about this: https://banglejs.com/apps/?id=gbmusic
-
-
Isn't that what Quiet Mode in settings is for?
There is also a widget for quick access: https://banglejs.com/apps/?q=quiet
-
-
For Bangle.js 1 there is this pocket watch hack . Just for fun: Has anyone come up with a similar modification for Bangle.js 2?
-
-
-
-
-
Those examples you give are of the core functions. So firstly on those. If you call getGPSFix() and gps power has not been set on, what happens? I wouldn't suggest changing the core function to auto turn it on, as may be a reason you call getGPSFix without turning on GPS. However in most cases I imagine turning GPS on first is a requirement. So if create a higher level object like a GPS manager, calling myGpsManager.getFix() would check if GPS is currently on, if not set it on first.
Well for the GPS example: If on GPS will drain the battery in ~4 hours. Also after turning it on it needs ~30 seconds (can be much more, up to nearly 15 minutes or a bit less, simplified for this example) until you receive valid data. So what a user usually does not want is
- Have GPS powered on randomly
- Enable GPS, read data, disable GPS
Instead I want to control when to power on GPS or not. When reading the position continously I just want to power on GPS on start and never disable it again (until the app closes). If the use case is to get a position every hour or so the myGpsManager.getFix() (as promise I assume?) might be ok, but if needed can be written a less then 5 minutes, no need to import a big library with maybe 100 functions that are unused.
At even higher level, its likely alot of apps actually want to do the same thing once they have GPS location, like overlay position on an openstreetmap tile.
Currently the only use case I see for overlaying the current position on a map is the openstmap-app and it already does that. Well you could maybe combine "GPS Navigation" or "GPS Trekking" with "openstmap" e.g. overlaying current waypoint and your position on a map (your turn @halemmerich) but you will quickly run into memory constraints, at least on Bangle.js 1.
Will come back with examples once I have started building an app.
Cool every PR brings the ecosystem forward.
- Have GPS powered on randomly
-
Let me try to answer at least some of your questions:
- try https://www.espruino.com/Features (In short no spread operator or optional chaining)
- Boiler plate: When I add a new app I often copy from pages like http://www.espruino.com/Bangle.js+App+Settings
However I do not find it useful to automatically have a settings-file in every new app I create. If the settings-file is unused it just creates useless overhead. While there is some annoying overhead when creating a new app (metadata, icon add about 5 minutes of work) I currently do not see much potential of improvement here.
Long single files of functions (or in some cases not even split into functions)
While I can not really argue against refactoring code into extra functions: Please note that every function you add generates some overhead = slower program. In the (I think it was the) calendar app I once inlined the code of a function I previously extracted because it slowed the execution by 100ms (It was called multiple times).
Lack of object orientated code
Needs more memory, Bangle.js 2 has 256kB of RAM, Bangle.js 1 has much less and we already are at the limit the memory can handle, e.g. the run app on Bangle.js 1.
Third party function libraries you can just import with specific functions around the hardware sensors
What would you change e.g. for GPS? You have setGPSPower(), isGPSOn(), getGPSFix() and the GPS event on the Bangle-Object. What would you make different? There are also some extra modules like modules/buzz.js
Lets take the Anton clock as an agument against, there are two versions of it: Anton Clock and Anton Clock Plus. The latter includes some extra code that you notice when starting the clock (feel free to try it out).
Do you have a specific (small) example, e.g. an app where you would refactor something? Or maybe comment on an existing pull request on what you would make different? (However I can not speak for all authors if they want your comments)
Disclaimer: I'm not an espruino expert, I'm just someone who made one or two changes to Bangle.js apps.
I see your points, I'm just skeptical that every refactoring someone would make in a Browser/Node.js environment is a good idea in a resource constraint one.
- try https://www.espruino.com/Features (In short no spread operator or optional chaining)
-
-
-
-
Did anyone else notice graphical glitches with firmware 2v18 and a few games e.g. bullets not visible in Asteroids?
If I remove the setting of doublebuffered from asteroids.js#L17 I see them again btw (with flickering).
Ball Maze is another candidate.
-
-
Also happens from time to time to me. You can try the attached file, install it as baroreset.settings.js from the IDE and go to settings->applications->baroreset. Use at your own risk.
-
-
You could for example test the existing algorithm against https://ubicomp.eti.uni-siegen.de/home/datasets/ichi14/index.html.en which SleepPhaseAlarm is using.
-
If you want to compare the Bangle.Js please only compare it to a chest belt like the "Polar H10" mentioned above. All wrist measurement devices do lie you can not decide for each indidivual which one does lie more without a reference measurement.
@adjtm
To be honest this is the dirty part which can be improved, it is the following code:const file = require("Storage").open("hrmlog.json","w"); Bangle.setHRMPower(1); Bangle.setBTHRMPower(1); Bangle.on('HRM', (hrm) => { console.log(hrm); const json = JSON.stringify({now: new Date(), hrm: hrm}); file.write(json + ",\n"); }); Bangle.on('BTHRM', (hrm) => { if (hrm.bpm > 0) { console.log(hrm); const json = JSON.stringify({now: new Date(), bthrm: hrm}); file.write(json + ",\n"); } });
The json is converted to csv and then given to PlotJuggler.
Next time I will change this to record in csv so no conversion is required.
bthrm must be configured not to overwrite the internal measurement. -
-
You do realize, that you can access the Bangle with e.g. python/bluepy and execute any command, e.g. require("Storage").read() on it?
It should be possible to boot service/widget record the data and download later with these commands.
-
-
..or you can just add the festival locations as waypoints . openstmap renders them.