nodemcu-mode is a minor mode that provides a wrapper for the popular
nodemcu interaction tools nodemcu-tool
and nodemcu-uploader
.
First, install either nodemcu-uploader
with
pip install --user nodemcu-uploader
or nodemcu-tool
with
npm -g install nodemcu-tool
(if you are viewing this file within Emacs, just hit C-c C-c
on the
preferred block above)
By default, nodemcu-uploader
is used, because it seems to be a bit
faster. If you prefer nodemcu-tool
, please configure the backend with
(setq nodemcu-backend "nodemcu-tool")
To use this mode, add the repository to your load path, load it and enable the minor mode:
(setq nodemcu-default-keybindings t) ; optional, enable default key bindings
(setq nodemcu-port "/dev/nodemcu-device") ; usually /dev/ttyUSBx; use udev rule to get a static name
(add-to-list 'load-path "~/path/to/nodemcu-mode/")
(require 'nodemcu-mode)
(add-hook 'lua-mode-hook #'nodemcu-mode) ; optional, automatically enable for nodemcu-mode for lua projects
For configuration options, please look at the customization group
nodemcu
. In particular, nodemcu-default-keybindings
can be used to
enable key bindings, and nodemcu-port
will be required if your USB
port is not /dev/ttyUSB0
.