nodemcu

ESP8266 nodemcu resolving raspberry's local dns

别等时光非礼了梦想. 提交于 2019-12-12 06:36:55
问题 I'm having an issue with connecting the esp module on the raspberry via mqtt . After a lot of search I think I am kinda lost now. So here's the problem I have setup my raspberry's local dns to work as cubex.local, I followed the instructions here: http://www.howtogeek.com/167190/how-and-why-to-assign-the-.local-domain-to-your-raspberry-pi/ Everything seems to be working fine on this end... I can use the cubex.local on the local network to have ssh and ftp access to the raspberry but when it

NodeMCU error connecting to WiFi

只愿长相守 提交于 2019-12-12 05:43:16
问题 I have tried a blink on the NodeMCU working ok, but when doing basic connection to WiFi I get this error: init.lua:4: attempt to concatenate global 'gw' (a nil value) this is the connection wifi.setmode(wifi.STATION) wifi.sta.config("wifi-name","password") ip, nm, gw=wifi.sta.getip() print("\nIP Info:\nIP Address: "..ip.." \nNetmask: "..nm.." \nGateway Addr: "..gw.."\n") 回答1: With NodeMCU many functions are asynchronous (assume this to be the default). Hence, calling wifi.sta.config isn't

NodeMCU - gpio programming

独自空忆成欢 提交于 2019-12-12 03:57:56
问题 I'm using a NodeMCU board, V3 pinout, and the Arduino IDE. I need to oscillate one of the output pins, and digging around I found this page: https://github.com/nodemcu/nodemcu-firmware/blob/master/docs/en/modules/gpio.md Very useful, especially the gpio.serout() function, but I can't get it to work. This is my code: #include <gpio.h>; #define LED D5 void setup() { gpio.mode(LED, OUTPUT); Serial.begin(9600); } void loop() { Serial.write("Starting blinking."); gpio.serout(LED, HIGH, 1000000, 10

MQTT on ESP8266 with NodeMCU - problems with publishing

你。 提交于 2019-12-12 02:56:57
问题 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. Therefore it seemed to me that the right organization of my measurement code should be: interval=60000000 function sleep_till_next_sample() node.dsleep(interval) end function close_after_sending() m:close() sleep_till_next_sample() end function

PANIC: unprotected error in call to Lua API (wificonfig.lua:33: address in use)

China☆狼群 提交于 2019-12-12 01:52:21
问题 I'm trying to create a local http server on ESP8266 with lua using NodeMCU custom build by frightanic.com. When i create a local http server along with a connection that is already listening on port 80 and fetching data from my server site, it is giving me PANIC error. Here's my code : wifi.setmode(wifi.STATION) wifi.sta.config("SSID","password") wifi.sta.connect() tmr.alarm(1,10000, 1, function() if (wifi.sta.getip() == nil) then print("IP unavaiable, Waiting...") else foo() local_server()

UART data error when using uart.alt(1)

痞子三分冷 提交于 2019-12-11 13:48:10
问题 I am trying to acquire rs232 data from a device connected to the ESP8266 (data will then be sent our via http/wifi). I am using max3232 IC to provide the necessary 3.3v TTL to the ESP8266. I have have connected the max3232 (pin 12) to GPIO pin 13 (rx) on the ESP8266 (I am only receiving data not sending data, so only the rx pin is connected). The code i am using: -- --file: test2.lua -- tst2 = require "tst2" tst2.start() --tst2.lua (testing script) local module = {} function module.start()

NodeMCU and ESP8266: slow mqtt publish

▼魔方 西西 提交于 2019-12-11 13:15:17
问题 I'm using esp8266 with the firmware produced with Marcel's NodeMCU custom builds http://frightanic.com/nodemcu-custom-build/ I tested the "dev" branch and the "master". I changed a little bit the " Connect to MQTT Broker " code found here https://github.com/nodemcu/nodemcu-firmware -- init mqtt client with keepalive timer 120sec m = mqtt.Client("clientid", 120, "user", "password") m:on("connect", function(con) print ("connected") end) m:on("offline", function(con) print ("offline") end) -- m

MQTT / ESP8266 / NodeMCU / Lua code not publishing

∥☆過路亽.° 提交于 2019-12-11 11:55:27
问题 I have a problem with the following Lua code on an ESP8266... function sendData(humidity,temperature) -- Setup MQTT client and events print("sendData() entered") print("Setting up mqtt.Client...") m = mqtt.Client(mqtt_client_id, 120, username, password) print("Attempting client connect...") m:connect(mqtt_broker_ip , mqtt_broker_port, 0, function(conn) print("Connected to MQTT") print(" IP: " .. mqtt_broker_ip) print(" Port: " .. mqtt_broker_port) print(" Client ID: " .. mqtt_client_id) print

Cannot upload data to firebase using Nodemcu

江枫思渺然 提交于 2019-12-11 10:14:38
问题 My sensor is collecting data correctly but is not pushing the data to Firebase. As expected Firebase.failed returns true but Firebase.error is empty. Please help me with the code as my project is due in three days. I have tried changing the fingerprint in FirebaseHttpClient.h file. I have also tried changing the Firebase HOST with and without "/". #include "DHT.h" #include <FirebaseArduino.h> #include <ESP8266WiFi.h> #define FIREBASE_HOST "your-project.firebaseio.com" #define FIREBASE_AUTH

nodemcu custom firmware build problems

坚强是说给别人听的谎言 提交于 2019-12-11 04:06:09
问题 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 nodeMCU 0.9.6 and that was correctly worked but didn't support some modules that i need. To flash the firmware, i use NodeMCU flasher with these setting: flasher setting I upload the binary firmware file to address 0x00000 and esp_init_data_default.bin