• Hello! And in advance sorry, my questions will probably have a lot of repeat with past posts that I missed.

    First, thank you for the great project! This is the first smartwatch that I encountered after looking for an open source (and fully programmable!) one to replace the existing which ask and send everything about our life somewhere we did not ask for. Plus the way it is working seem really interesting, I hope I will be able to contribute even a little to it's content.

    I discovered about the Banglejs at the start of the week, ordered it the day after and received it today with a lot of reading about how to use it in between. But it being really fresh for me, I did not find all the answers I looked for. Si here I am with my questions!

    1. the Bangle init sequence
    From what I have gathered after playing it a little, clearing everything on the storage leave only the firmware starting, and this one give a default init screen with some infos and the bluetooth activated to allow communication with the web apps store/ide.

    If the bootloader is installed, the Banglejs will run the content of .boot0 then .bootcde at every restart. And it is apparently just the files, event without the bootloader app installed everything work with just them. Not sure where is defined that the press of the button call for the launcher through, is it hard coded in the firmware? Or is it a behavior we can change? Same question for the other way, will pressing the button from the laucher always will look for a clock to run/relauch the .boot files

    If that is the case, the minimum files required for a full working watch would be the 2 .boot files, a launch.app.js and at least a clock app if mandatory or if not a "main" app to replace it I guess.

    Is the firmware open too? Can we look at it / participate in it's evolution?

    I think that is already a good list, thank you in advance for your answers!

  • Is the firmware open too? Can we look at it / participate in it's evolution?

    Yes, it is built from. I have never built the whole thing, but it is possible.
    It is written in C and supports the whole Espruino based product range.

    https://github.com/hughbarney/Espruino

    Not sure where is defined that the press of the button call for the launcher through

    This is done by each App using the
    https://banglejs.com/reference#l_Bangle_­setUI

    It is possible to build a clock app that wont restart the launcher. If you set that clock as the default clock the only way out of that situation is to delete the app using the app launcher or the specific files through the IDE.

    The behaviour of the launcher is controlled by the specific launcher app. You can choose from several different launchers.

  • Thank you for these explanations!
    With that and some more reading of the references and tutorial I think I almost have a first application to try and submit for touchscreen calibration!

    After reading the tutorial "Bangle.js Software Modification" I am currently searching how to override the function defining the event Bangle.touch, the one that set the button and xy variable that we can read.

    I think it is linked at least partially to this in the firmware:
    https://github.com/espruino/Espruino/blo­b/master/libs/banglejs/jswrap_bangle.c#L­347
    and https://github.com/espruino/Espruino/blo­b/master/libs/banglejs/jswrap_bangle.c#L­1589
    So I am not sure if there is really any control possible before that.

    up until now from the tutorial I tried adding a app.boot.js to set my own listener, and I guess that work everywhere like I intend to, but I am not sure if it will affect the other app if by example I change the value of x or y in my function, a few test showed that it is not the case. If you have any ideas?

    For now the application for gathering the calibration data itself seem to work fine, tomorrow I will probably look how to save them and make a some settings and an icon. But after that I will stuck for some time I guess.

  • Hi - the code that calls the touch event is C code in the Bangle.js firmware as you note.

    What are you attempting to change? As the coordinates are an object, you should be able to change them if you can ensure that your Bangle.on('touch' handler runs first...

  • Hey :)

    As an example, from what I gather from my saussage fingers with the Bangle, when I touch the screen I am on average 12 pixel to the left and 14 pixel lower than were I aim. My goal is to correct this offset via an application.

    I assume Bangle.on('touch', ...) is the main system used by everything, I missed the wanted option already to many times in the default setting menu to admit a number, so I was hoping to correct that and fix it with a myapp.boot.js file. In a way that seem to work since I got my debug text on every screen, but I am not sure any of the change I do inside the function do anything, even while setting extreme offset the expected result happened.

    I guess it would be better to completly finish the application first then ask for advice if it is still not working. I will try to finish everything this week if that help

  • Hi - just as a quick test, if you do:

    Bangle.on('touch', (b,e) => {
      e.x += 20;
      e.altered = true; // a new field
    });
    
    Bangle.on('touch', (b,e) => {
      print(e);
      g.clear(1).fillCircle(e.x, e.y, 5);
    });
    

    It appears to be working, printing stuff like { "x": 64, "y": 25, "type": 0, "altered": true }.

    But yes, if you can show us what you've got we can take a look. Adding a field to the object is a good way to see if you've been able to actually change what's in it...

  • Hi,

    In the end I assume it work well since I fail a lot less my input while trying it.
    I put everything here, for now it work by putting the boot file on the Bangle and running the app from RAM then reload. It is a little dirty and use too many write, but was quick to finish for trying it and not letting the conversation hang too long.

    Since everything seem ok (?), I am now in the process of cleaning it, making it work completly then setting everything for it to work in the app loader if that may interest some people before it eventually become obsolete.

    Edit: now working and ready to be tested here

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

How work the banglejs 2 and what are our possibilities with it?

Posted by Avatar for Kane @Kane

Actions