toitware / esptool.js

TypeScript port of the esptool
MIT License
108 stars 12 forks source link

Possible use with Node JS ? #1

Open maxpromer opened 3 years ago

maxpromer commented 3 years ago

In nodejs i using serialport package for scan COM port then use esptool.exe for flash an ESP32 but i have a problem about permission of access external binary file on some OS.

I think esptool written in NodeJS with serialport package can fixed my problem

koush commented 3 years ago

Just forked and wrote this a few minutes ago. Using the node serialport library. Flashing works, but the device reboot functionality after flashing doesn't. Unclear why.

https://github.com/koush/esptool

koush commented 3 years ago

Got reset working by looking at the official esptool code from Espressif.

https://github.com/espressif/esptool-js/blob/main/index.js#L112

jstroem commented 3 years ago

Hi both, this seems durable. Maybe somehow the serial port implementation in the web and node could share an API making it possible to do the signal operations as well that way there is no need for multiple implementations.

I would suspect a wrapper class could do it to redirect setSignal -> set with the correct options.