Avatar for halemmerich

halemmerich

Member since Jan 2022 • Last active Apr 2024
  • 9 conversations
  • 267 comments

Most recent activity

  • in Bangle.js
    Avatar for halemmerich

    I've had a play around porting the first of the test cases to json:

    https://gist.github.com/halemmerich/3d0f­1d41d8eebe76eedc8553530e5dd5

    I think this should be all the asserts/features I need. I have a rough implementation for those but it is not yet working correctly.

    Why did you decide on the json based format for test cases? Wouldn't javascript files be better for editing/linting/syntax highlighting?
    Maybe a library that provides asserts and an easy way to setup the emulator for running testcases for a single app? Or the other way round, the test code is a module and apptests.js iterates over the exports which are test functions and handles the environment like now.

  • in Bangle.js
    Avatar for halemmerich

    You should be able to do all that in a github codespace which is free to use for personal accounts for some time and data limits. But at that point I would probably install a VSCode or similar locally instead.

  • in Bangle.js
    Avatar for halemmerich

    0.04 seconds per sample matches 25 samples per seconds, so that probably would be the "Sampling rate" setting.
    Range might be maximum measurable values, maybe with a tradeoff with regard to precision for the higher values.

  • in Bangle.js
    Avatar for halemmerich

    I have the TICKR X 2 which should deliver accelerometer data as well, but as of now I did get nothing out of it with neither Bangle nor NRF Connect app. Might be some hidden/proprietary BLE service.

  • in Bangle.js
    Avatar for halemmerich

    I had done this a while ago: https://github.com/espruino/BangleApps/b­lob/master/apps/android/test.js

    Every step in that would probably map nicely to a test object in the json. I think I could refactor that.

    Maybe some of the asserts would be useful as a teststep in the apptests? I could try to integrate those.

    How does the emulator handle "hardware" like GPS? If it does not I probably need to find a new way to track the state of the "internal" GPS instead of checking the PIN mode like it does currently.

  • in Bangle.js
    Avatar for halemmerich

    I think you hit a case nobody thought about before. At least I did not. "removable" apps are expected to cleanup all changes they did to global state while they are unloaded. In my opinion that includes the loading of fonts.
    Widgets are the one notable exception to this general rule, just because it is not easy to completely get rid of widgets. In your case the app removes the font as it should but the widget still exists and expects it to be there. I suspect the loading of the font only takes place once in the widget and one of the following draws then fails.

    1. Clock loaded, widgets loaded, font available globally
    2. Switch from clock to launcher, widgets still loaded, font removed by clock
    3. Something calls draw of widget, fails because of missing font.

    There are a few possible solutions:

    • Checking for the font in the widgets draw and reloading it if needed
    • Not unloading fonts at all, probably problematic on Bangle 1 because of memory constraints
    • Make the loading of fonts more local to app/widget instead of the global graphics object
    • Attach a counter to a font on load and only really unload it if there is no user left

    There probably are more ways to get this done but some discussion on this will be needed since will affect global behaviour.

  • in Bangle.js
    Avatar for halemmerich

    One thing that I wasn't 100% clear on was whether OWMweather replaces Weather or if it simply provides it with info necessary to pull weather.

    It is neither. OWMWeather pulls weather and writes the same file that Weather uses. You can use it without Weather installed. OWMWeather writes the file and other apps that use weather as written by the Weather app can use it. Weather does use it too and the apps should not conflict.

  • in Bangle.js
    Avatar for halemmerich

    Interesting, OWMWeather checks if the location data file exists, but not if the location data itself is valid. So the question is, where does the broken mylocation.json come from? At a glance there is no way that could happen in the mylocation app code. To me it seems as if it always either sets both lat and long or nothing. Maybe the web interface needs additional checks before writing the file.

  • in Bangle.js
    Avatar for halemmerich

    I just installed the android app and owmweather on a factory reset bangle and forcing a refresh in the OWM weather settings creates the expected output:

    {"t":"http","url":"https://api.openweath­ermap.org/data/2.5/weather?lat=51.50&lon­=0.12&exclude=hourly,daily&appid=apikeyg­oeshere","id":"72500645030"}
    

    Can you check in the IDE if there are errors when you try to manually refresh in the settings? The "http method not found" error hints to a problem with or in the android app. It should be available on the watch independent of GadgetBridge settings. Maybe your boot code somehow got corrupted, in that case going to "Settings->Utils->Rewrite Settings" could help.

  • in Bangle.js
    Avatar for halemmerich

    HRM Accelerometer Event Recorder fails with

    Uncaught TypeError: Puck.connect is not a function
        at connect (custom.html:253:8)
    

    So maybe a change in one of the app loader core updates?

Actions