• A use case for a Bangle.js 2 device requires me to replace the complete set of 'Default Applicactions' that normally live on the device.

    I've accomplished that with

    require("Storage").eraseAll()
    

    followed with a 'Send to Espruino Flash'. This has all been successful and my application is running fine.
    One question I have is how to prevent console messages and system errors from appearing on the Bangle.js 2 display.

    I've studied the default 'settings.js' app that toggles the 'log' attribute in 'setting.json' but makes no application call to inform Espruino.

    I've written a 'setting.json' file to Flash with 'log' set to false, but messages keep displaying (in a very small font where I can only make out the word 'Bluetooth' every time a BLE message is received).

    I have not experimented with E.setConsole() since I did not want to lose my console the next time I connect with the IDE - or is this of no concern ?

    So, how does one disable debug messages from appearing on a Bangle.js 2 ?

  • Ahh - ok, so what happens with settings is the settings app changes settings.json as you note. Then, on the next boot, bootupdate.js is called, and that created a new JS file that runs at boot to set everything up.

    The specific line you want is https://github.com/espruino/BangleApps/blob/41b3224e3f0854e8ec760157f732b4727f6801e1/apps/boot/bootupdate.js#L38

    Basically you just call Bluetooth.setConsole(true); at startup. That forces the console to stay on Bluetooth all the time. If Bluetooth isn't connected, anything that's written just gets thrown away.

  • Yes, that works ! Thank you.

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

How to set 'Debug Info' after replacing default apps for Bangle.js 2

Posted by Avatar for jgw @jgw

Actions