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
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.
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem