I still don't understand why you can't just use the existing espruino-cli code though - or at the very least start from that code which does exactly what you want and then strip out the bits you don't want.
The problem seems to be that it doesn't work after having already run Espruino.init(), and Espruino.sendFile(), which is the first step in my script (after all the webpack build stuff). I added a lot of logging statements. I can see that connection is a SerialPort object and should work just fine, right until queryBoardProcess() runs, which is happening because it's listening for the 'connected' event. I don't understand yet what this code does. Will have to work on it tomorrow. Thanks for the explanations.
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.
That's exactly what I did.
https://github.com/stokebrain/morra-espruino1/blob/master/build.js#L76 and down
The problem seems to be that it doesn't work after having already run
Espruino.init()
, andEspruino.sendFile()
, which is the first step in my script (after all the webpack build stuff). I added a lot of logging statements. I can see thatconnection
is aSerialPort
object and should work just fine, right untilqueryBoardProcess()
runs, which is happening because it's listening for the'connected'
event. I don't understand yet what this code does. Will have to work on it tomorrow. Thanks for the explanations.