问题标签 [arduino-esp8266]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
238 浏览

arduino - Trouble with Digital Temperature Probe and ESP8266

I am having a hard time troubleshooting this project build of mine. I am trying to utilize a DS18B20 temperature sensor in conjunction with an ESP8266 to create a temperature beacon.

The problem I'm running into pertains to the data interpreted by the ESP8266. I am using the Arduino IDE to program the HUZZAH ESP8266 breakout.

The WiFi client is behaving as supposed to, but the temperature sensing is not. When I upload the same sketch to an Arduino Mega2560 (recompiled obviously), and plug the data line into a digital pin of the 2560, the probe temps come in perfectly, changing according to the temp. If I unplug the data lead, I get -196.80, what I assume is a ground value.

Simply moving the data line into the ESP8266 pin, I receive a temp of 262.29 and this does not change in between reads, regardless of sensor temperature.

I have ensured all of the cables are wired properly, there is no weird grounding or anything. I have tried changing the baud rate of the serial interface maybe thinking the clock had something to do with it, but that seems to have affected nothing.

Any idea/direction is always appreciated!


I have wired the circuit according to a diagram located at this link here.

Here is a Gist to the code that I have been uploading to the ESPs. The code is designed to setup a WiFi Client (attached to a local AP, which works totally fine), request the temps, and submit up to a host that has a listening server. The pin (2) refers to GPIO2 on ESP8266 [i think]


So I found A solution to this. I'm not sure if this particular problem has been replicated for everyone, however, in my situation, the parasitic power on the data line was not charging the IC enough to finish the proper calculation.

All I had to do was unground the VDD pin and hook it up to the 5V rail. Leave the 4.7kOhm resistor on the data line also pulled up to the 5V rail. After doing so, the program reports PARASITIC POWER: OFF, and reports temperatures as I hoped!

0 投票
2 回答
1633 浏览

arduino - 无法打开 ELF 文件 C:\Users\USER

我正在尝试在 Windows 10 x64 上构建我的 Platform.io 项目,我得到了这个错误输出:

有人在 Windows 上遇到过 ELF 文件的问题吗?

PS 在管理员权限下运行 IDE 并没有解决问题。

0 投票
0 回答
4033 浏览

tcp - 如何在arduino IDE中使用nodemcu(ESP8266)将数据包从tcp服务器发送到客户端?

在这段代码中,我写道服务器再次发送它从客户端收到的内容:

现在它接收我从我的电脑发送的内容,但它没有向我发送任何内容。为什么?这里有什么问题?

0 投票
1 回答
320 浏览

c++ - 用 esp8266 解析 SD 卡数据

我需要一些帮助来从 SD 卡中提取数据,我基于节中的代码。

当我从 SD 卡读取数据并将其显示到串行端口时,代码有效,但是当我将数据传递到 char* 数组并调用将循环数组的函数时,数组显示垃圾(一些不可读的数据) . 我正在尝试制作一个函数,可以用来调用以文本文件格式从 SD 卡存储的不同设置。

我有一个名为的全局变量:

它将存储要处理的临时数据。文本文件中存储的数据就是这种格式

-n.command

其中: n = int 数和要存储在tempStoreParam[10]and 命令中的数据的索引位置是要存储在 中的 char* 数组tempStoreParam[10]

例子:

-1.readTempC

-2.readTempF

-3.setdelay:10

-4.getIpAddr

这是代码片段:

我试图得到以下结果:

0 投票
3 回答
4287 浏览

networking - ping 响应是否包含 MAC 地址?

我正在尝试使用 esp8266 来查找在同一子网上注册的 IP 地址及其用于家庭自动化项目的 MAC 地址。ping 响应是否包含设备的 MAC 地址,或者是否可以通过本地网络请求它。

0 投票
1 回答
671 浏览

arduino-esp8266 - Arduino通过服务器打开/关闭LED

我对 Arduino/ESP8266 很陌生。我想制作一个简单的程序来通过 HTTP 请求打开和关闭内置 LED。HTTP 请求工作正常,JSON 反序列化也是如此。我到达了if我想要的分支(取决于 GET 请求响应),但 LED 没有响应。问题是 LED 一直亮着。我错过了什么重要的东西吗?我试图通过互联网搜索,但我没有找到我需要的东西。

ESP8266,NodeMCU 0.9

0 投票
0 回答
2275 浏览

python - 从 Python 向 ESP8266 发送 UDP 数据包

我正在尝试将 UDP 数据包从 Python 发送到本地网络上的 ESP8266。esp 成功连接到我的 AP,但没有收到任何数据包。我可以让 ESP 为网页提供服务,因此我的计算机和 ESP 之间的通信应该没有任何问题。

这是我在计算机上用来发送数据包的代码:

我在 ESP 上使用它:

Python代码可以成功地将UDP数据包发送到另一个Python脚本,所以问题应该出在ESP端。

我能做些什么来调试这个?

0 投票
3 回答
24401 浏览

timestamp - 如何在 Arduino-ESP8266 中获得时间戳?

我想用Arduino-ESP8266获得时间戳。

但我不知道如何得到它。

我想我们必须从互联网上获取时间,因为 ESP8266 没有任何时钟。我们是否只需要一次或每次需要时间戳时都这样做?

我已经通过 Wi-Fi 连接到互联网。

0 投票
0 回答
2102 浏览

http - 使用 Arduino IDE 和 NodeMCU 模块的 HTTP POST

我有一个 NodeMCU WiFi 模块,我在 Arduino IDE 中为它编写代码。我在发送一些东西时遇到问题,使用 POST 方法然后阅读页面。我有一个返回两个变量的 PHP 页面。我的代码如下:

当我运行它时,我得到一个 411 错误代码。这里有什么问题?我该如何解决?
我在 Postman 中测试了这些论点,它们没问题。

0 投票
1 回答
2534 浏览

php - ESP8266-01 对 MySQL 的 POST 请求

我正在尝试向POST我设置的 MySQL 数据库发出请求。我尝试了各种教程都无济于事。我可以使用我创建的 PHPPOST页面通过这样的浏览器输入数据:

我首先尝试访问我自己的 PHP 站点并发送POST带有温度和露点的请求,如下所示:

这将返回:

使用带有http://10.0.0.90/iot/post.php?id=14&value=33返回值的网络浏览器:

我曾尝试发出GET请求,只是想看看我是否可以在这里联系到外部网站:

这将返回以下内容:

任何想法或建议将不胜感激?问题似乎是当我将我的 ESP8266 连接到我的手机然后尝试执行请求时,我得到一个“-1”返回,即连接被拒绝。我已经尝试了几次,但无法弄清楚。难道是手机不允许我手动发送而不是使用浏览器?有任何想法吗?