Avatar for jgw

jgw

Member since May 2021 • Last active Sep 2023
  • 14 conversations
  • 41 comments

Most recent activity

    • 5 comments
    • 397 views
  • in Bangle.js
    Avatar for jgw

    Hi,
    We've recently bought a new batch of 'Bangle.js 2' devices. These are programmed with our application in the production department of our company and, to our surprise, the application failed on all devices. Font sizes were wrong, dark/light theme switching did not work, etc...

    After a day's worth of debugging, I tracked this down to a change in 'Bangle.setUI()' which now seems to reset the Graphics object to its default state. This means that after every call to setUI(), one needs to re-initialise the graphics engine (in my case : g.setFont, g.setColor, g.setBackground, g.setFontAlign, ...).

    Our application uses setUI() a lot because, depending on the display mode, different touch gestures are used (and thus distinct callbacks are often removed/registered).

    Is my analysis correct ?

    If so, may I ask that, in future firmware releases, such large changes are implemented in a new method (e.g. Bangle.setUIAndReset() ?) so that these do not break existing applications?

    Thank you.

    • 7 comments
    • 1,187 views
  • in Bangle.js
    Avatar for jgw

    No, it was one of the last order. The 2 pre-production models are still going strong - been traveling to 3 trade-shows so far, without problems. Nice !

  • in Bangle.js
    Avatar for jgw

    OK. Does that mean the bracelet is 'lost' or can I send it back, get it repaired, replaced ?

  • in Bangle.js
    Avatar for jgw

    Wow, that is an odd one. You could try pinMode(BTN1,'pulldown') and see if that helps?

    No... Only the simple pinMode statetment seems to help. Odd...

    >setInterval(function(){print(digitalRea­d(BTN1))},1000)
    =4
    0
    0
    // Multiple BTN1 presses
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    >pinMode(BTN1,"input_pulldown")
    =undefined
    0
    // Multiple BTN1 presses
    0
    0
    0
    0
    0
    0
    0
    0
    0
    >pinMode(BTN1)
    =undefined
    0
    // 1 BTN1 press
    0
    1
    >
     ____                 _
    |  __|___ ___ ___ _ _|_|___ ___
    |  __|_ -| . |  _| | | |   | . |
    |____|___|  _|_| |___|_|_|_|___|
             |_| espruino.com
     2v10.89 (c) 2021 G.Williams
    > 
    

    Remark the Espruino prompt at the bottom : after a (detected) BTN1 press, I see the Settings/About/... screen, but no responses to BTN1 anymore. Also the setInterval seems to have stopped ??

    When you do pinMode do the 0 and 1 correspond to your actual button presses or are they random?

    The 0/1 values follow the BTN1 presses

    If you're pressing the button for >1 second then you'd expect the Loading screen to appear though as it tries to reload the default app - could that be it?

    I don't think so. I've tried to 'quickly' press BTN1. This is below 1 second, I guess

    Also when it's not working could you run getPinMode(BTN1) and...

    >
    >getPinMode(BTN1)
    ="input_pulldown"
    > 
    

    Strange...

    I continued my search after I discovered the factory reset function. This should really put everything back to a know state, I suppose. I then installed a simple setWatch :

    >
    >Bangle.factoryReset()
    Erasing Storage Area...
    Erase complete.
    Writing initial storage contents...
    Write complete.
    =undefined
    >setWatch(function(){print("Yes!")},BTN1­, {edge:"rising", debounce:50, repeat:true})
    =2
    >
    // BTN1 presses, no result
    >
    >
    >pinMode(BTN1)
    =undefined
    > 
    // BTN1 presses, no result !!!???
    

    Next I uploaded Espruino's RAM, where I found something strange - to me at least :

    //...
    setInterval(function (undefined) {return WIDGETS["bat"].draw()}, 60000); // 3
    // [native code]????
    setWatch(function () { [native code] }, D17, { repeat:true, edge:'falling', debounce : 24.99961853027 });
    setWatch(function () {print("Yes!")}, D17, { repeat:true, edge:'rising', debounce : 49.99923706054 });
    // Code saved with E.setBootCode
    //...
    
    

    Is that '[native code]' part supposed to be there ?

  • in Bangle.js
    Avatar for jgw

    I have a Bangle.js 2 which no longer wakes up at a BTN1 press. I've completely cleaned the watch ('Remove all Apps' and 'Install default Apps' from https://banglejs.com/apps/) , but to no extent.

    When in the Web IDE, I can indeed see that the BTN1 pin stays at zero, whether pressed or not.

    >reset()
    =undefined
     ____                 _
    |  __|___ ___ ___ _ _|_|___ ___
    |  __|_ -| . |  _| | | |   | . |
    |____|___|  _|_| |___|_|_|_|___|
             |_| espruino.com
     2v10.89 (c) 2021 G.Williams
    // BTN1 released
    >digitalRead(BTN1)
    =0
    // BTN1 pressed
    >digitalRead(BTN1)
    =0
    // BTN1 pressed
    >digitalRead(BTN1)
    =0
    

    One could assume hardware failure, but the strange thing is that after a 'pinMode(BTN1)' statement, a digitalRead does react as expected.

    >setInterval(function(){print(digitalRea­d(BTN1))},1000)
    =1
    0
    0
    // Various BTN1 presses following
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    >pinMode(BTN1)
    =undefined
    0
    0
    //BTN 1 detected !!!
    1
    0
    1
    1
    0
    1
    0
    1
    1
    >
    // Here the watch suddenly shows 'loading' and returns to the normal screen with non-functional BTN1
    

    Then after a few seconds, out of the blue, the watch shows 'loading...', the normal screen reappears and BTN1 is again disfunctional (!).
    So, I guess one of my previous experiments has 'destroyed' the normal functioning of BTN1 and I cannot restore it back to normal ?

    The 'settings.json' looks normal to me

    {"ble":true,"blerepl":true,"log":false,"­timeout":10,"vibrate":true,"beep":"vib",­"timezone":1,"HID":false,"clock":null,"1­2hour":false,"brightness":1,"options":{"­wakeOnBTN1":true,"wakeOnBTN2":true,"wake­OnBTN3":true,"wakeOnFaceUp":false,"wakeO­nTouch":false,"wakeOnTwist":true,"twistT­hreshold":819.2,"twistMaxY":-800,"twistT­imeout":1000}}
    

    Anything I can try ?

    • 2 comments
    • 666 views
  • in Bangle.js
    Avatar for jgw

    Hi,
    We keep track of serial numbers for anything we deliver to customers. Time has come to do the same for our Bangle.js 2 devices we will be shipping (soon).

    I've noticed that for 3 devices that we bought with the same order, the serial numbers are very different :

    // Connected to Bangle.js 8382
    >getSerial()
    ="c5a488b7-1440c5e7"
    
    // Connected to Bangle.js 62e4
    >getSerial()
    ="5bb6f7f0-75a2ae14"
    
    // Connected to Bangle.js 5e55
    >getSerial()
    ="5705650f-3ec9f6bf"
    >
    

    Is there some kind of logic in these serials or are they just 'random' ?

Actions