Skip to content

henrythasler/nodemcu

Repository files navigation

nodemcu

stuff you would need to play with a nodemcu (ESP8266) iot device

how to git

$ git clone https://github.com/henrythasler/nodemcu.git
$ cd nodemcu
$ git remote add nodemcu https://github.com/henrythasler/nodemcu.git
// do something
$ git add .
$ git commit -a
$ git push nodemcu master

install nodejs

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt install nodejs

module overview

  • init.lua - Main script. Handles Wifi connection and calls other modules
  • config.lua - all config data is stored in this file

/flash

  • flashdaemon.lua - lua-script to handle file uploads, commands. Run that file on your nodemcu after wifi is connected.
  • flash.js - nodejs-script to upload files to nodemcu
  • status.lua - generate status.html on nodemcu.

Usage

$ nodejs flash.js ./../config.lua
    Preparing ./../config.lua
    Prepared 2 chunks. Connecting...
    Connected to nodemcu
    sending chunk with 634 Bytes...
    ok
    sending chunk with 35 Bytes...
    ok
    Finished upload
    Disconnected from nodemcu

/sensor

  • temperature.lua - convert reading from ADC0 to temperature value and send result to MQTT broker.

/webserver

  • httpserver.lua - provides sensor data as JSON.

About

stuff you would need to play with a nodemcu (ESP8266) iot device

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •