esp8266

ESP8266 SDK开发: GPIO输出

时光毁灭记忆、已成空白 提交于 2019-12-06 12:18:34
前言   官方提供了两个函数       GPIO_OUTPUT_SET(gpio_no, bit_value) 设置GPIO2输出高电平 GPIO_OUTPUT_SET(2, 1); 设置GPIO2输出低电平 GPIO_OUTPUT_SET(2, 0); GPIO_OUTPUT(gpio_bits, bit_value) 官方提供的一次性设置多个引脚函数 设置GPIO2和GPIO5输出高电平 GPIO_OUTPUT(BIT2 | BIT5, 1); 设置GPIO2和GPIO5输出低电平 GPIO_OUTPUT(BIT2 | BIT5, 0); 开发板原理图   一,LED(GPIO2)        二,继电器(GPIO5)         测试(GPIO2输出高电平点亮LED) #include "gpio.h" GPIO_OUTPUT_SET(2, 1);//设置GPIO2输出高电平 测试(GPIO2输出低电平,GPIO5输出高电平控制继电器吸合) #include "gpio.h" GPIO_OUTPUT_SET(2, 0);//设置GPIO2输出低电平 GPIO_OUTPUT_SET(5, 1);//设置GPIO5输出高电平 测试(GPIO2输出低电平,GPIO5输出低电平) #include "gpio.h" GPIO_OUTPUT(BIT2 | BIT5, 0);/

Issue loading files w/SPIFFS (ERR_CONTENT_LENGTH_MISMATCH)

不羁岁月 提交于 2019-12-06 09:28:05
Alright so I've been looking into this for the past two days and I still feel like I'm getting nowhere. I recently started using the SPIFFS File System for Arduino development on an HUZZAH ESP8266 like the FSBrowser.ino example, and while it's been great in terms of separating code, as my code continues to grow it has not been great in terms of stability. Ever since I began adding more and more javascript, I began to have errors pop up for various files, whether it's my HTML/CSS/JS, and the primary error I see is ERR_CONTENT_LENGTH_MISMATCH . //File Read for File System bool handleFileRead

ESP8266 SDK开发: 开发环境搭建

狂风中的少年 提交于 2019-12-06 03:52:01
前言   这节安装下编程软件,   可以去官网下载,    https://wiki.ai-thinker.com/ai_ide_install      也可以安装我提供的(我使用的为官方以前版本)   建议安装我提供的,有问题好解决!    开始安装 自己随意哈 关掉程序 ........官方啥都给准备好了. 咱以后用这个   咱就是刷这四个程序文件 现在刷程序   软件给了其中两个文件刷的位置 我用的WI-Fi是ESP8266-12F https://wiki.ai-thinker.com/_media/esp8266/esp8266_module_list.png 按下复位按钮 → 按下固件按钮 → 松开复位按钮 → 松开固件按钮   按照上述步骤,ESP8266进入等待刷固件状态(刷程序状态)        点击软件 START开始刷固件        刷入完成,复位下           可以打开串口调试助手       查看打印的数据      不要着急,慢慢就开始实际操作了 来源: https://www.cnblogs.com/yangfengwu/p/11961182.html

Cannot program ESP8266

孤街浪徒 提交于 2019-12-05 00:45:12
问题 Blue led is blinking after powering up the module, the red one stays on, I can even connect to it via wifi. But I cannot program it. I tried Arduino IDE, different firmware flashers (Like NodeMCU, XTCOM). I'm using Arduino Mega. Here's my initial setup: VCC - 3.3 V on Arduino RST - nothing CH_PD - 3.3 V on Arduino TX - RX on Arduino (TX is transmitting data to RX, so I don't need a voltage divider, right?) RX - voltage divider (R1 = 10K, R2 = 20K) - TX on Arduino GPIO0 - GND on Arduino GPIO2

POST request on arduino with ESP8266 using WifiESP library

随声附和 提交于 2019-12-04 16:58:33
I am attempting to make RESTful POST request using the WifiESP library ( https://github.com/bportaluri/WiFiEsp ). I'm able to successfully make the request with curl, but consistently get an error using the Arduino and ESP. I suspect the problem is related to the manual formatting of the POST request the library requires, but I don't see anything wrong. Here my sanitized code: if (client.connect(server, 80)) { Serial.println("Connected to server"); // Make a HTTP request String content = "{'JSON_key': 2.5}"; // some arbitrary JSON client.println("POST /some/uri HTTP/1.1"); client.println("Host

ESP8266 WiFiClient simple HTTP GET

折月煮酒 提交于 2019-12-04 09:33:57
问题 I'm working on simple problem of reading a webpage using ESP8266 and ESP8266WiFi library. I changed only a few lines in example and don't know whats the problem. Thats my code: include <ESP8266WiFi.h> const char* ssid = "WiwoNET"; const char* password = "xxxxxxx"; const char* host = "https://pure-caverns-1350.herokuapp.com"; void setup() { Serial.begin(115200); delay(10); // We start by connecting to a WiFi network Serial.println(); Serial.println(); Serial.print("Connecting to "); Serial

Sntp.sync() ignores server

大憨熊 提交于 2019-12-04 06:06:32
问题 I've been trying to synchronize time with ntp servers, however, nodemcu seems to ignore the server parameter. -- sync.lua sntp.sync("fr.pool.ntp.org", function() tm = rtctime.epoch2cal(rtctime.get()) print(string.format("%04d/%02d/%02d %02d:%02d:%02d", tm["year"], tm["mon"], tm["day"], tm["hour"], tm["min"], tm["sec"])) end) Execution.. > dofile('sync.lua') > 2017/05/22 21:38:39 The time response is the unix epoch time (https://www.epochconverter.com/). Is it supposed to be the server

ESP8266 for Arduino IDE (xtensa-lx106-elf-gcc) and std::map linking error

有些话、适合烂在心里 提交于 2019-12-04 04:00:02
问题 Is it possible at all to use map with ESP8266 for Arduino package? Here is my code: #include <map> typedef std::map<int, int> Items; void setup() { Items items; items[2]=5; //items.emplace(4,5); } void loop() { } Here is compilation/linking erorrs: Arduino: 1.6.5 (Windows 8.1), Board: "Generic ESP8266 Module, Serial, 80 MHz, 40MHz, DIO, 115200, 512K (64K SPIFFS)" sketch_oct31a.cpp.o: In function `loop': C:\Program Files (x86)\Arduino/sketch_oct31a.ino:11: undefined reference to `std::_Rb_tree

Sending data to ESP8266 Wi-Fi chip from Android device

我是研究僧i 提交于 2019-12-03 22:58:11
I have a ESP8266 chip which is connected to the microcircuit. When chip gets value "200" the light is starting to blink 4 times and than it returns "100" value. I need to make an Android app using Java which will connect to the ESP8266 chip, send data to it and will get value "100". I don't know what library I should use to deal with it. Please, help me, how can I do that? I think it is not the most hard question here. For your Controller you dont need any Libary. You just can use the serial AT Commands: http://www.electrodragon.com/w/ESP8266 After setting up your ESP like this: In your App

Cannot program ESP8266

依然范特西╮ 提交于 2019-12-03 15:57:04
Blue led is blinking after powering up the module, the red one stays on, I can even connect to it via wifi. But I cannot program it. I tried Arduino IDE, different firmware flashers (Like NodeMCU, XTCOM). I'm using Arduino Mega. Here's my initial setup: VCC - 3.3 V on Arduino RST - nothing CH_PD - 3.3 V on Arduino TX - RX on Arduino (TX is transmitting data to RX, so I don't need a voltage divider, right?) RX - voltage divider (R1 = 10K, R2 = 20K) - TX on Arduino GPIO0 - GND on Arduino GPIO2 - nothing GND - GND on Arduino Then I tried uploading a sketch from the Arduino IDE and got the