nodemcu

NodeMCU timeout when using while loop

前提是你 提交于 2020-01-06 20:02:56
问题 I have a Lua script that sends an email to myself via SMTP. Everything works fine when uploading to the NodeMCU and saying dofile("sendemail.lua") . -- sendmail.lua -- The email and password from the account you want to send emails from MY_EMAIL = "REDACTED" EMAIL_PASSWORD = "REDACTED" -- The SMTP server and port of your email provider. -- If you don't know it google [my email provider] SMTP settings SMTP_SERVER = "isp.smtp.server" SMTP_PORT = 25 -- The account you want to send email to mail

Trouble connecting NodeMCU to Microsoft Azure IoT Hub

让人想犯罪 __ 提交于 2020-01-06 19:53:14
问题 I am trying to connect my ESP8266, running the latest NodeMCU build, to a Microsoft Azure IoT Hub via MQTT Protocol. It appears that this is possible, as it is shown here... http://thinglabs.io/workshop/esp8266/sending-d2c-messages/ I am using the correct syntax as far as I can see from the MS Azure help... https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-mqtt-support Unlike the example in ThingLabs, which creates a SAS token using NodeMCU, I have followed the MS document and generated

Connecting NodeMCU Lua socket client with node.js socket.io server

。_饼干妹妹 提交于 2020-01-05 04:24:11
问题 I want to connect a NodeMCU Lua socket client to node.js socket.io server. NodeMCU Lua code: sk = net.createConnection(net.TCP, 0) sk:on("receive", function ( sck,c ) print (c) end) sk:on("connection", function ( sck,c ) print("Connected") sk:send("Helloooo...") end) sk:connect(12346,"192.168.1.100") Node.js server code: var express = require('express'); var app = express(); var server = require('http').Server(app); var io = require('socket.io')(server); io.on('connection', function(socket){

ESP8266 NodeMCU引脚说明

混江龙づ霸主 提交于 2019-12-31 13:01:05
ESP8266 NodeMCU引脚说明 下表列举了TPYBoard v202开发板上的引脚编号与NodeMCU、MicroPython之间的对应关系 可用于GPIO操作的引脚有:G0,G2,G4,G5,G12,G13,G14,G15,G16,其中G16是一个特殊的引脚,用于从深度睡眠模式唤醒模块。还需要注意一点,开发板上只有一个串口,将其引出为USB虚拟串口用于REPL操作,当你需要使用串口时,应注意避免冲突。 参考: TPYBoard v202 GPIO的使用 ESP8266 NodeMCU引脚说明-简书 来源: CSDN 作者: MaYuHuaw 链接: https://blog.csdn.net/qq_43328166/article/details/103770537

Cannot Get GPIO0 High after programming RF settings ESP-12-Q

爷,独闯天下 提交于 2019-12-25 09:44:13
问题 I'm trying to flash AI-Thinker ESP-12-Q module with custom compiled nodemcu image. When very first time the chip boots up it shows a message saying it has 8mbit (1MB) flash. On every document also images it is shown that this module has 32mbit (4MB) flash. Here is what i did and the result: To eliminate power problems, I power the module with 10 Amps lab supply (3.3 volts of course). There is a 3.3v ftdi module sitting between esp and computer. I'm using official flash download tool v2.4 from

GET Request from Arduino to Lua (ESP8266)

限于喜欢 提交于 2019-12-24 16:04:03
问题 I have a problem with my GET request. ESP8266 with NodeMCU. My code in Arduino: String cmd = "conn:send(\"GET /json.htm?type=command&param=udevice&idx=2&nvalue=0&svalue=11 HTTP/1.1\r\nHost: 192.168.0.101\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n\")"; wifi.println("conn=nil"); wifi.println("conn=net.createConnection(net.TCP, 0)"); wifi.println("conn:on(\"receive\", function(conn, payload) print(payload) end)"); wifi.println("conn:connect(8080, \"192.168.0.101\")"); wifi.println(cmd);

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

断了今生、忘了曾经 提交于 2019-12-24 15:38:43
问题 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 connection to any other access points. A simple UDP server like soft AP. I followed these steps: I have uploaded a new firmware to NodeMCU. I have downloaded ESPlorer for better work with NodeMCU. I have uploaded the source code below. I have connected

Releasing closures

狂风中的少年 提交于 2019-12-24 08:22:40
问题 On a nodemcu, I'm using a closure to send a file over a socket, like this: function sendfile(sock, name) local fd = file.open(name, "r") function sendchunk() local data = fd:read() if data then sock:send(data) else fd:close() sock:close() end end sock:on("sent", sendchunk) sendchunk() end After transferring a few files, the interpreter panics due to "not enough memory". I can imagine this may be due to closure still hanging around. It would be difficult for the garbage collector to determine

nodeMCU TLS certificate error

Deadly 提交于 2019-12-24 08:08:12
问题 I am building realy simple IoT project, and I am stuck on nodeMCU TLS problem. I have MQTT broker on my Raspberry pi, all certificates are correctly inserted (everything working fine with Paho Client on same raspberry or with Mqtt.fx client on remote PC), but when I try to connect from my ESP8266 with nodeMCU I am getting SSL handshake error (yes, I am using same cert file for all mentioned clients). My ESP8266 code looks like this: tls.cert.verify([[ -----BEGIN CERTIFICATE----- -----END

HTTPS get requests with NodeMCU and ESP8266

若如初见. 提交于 2019-12-24 07:35:04
问题 I'm having problems doing a HTTPS GET request with NodeMCU, even though it seems it should be possible according to their documentations and this answer here on StackOverflow. The code I'm trying is: function getHTTPS() http.get('https://httpbin.org/get', nil, function(code, data) print(code, data) end) end enduser_setup.start( function() print("Connected to wifi as: " .. wifi.sta.getip()) getHTTPS() end, function(err, str) print("enduser_setup: Err #" .. err .. ": " .. str) end ); This gets