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
2 answers

cjson.decode() of a multi layer JSON

I want to decode a multi layered json object into a table and print the value of "temp". p=666 d=23.42 payload='{"d": {"pres":'..(p)..',"temp":'..(d)..'} }' t = cjson.decode(payload) My first idea was something like this:…
trahloff
  • 607
  • 1
  • 9
  • 17
2
votes
1 answer

NodeMCU/Lua performance issues

I'm adding some code to the ws2812 module to be able to have some kind of reusable buffer where we could store led values. The current version is there. I've two problems. First I wanted to have some "OO-style" interface. So I did: local buffer =…
Alkorin
  • 21
  • 2
2
votes
0 answers

How can I program a ESP8266 wireless adaptor in lua to connect via WPS push button method my home network

I've a project wherein I need a wifi device to be able to connect to a network via WPS push button. How can I enable that programmatically ? I'm using a ESP8266 wifi module running NodeMCU firmware (lua code).
2
votes
1 answer

Lua send json request body

i am very new to LUA and i am trying to send a json post from my ESP8266 using LUA to a PHP server on my localhost, i searched the internet and i cant find any example to do that can any one help me please ? my LUA code -- tested on NodeMCU 0.9.5…
mohammad
  • 2,142
  • 7
  • 35
  • 60
2
votes
1 answer

Write into file nodemcu lua

I am trying to write into a file and then read its contents the code I am using is: file.remove("CRED.lua") file.open("CRED.lua","w+") temp = "PASS = "..pass file.writeline(temp) temp = "SSID = "..ssid file.writeline(temp) file.flush() temp =…
user2117118
  • 73
  • 1
  • 2
  • 10
2
votes
3 answers

How to know if the ESP8266 has been manually reset?

I have a code looping with the help of the dsleep mode. Each time dsleep ends, the init.lua is loaded, does something the goes back to sleep. Now I want to implement a button to my ESP8266 that will trigger the reset pin. When pushed, my system…
bixente57
  • 1,328
  • 4
  • 14
  • 29
2
votes
3 answers

What is wrong with my GET request?

Sorry to bother with something that should be easy. I have this HTTP GET request: GET /ip HTTP/1.1 Host: httpbin.org Connection: close Accept: */* User-Agent: Mozilla/4.0 (compatible; esp8266 Lua; Windows NT 5.1) When I send this request via my…
bixente57
  • 1,328
  • 4
  • 14
  • 29
2
votes
2 answers

How can I get nodemcu to popup a browser window upon connection to an ESP8266 AP?

I know in airports, for example, I've connected to their AP, and it pops up a browser window to log in on my device. Is it possible to do so with NodeMCU in lua, or even with c firmware?
wordsforthewise
  • 13,746
  • 5
  • 87
  • 117
2
votes
1 answer

HttpURLConnection application crashes with ESP8266

I have a ESP8266 simple http server with following Lua script print("My First Lua program") --print(adc.readvdd33()) print("Setting Wifi") wifi.setmode(wifi.STATIONAP) --[[ STATION + AP --]] wifi.setphymode(wifi.PHYMODE_N) --[[…
SREEJITH S
  • 23
  • 3
2
votes
1 answer

Cannot use math.pow function in NodeMCU/ESP8266

I need the math.pow function in NodeMCU/ESP8266 but I cannot include the math library
jezuz
  • 413
  • 2
  • 5
  • 13
2
votes
2 answers

Memory is not released after a dofile in lua

I am new to lua and was working on NodeMCU. I was trying to extract data from an xml file. Here is my xml file:
Sai
  • 711
  • 6
  • 24
2
votes
2 answers

Lua script does not execute in sequence

I want to get the time using an EPS8266 with nodeMCU to set my RTC over I2C. This is my sript: -- file print.lua local file = assert(loadfile("httpget.lua")) file() --get Date and Time from google print("Print…
Wolfgang Kuhn
  • 21
  • 1
  • 4
1
vote
1 answer

Toyota ECU replying 0x03 0x7F 0x01 0x11 to 02 01 00 PID query request from MCP2515 and Nodemcu-32s

i am using mcp2515 with nodemcu-32s and am able to receive the messages which have few ids like 2c4, 2c1, 340 etc on the internet i see 2c4 is for rpm and i have verified it too. My question is that no matter which library i use to request the…
1
vote
0 answers

How To Consume an API From a Nodemcu (ESP8266 WiFi Module)

I have configured a Kubernetes kind cluster to run a flask API. The flask App when run locally with flask run produces an IP which is the local machine assigned IP from the local network (192.168.100.19). My Nodemcu which also has an IP of…
sam hassan
  • 197
  • 3
  • 14
1
vote
0 answers

Server response correctly with data received but PHP file doesn't receive any data

I'm trying to build an attendance system based on RFID and NODEMCU, the NODEMCU send POST request to PHP file but PHP file doesn't receive any data, so I decided to intercept network traffic and I saw that server response correctly. POST…
m0rbot
  • 11
  • 4