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
0
votes
1 answer

MQTT on ESP8266 with NodeMCU - problems with publishing

I'm building a battery powered IoT device based on ESP8266 with NodeMCU. I use mqtt to periodically perform measurements and publish results. I know, that to allow network stack running, I should avoid tight loops and rely on callback functions.…
wzab
  • 788
  • 7
  • 24
0
votes
4 answers

How to prevent WiFi Password from being leaked from Lua code?

I have a Lua program which connects to a wifi network. The wifi password is hardcoded in the Lua code. I put the Lua code on an ESP8266 which runs on the NodeMCU firmware. Here is the code I use: wifi.setmode(wifi.STATION) wifi.sta.config("SSID",…
Michael
  • 32,527
  • 49
  • 210
  • 370
0
votes
1 answer

Should node.input() process a sting in nodeMCU Lua

Should this code execute and assign the value of "bar" into the variable baz? foo = "bar" baz = "bazza" cmd = "baz = foo" node.input(cmd) print("this is foo "..foo) print("this is baz "..baz) Would expect output to be: this is foo bar this is baz…
0
votes
2 answers

How do you count the number of users connected to esp8266 using NodeMCU

I am creating a geocache that opens when you connect to it via wifi. I just need to be able to count the number of users connected to the esp8266. I have flashed it using with the latest version of NodeMCU.
Jerry H
  • 1
  • 1
  • 1
0
votes
1 answer

PANIC: unprotected error in call to Lua API (stdin:8: attempt to call global 'run' (a nil value))

Using NodeMCU from https://github.com/nodemcu/nodemcu-firmware running the following code: ssid = "www.mydomain.com" pass = "234234234432" gpio.write(0, gpio.LOW) print("Startup up wifi mode") wifi.setmode(wifi.STATION) wifi.sta.config(ssid,…
Michael
  • 32,527
  • 49
  • 210
  • 370
0
votes
2 answers

GET request NodeMCU(ESP8266) 301 Error

Few days ago i'm post question about nodeMcu POST request, can't find any solution i'm try next on: conn=net.createConnection(net.TCP, 0) conn:on("receive", function(conn, payload) print(payload) end ) conn:on("connection",…
once2go
  • 1,452
  • 1
  • 13
  • 21
0
votes
1 answer

ESP8266(Nodemcu) POST request to parse.com

I want make POST request to parse.com for object creation. This is my code: sk=net.createConnection(net.TCP, 0) addr="" sk:dns("api.parse.com",function(conn,ip) addr=ip end) print(addr) conn=net.createConnection(net.TCP, 0) conn:on("receive",…
once2go
  • 1,452
  • 1
  • 13
  • 21
0
votes
2 answers

The wifi.sta module connects if a loop is running?

Im trying to detect when the module actually connects to my wifi AP, since .connect does not have a callback im doing something simple like this: wifi.sta.config("SSID","password") wifi.sta.connect() tmr.delay(1000000) i = 0 while(wifi.sta.status()…
DomingoSL
  • 14,920
  • 24
  • 99
  • 173
0
votes
1 answer

on NodeMCU, how does WIFI.STARTSMART() work?

on http://www.nodemcu.com/docs/wifi-module/#wifi-module-wifi-startsmart, I see code snippet: wifi.startsmart(6, function() print("Auto config success!") end) But what else is needed to make it work? it seems related to wifi…
0
votes
2 answers

NodeMCU with ESP8266 works...Sometimes

I have an extremely simple web server to toggle a relay. It will work sometimes, and other times, a connection is made, but times out. If I reload the page and try again. It will start working again. Any ideas? Here is the…
Kevin192291
  • 1,925
  • 4
  • 26
  • 43
0
votes
1 answer

NodeMCU ESP8266 GET request response

I'm trying to push data to Thingspeak from my Arduino via ESP8266 with NodeMCU firmware. I'm successfully sending and posting to Thingspeak, but occasionally a data point will be missed. I want to add a check in my code to confirm the response from…
-1
votes
1 answer

How do I establish full duplex communication between an Arduino Uno and a Nodemcu esp8266?

I want to send and receive data simultaneously between my Arduino Uno and Nodemcu esp8266. I am sending sensor data from my arduino board to the nodemcu to be pushed to my database. At the same time I am fetching data from the database and sending…
-1
votes
1 answer

what should be the data type for html?

with help of my some friend from here @tuyau2poil , ı could achive receive, my adc values from stm32. My new problem ı could not print these values on my html page because of data type. The value that ı saw serial port. but ı can not see these…
-1
votes
1 answer

Arduino code to removing null character from string

I am using nodemcu ESP8266 and write a program to store some values to EEPROM (assign buffer address 115 to 150 to store USERNAME). When I am reading EEPROM data using for loop from 115 to 150 then it will return unknown characters with string. As I…
Yaseen
  • 11
-1
votes
1 answer

Nodemcu 8266 has not display text on LCD

I am using nodemcu esp8266 with LCD for the first time and I'm unable to make it work. It lights the background but it does not show any text. LCD Address: 0x27 sda: d4 sdl: d3 vnn: vin gnd: gnd Code: #include #include…