Questions tagged [nodemcu]

NodeMCU is an open-source firmware that offers a Lua API for ESP8266, ESP8285, and ESP32. There is also a ESP8266 devkit with the same name. However, questions here should relate to writing Lua code on top of the firmware. Also if you need help understanding the NodeMCU API SO is the right place. Issues with firmware development are best addressed on GitHub. Hardware or general questions can be asked on esp8266.com.

The NodeMCU project is a Lua based firmware that runs directly on ESP8266, ESP8285, and ESP32 hardware, providing a easy and low cost solution. Build-deploy-test cycles are extremely short (contrary to e.g. Arduino) because you only build the firmware once and then simply update scripts on the device.

It provides access to almost all APIs in the Espressif C SDK. Hardware/SDK access is abstracted through close to 60 specific modules. The firmware comes with either integer or floating point support depending on your needs.

975 questions
2
votes
1 answer

Can I accidentally destroy an ESP8266 ESP-12F module's bootloader?

I'm new to these devices and even if they are very cheap, I don't unnecessarily want to brick them. I've used esptool to flash the NodeMCU firmware onto my modules. When doing so, I need to specify the address where the file(s) get written, which…
Rob
  • 11,492
  • 14
  • 59
  • 94
2
votes
1 answer

How to turn off lua interpeter for uart? (Nodemcu)

I need to communicate with a special device on uart. The device is queried in every 500msec, and its response is stored in a local variable. Here is a minimal working example: my_data = "no data yet" function devReq() uart.write(0,…
nagylzs
  • 3,954
  • 6
  • 39
  • 70
2
votes
4 answers

Reading from DHT22 with NodeMCU ESP8266 - DHT Timed out

This question seems to have come up a few times, but I'm attempting to read from a DHT22 with a ESP-12e (ESP8266). Wiring diagram is here: Wiring Diagram Code is here: status, temp, humi, temp_dec, humi_dec = dht.read(1) if status == dht.OK then …
2
votes
3 answers

nodemcu custom firmware build problems

hello everybody:) I built a firmware with cloud build service. The firmware is master and includes "adc, file, gpio, http, mqtt, net, node, ow, spi, tmr, uart, wifi" and also supports SSL. Using ESP 07 and the previous version of firmware was…
hoody
  • 43
  • 4
2
votes
1 answer

Lua - nil value error

I get the following error message from nodeMCU on esp8266 : attempt to call field "adc.force_init_mode" (a nil value). Can somebody point out the mistake please? if adc.force_init_mode(adc.INIT_ADC) then node.restart() return end val =…
hoody
  • 43
  • 4
2
votes
3 answers

ESP8266 send UDP string to AP

I am using UDP to connect two nodemcu modules. One nodemcu is wireless acces point and another nodemcu connects to access point as client. This code sends client's IP adress to AP when client connects: Udp.beginPacket("192.168.4.1", UDPPort);//send…
user5431481
2
votes
2 answers

How to find nodemcu (esp8266 + arduino) with dynamic IP (DHCP)?

I would like to connect the nodemcu to some LEDs, running a HTTP server (RESTful presumably) and turn on/off accordingly. However, how can the devices in the same network find the device? I guess I could try static IP for esp8266, but that is not…
Louis Tsai
  • 1,587
  • 3
  • 20
  • 33
2
votes
1 answer

Send string variable via TCP connection Lua

I am sending data between two ESP8266 modules via TCP connection every 10 seconds in Lua: string="abc" cl=net.createConnection(net.TCP, 0) cl:connect(80,"192.168.4.1") tmr.alarm(2, 10000, 1, function() cl.send("The string variable is:…
Kaki
  • 93
  • 1
  • 7
2
votes
0 answers

Programming NodeMCU : connect PIR Sensor to RST Pin

I use a PIR Sensor & NodeMCU ESP8266 Amica. I program NodeMCU on the Arduino IDE. I connected the sensor's output to the RST pin on my NodeMCU. So, when the PIR detect a movement, the output will be HIGH and so the NodeMCU will reboot. I tested my…
Procuste
  • 61
  • 3
  • 5
2
votes
1 answer

Problems with ws2812 module. init() is nil, write() does not work as documented

I am trying out an Adafruit neopixel array with the ESP8266 and the nodeMCU firmware. Using following custom build: NodeMCU custom build by frightanic.com     branch: master     commit: c8037568571edb5c568c2f8231e4f8ce0683b883     SSL: false …
2
votes
2 answers

ESP8266, NodeMCU, soft AP - UDP server-like soft AP, independent access point

I am using NodeMCU (with ESP8266-E) with an upgraded firmware. All basic commands work perfectly but there is one problem. I wanted to create an independent access point, which could have a behaviour like a UDP server. That means without direct…
Luke
  • 1,163
  • 2
  • 11
  • 19
2
votes
1 answer

NodeMCU node.js crypto

I was trying to set up an encrypted communication between node.js and NodeMCU. After some struggle, I was able to encrypt using node.js and decrypt it on NodeMCU. The reverse is not working. The reply by mscdex worked. Accordingly I modified the…
Sekar S
  • 163
  • 1
  • 10
2
votes
1 answer

NodeMCU playing .wav or .mp3 files

I am not sure which road to go down in order to get a NodeMCU to play audio. I would like to use one to two second wav files and drive a tiny speaker. The goal is to hear a human voice, nothing super high fidelity. Additionally I don't want to use…
Joe Andolina
  • 648
  • 1
  • 11
  • 23
2
votes
1 answer

HTTPS (SSL) get request with NodeMCU

I would like to perform GET requests to googleapi.com with my ESP8266 running NodeMCU, to get some data from the google Calendar API. The website allows only secured connection (HTTPS/SSL). First, I've been trying to connect to google.com (secured)…
S. Blanc
  • 107
  • 2
  • 9
2
votes
3 answers

Unable to program NodeMCU

This question is related to this, Cannot program ESP8266, but different settings. I have a NodeMCU devkit v1, its comercial name is NodeMCU v2. I tried different setting to connect the devkit. First the devkit has a usb-serial bridge (CP2102) and…
RataDP
  • 409
  • 5
  • 15