Are you connecting through Bluetooth, or USB Serial?
Can you also maybe try removing the setupExternalHardware() call that's in the global scope? With it, it gets called when you upload - but then when you save you save the current state (including whatever state of initialisation it was at), but then setupExternalHardware() gets called again from onInit() - it's possible that is causing you problems.
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.
Are you connecting through Bluetooth, or USB Serial?
Can you also maybe try removing the
setupExternalHardware()
call that's in the global scope? With it, it gets called when you upload - but then when you save you save the current state (including whatever state of initialisation it was at), but thensetupExternalHardware()
gets called again fromonInit()
- it's possible that is causing you problems.