esp8266

Linking error using Arduino library with c++'s stringstream

£可爱£侵袭症+ 提交于 2019-12-02 14:23:05
问题 I am using an esp8266 together with platformio to write a simple sketch. #include <sstream> #include <Arduino.h> std::stringstream s; void setup() { Serial.begin(9600); Serial.println("Test"); } void loop() { } Everything should be setup correctly and most sketches worked without issues. But as soon as I try to use stringstreams I get errors when platformio is linking the firmware. platformio run [12/29/16 12:11:32] Processing esp12e (platform: espressif8266, board: nodemcu, framework:

Sntp.sync() ignores server

烂漫一生 提交于 2019-12-02 11:42:28
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 parameter time (in this case, France)? I tried several different servers (i.e http://www.pool.ntp.org/zone

WIFI网络(ESP8266)升级STM32: STM32使用http下载程序文件,乒乓升级方式,支持程序回滚,支持MQTT通信控制 (WIFI模块AT,TCP透传方式)

泪湿孤枕 提交于 2019-12-02 10:14:17
实现功能概要 BootLoader程序:     如果没有更新标志位,则尝试加载用户程序.     如果有更新标志位,STM32控制WIFI模块以TCP方式连接Web服务器,然后发送Get 协议获取程序文件,写入Flash后,重启!     每次写入Flash 切换Flash的写入位置,加入更新状态检测,更新失败则运行上一版程序(程序回滚) APP用户程序:     处理MQTT接收的数据,如果接收到更新指令,则置位升级标志位,重启 MQTT通信升级规定的协议: WIFI设备订阅的主题 "user/设备MAC地址" 列如: "user/dc:4f:22:11:5d:33" WIFI设备发布的主题 "device/设备MAC地址" 列如: "device/dc:4f:22:11:5d:33" 一,上位机通过MQTT发送获取设备信息指令 {"data":"updata","cmd":"DeviceInfo"} //设备回复 {"data":"updata","model":"STM32_AT8266","version":"1.0.2"}//假设现在的型号是STM32_AT8266,当前设备硬件版本是1.0.2 二,上位机根据型号使用http访问云端存放的记录更新信息的文件 "型号" 列如:"http://47.92.31.46/hardware/"+STM32_AT8266+"/"+

WIFI网络(ESP8266)升级STM32: STM32使用http下载程序文件,乒乓升级方式,支持程序回滚 (WIFI模块AT,TCP透传方式)

不想你离开。 提交于 2019-12-02 10:13:28
实现功能概要 BootLoader程序:     如果没有更新标志位,则尝试加载用户程序.     如果有更新标志位,STM32控制WIFI模块以TCP方式连接Web服务器,然后发送Get 协议获取程序文件,写入Flash后,重启!     每次写入Flash 切换Flash的写入位置,加入更新状态检测,更新失败则运行上一版程序(程序回滚) APP用户程序:     每隔10S,控制WIFI以TCP方式连接Web服务器,获取当前程序版本,如果版本不一致,写入更新标志,重启单片机! Flash配置: 测试 来源: https://www.cnblogs.com/yangfengwu/p/11741692.html

The wifi.sta module connects if a loop is running?

微笑、不失礼 提交于 2019-12-02 08:02:22
Im trying to detect when the module actually connects to my wifi AP, since .connect does not have a callback im doing something simple like this: wifi.sta.config("SSID","password") wifi.sta.connect() tmr.delay(1000000) i = 0 while(wifi.sta.status() ~= 5 and i < 10) do print("Waiting") print(wifi.sta.status()) i = i + 1 tmr.delay(1000000) end But the output of .sta.status() is always 1 inside the loop. When it finish, if I send the command =wifi.sta.status() manually from the IDE it tells me 5. Why? Using tmr.delay doesnot let run the event loop, you should use a timer callback. Then the code

Compile error with ESP8266 SDK in KAA 0.10.0

我的梦境 提交于 2019-12-02 07:41:38
I have built the ESP8266 SDK according to this document . But the compile report shows the error below. Attachemnt is the ld file. Would you please help me to resolve it? Thanks a lot! /opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: esp8266_app section `.text' will not fit in region `iram1_0_seg' /opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: region `iram1_0_seg' overflowed by 43955 bytes kaa/tools/kaa_encryption/rsa_key_gen/mbedtls/libmbedtls.a

esp8266 第二章 如何通过Makefile 重写esp工程结构

醉酒当歌 提交于 2019-12-02 03:14:35
标准工程结构: │ ── Project // 自定义工程 │ ├── component │ │ └── button //组件一:按键封装 │ │ └── include //组件一:按键封装 头文件 │ │ └── button.h │ │ └── button.c //组件一:按键封装 源文件 │ │ └── component.mk │ │ └── logUtils //组件一:日志打印封装 │ │ └── include │ │ └── logUtils.h //组件一:日志打印封装 头文件 │ │ └── logUtils.c //组件一:日志打印封装 源文件 │ │ └── component.mk │ ├── Makefile │ ├── main │ │ ├── Kconfig │ │ ├── app_main.c // 主程序入口 │ │ └── component.mk │ └── sdkconfig.defaults 来源: https://www.cnblogs.com/vx-cg248805770/p/11728248.html

通过ESP8266调节继电器时间

ε祈祈猫儿з 提交于 2019-12-02 02:33:53
通过ESP8266调节继电器时间 1、继电器选择(可调节时间的继电器) 2、继电器与esp8266的接线【set --- D6,UP --- D5,DOWN --- D1】 3、Arduino 程序 void changeTime(int change_type) { // 长按 SET 2s pinMode(D6, OUTPUT); digitalWrite(D6, LOW); delay(2300); digitalWrite(D6, HIGH); Serial.println("长按 SET 2s 。。。 "); pinMode(D6, INPUT); delay(800); // 按一下 SET pinMode(D6, OUTPUT); digitalWrite(D6, LOW); delay(200); digitalWrite(D6, HIGH); Serial.println("按一下 SET 。。。 "); pinMode(D6, INPUT); // 等 2s delay(4000); Serial.println("等 3s 。。。 "); // 按一下 UP if (change_type == 1) { pinMode(D5, OUTPUT); digitalWrite(D5, LOW); delay(200); digitalWrite(D5, HIGH)

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

梦想的初衷 提交于 2019-12-01 20:02:16
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_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base

SSL certificate verification on ESP8266 Wemos D1 Mini with MQTT broker

时光总嘲笑我的痴心妄想 提交于 2019-12-01 11:33:30
I have a raspberry pi 3 with raspbian stretch as its operating system. I have installed and fully configured a MQTT broker on the raspberry pi following this tutorial: https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-the-mosquitto-mqtt-messaging-broker-on-ubuntu-16-04 Everything works fine and well on the broker's side. The certificates get renewed after 60 days and you can only connect to port 1883 via the localhost and the other ports (8883 and 8083) are open but can only be accessed using TLS version 1.2 and for the latter also using websockets. Below you can find