I cannot give you an answer but I can maybe give you a workaround. Instead of using onInit(), maybe try to make your own init function, with some delay before execution:
function myInit()
{
//cut-paste here the content of onInit()
}
setTimeout(myInit,500);
Without knowing exactly why, with this trick, I was able to let most of my scripts work even when invoked from flash. FYI, I had the same behaviour with some I2C displays .
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I cannot give you an answer but I can maybe give you a workaround. Instead of using onInit(), maybe try to make your own init function, with some delay before execution:
Without knowing exactly why, with this trick, I was able to let most of my scripts work even when invoked from flash. FYI, I had the same behaviour with some I2C displays .