nodemcu

Errors flashing NodeMCU to ESP8266

强颜欢笑 提交于 2019-12-24 06:04:39
问题 I've been having a bit of a rough time trying to flash the latest dev firmware. I've edited the question with a bunch of copy/paste examples from my cli and to clarify the steps I've taken so far. Here's what I've tried doing: I downloaded the 1.4.0 master and dev versions of firmware from the custom build service. I tried to flash the 1.4.0 master version with this command: python esptool.py --port /dev/ttyUSB0 write_flash -fm=dio -fs=32m 0x00000 ~/git/nodemcu- firmware/bin/nodemcu_integer_1

How can I get certain text from string in Lua? [duplicate]

一个人想着一个人 提交于 2019-12-23 01:41:35
问题 This question already has answers here : How to get post parameters from http request in lua sent to NodeMCU (2 answers) Closed 2 years ago . I want to extract the POST parameters received from a HTTP request, that was sent to my NodeMCU. How can I accomplish this? I was thinking about the following code in C#. How to implement this in Lua? My code in C#: // Response = "<action>Play</action><speed>1</speed><blah>lol</blah>" // ValuetoSearch = "action" public static string

NodeMCU HTTP server stops responding

余生长醉 提交于 2019-12-20 04:19:54
问题 I'm trying to make a simple HTTP server with NodeMCU. I start up nodeMCU then connect it to the wifi and then run the program below. I can connect to the server from my browser. If I keep on reloading the page it would work forever, but when I stop sending requests for a minute or two, the server will somehow stop functioning. Which means, when I reload page nodeMCU does not receive any data (and cannot return any data back). a=0 function receive(conn,payload) a=a+1 print(payload) local

esp8266 wifi模块刷nodemcu固件并蓝牙串口调试

此生再无相见时 提交于 2019-12-17 14:55:29
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> esp8266 wifi模块价格十分实惠。出厂是默认带AT指令的系统,通过串口使用at命令进行交互。但是可以刷别的固件,例如nodemcu。 nodemcu可以用lua脚本控制模块,而且lua脚本的优势是非常容易编写,也不需要编译。本文简单的介绍一下在esp8266模块上烧写nodemcu固件,并简单的通过串口让模块接入AP。 下载 nodemcu_flasher64bit.exe 这是一个nodemcu固件的烧写软件。我下载的是64为版本。32为版本地址为: http://www.nodemcu.com/download/flasher/nodemcu_flasher32bit.exe 下载最新固件,这是非必要步骤,因为烧写软件会自动从网上下载固件,但我不知道是不是最新的。 使用usb转ttl连接模块的uart,同时拉低模块GPIO0,把GPIO0这个引脚连接到gnd脚,进入烧录模式,平时不这么接为正常模式。 打开烧录软件,点击“Flash”按钮,如果下方能正常显示mac地址,且有进度条则烧录进行中,一般也就正常了。 烧录好了后,我是用putty连接COM4口,具体哪个口看设备管理器。输入如下类似命令,即连入家里的路由。 print(wifi.sta.getip()) --nil wifi.setmode

使用Sublime进行nodemcu的开发-xconsole篇

 ̄綄美尐妖づ 提交于 2019-12-17 14:55:07
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> Sublime是一个强大的文本编辑,可以外挂各种非常实用的功能插件。 使用Sublime进行nodemcu的开发有两个基本的思路,一是直接用作代码编辑器,其它操作通过xconsole或其它的串口工具来完成;二是将一些工具整合到插件之中,与IDE集成起来。由于IDE中集成串口工具和python代码暂时遇到一些问题,这里先介绍第一种方法。 玩转nodemcu需要用到几个工具: 第一个当然就是代码编辑器了,这个不多说,可以把xconsole的代码整个目录都打开,然后保存为project和workspace,以后就可以直接全部打开了。 第二个应该是串口工具,实现交互运行lua代码。 第三个就是代码上载工具了,这个在xcosole里已经与串口工具整合到一起了。 通过控制台,xconsole已经运行的很好了。但在Sublime里,我们希望实现更好的整合,比如把串口工具运行在Sublime的串口中,这个使用SublimeREPL(这是个插件,通过Package control安装)就可以了。 装完后,打开xcon_uart.py按 Command+Shift+P 可以调出命令列表的串口,输入Sublime,找到Run current file这个项,单击运行,即可自动弹出一个Tab,跟控制台一模一样的运行即可。 注意

使用xconsole调试和上载nodemcu的lua文件

大憨熊 提交于 2019-12-17 14:46:28
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 简介 xconsole是基于控制台的工具,将串口交互、远程访问和本地调用融为一个工具。 该工具使用python开发,而且全部开源,以便可以直接整合到你的工具集之中。 项目地址: https://git.oschina.net/supergis/ESP8266App 直接下载 git clone https://git.oschina.net/supergis/ESP8266App.git xconsole具体分为两个python执行程序: xcon_uart.py,通过串口访问,结合本地shell和minicom之类的; xcon_tcp.py,通过TCP访问,可以远程交互、执行lua脚本、上载文件等; 以后还会增加其它链接协议的支持。 基本使用 xconsole采用多线程、全异步方式处理端口IO。 使用$或#区分输入的指令是在本机执行还是通过端口执行。 实现的几个基本命令如下: $loadfile,$lf:从本机载入lua文件到nodemcu设备。 $loadfileall,$lfall:从本机载入多个lua文件到nodemcu设备。参见该函数的实现。 $loadinit,$lfinit:从本机载入lua文件到nodemcu设备上的init.lua文件(注意不要写入死锁的代码)。 来源: oschina 链接

ESP8266 send and receive sockets

…衆ロ難τιáo~ 提交于 2019-12-14 03:48:56
问题 I'm new to NodeMCU programming for ESP8266. I need to send strings to the server and receive response strings. So I wrote some code, but it doesn't work properly. My program works through time, and then displays a message that the memory is full. Can you help me? ---------init funсtion----------------- wifi.setmode(wifi.STATION) wifi.sta.config("TP-LINK_ROBOT","63793246") wifi.sta.connect() --------------------------------------------- function hello (sck,c) print (c) sk:close() if c ==

Why does the Arduino IDE work with NodeMCU? [closed]

痴心易碎 提交于 2019-12-13 07:46:26
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I know when we buy a NodeMCU, we get the NodeMCU firmware already installed in it. But how come we are able to use the Arduino IDE (used for C++ programming) with this dev kit? How can we use a C++ IDE to work with a Lua-based firmware? What's wrong with my concepts here? 回答1: "Lua based firmware" is a bit

How to update the data-value= “adc” on the gauge from the server?

回眸只為那壹抹淺笑 提交于 2019-12-13 03:23:14
问题 I'm using an NodeMCU (ESP8266) and Arduino IDE. The sketch part works, I can see the analog reading on the serial monitor as I move the pot. The webserver index.html is in the SPIFFs file system. When connected and server is loaded I can see the gauge on the browser but no movement from the needle is displayed. My goal is to get the ADC Reading and update the needle on the gauge. This is what I have so far, this is a sample from https://rawgit.com/Mikhus/canvas-gauges/master/examples/issue-63

What is causing my program to run out of memory using NodeMCU?

人盡茶涼 提交于 2019-12-12 23:23:32
问题 Can someone please tell me why my program runs out of memory? I'm using the Lua 5.1.4 on SDK 1.5.4.1 NodeMCU. Here is my code wifi.setmode(wifi.STATION) wifi.sta.config("asdf","xxx") elWiFi =(wifi.sta.getip()) if elWiFi ~= nil then print(wifi.sta.getip()) end if srv~=nil then srv:close() end srv=net.createServer(net.TCP) if srv ~= nil then srv:listen(6969,function(conn) if conn ~= nil then conn:on("receive",function(sck,numbers) if numbers ~= nil then collectgarbage("collect") p = string.find