Prompt not detected may come from a different issue: When you have code that is executing your application on upload vs. having an onInit() (or a-like), Espruino gets too busy to actually complete with upload and then upload timeout hits because prompt is not detected.
Some related background - like 2 cents - to upload:
Upload by the IDE is nothing else than a) disable echo in console, b) auto/programmatic entering of code in prompt 'line by line' and 'completed JS expression. If prompt is not 'coming back' / detected by IDE within reasonable time, IDE complains as experienced.
Therefore, it is best to not start any application code in 'Level 0 (zero)', and put the start into onInit() {...} function. I does not only prevent upload issues but also makes sure that all your initialization take place in a reliable and repeatable fashion... (such as setting up timers and watches, even though many - simple - examples do not follow this and save active timers and watches, which on a re-power may either not get started properly or may be duplicated and create nice debug challenges...)
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.
Prompt not detected may come from a different issue: When you have code that is executing your application on upload vs. having an
onInit()
(or a-like), Espruino gets too busy to actually complete with upload and then upload timeout hits because prompt is not detected.Some related background - like 2 cents - to upload:
Upload by the IDE is nothing else than a) disable echo in console, b) auto/programmatic entering of code in prompt 'line by line' and 'completed JS expression. If prompt is not 'coming back' / detected by IDE within reasonable time, IDE complains as experienced.
Therefore, it is best to not start any application code in 'Level 0 (zero)', and put the start into
onInit() {...}
function. I does not only prevent upload issues but also makes sure that all your initialization take place in a reliable and repeatable fashion... (such as setting up timers and watches, even though many - simple - examples do not follow this and save active timers and watches, which on a re-power may either not get started properly or may be duplicated and create nice debug challenges...)For additional details see this conversation simple explanation how to save code that espruino run on start?.