林定祥 发表于 2015-3-13 12:44:22

ITEAD创易工作室 发表于 2015-3-13 09:51 static/image/common/back.gif
uno内存太小,ESP抓取的信息量太大。建议用mega

看了w5100和enc28j60的用法,把长串的字符分段打印这样就可以少占内存了,但是试过esp的库,分段打印不成,是否这个库还可以优化呢。

林定祥 发表于 2015-3-13 12:50:03

在坛子里遇到有几个和我一样的问题,UNO+ESP+Yeelink比较困难的,我的体会是否可以将esp直接挂软串,这样在程序下载是不必将串口腾空,这样debug也可以用硬串了。这个只是建议,不管如何ESP-WiFi性价比还是很好的。

林定祥 发表于 2015-3-13 13:01:24

我原来用的是UNO+W5100(也用过ENC28J60)+DTH22+BMP085上yeelink,看到ESP后认为WiFi会在使用上更方便,自由度更大,今天着手在移植,就是去掉W5100换成ESP8266,前面遇到的其他问题不说了,今天又遇到了使用BMP085需要加载wire.h,加载了Wire.h后程序编译不报错,运行也不报错,但是数据不上传,看到有个回应是AT+CIPSEND=0了(正常是241),想问楼长这个问题出在了哪儿了,是否资源上有冲突了,如何能绕过这个问题。

zz749964801 发表于 2015-4-1 17:08:20

为什么我 mega2560IDE1.05版本的 编译提示出错。。。。而且错误特别多

{bits= 0;}      说这句话就有错误,这是怎么回事啊?

zz749964801 发表于 2015-4-2 12:58:04

按照楼主的代码和方式,用mega2560IDE 1.05   串口显示器出现乱码(如图) 怎么解决啊

G_D 发表于 2015-4-2 22:51:29

例子每一语句代表的意思,,,不是看的很懂,,尤其是最后一个例子。。。有是啥意思??等等,,要是全部注释,对像我这样的新手就很好了啊

孤独舰 发表于 2015-5-8 09:25:11

我用uno连接esp8266,采用wifitest程序,并且修改了uno与esp8266通讯波特率为15200,把串口缓冲器加大,用D2 D3做软串口连接外部USB-TTL,监控发现显示AT+RST过10几秒显示Module have no response。这说明与模块通讯不上,请问这是怎么回事?

arthasarthas 发表于 2015-5-30 00:47:31

请教一下,用UNO板子上传温湿度,不改#define SERIAL_BUFFER_SIZE 500时候还能debug到发送yeelink的api的地方。
如果修改了就直接卡死在AT+RST了,会是什么原因?

brealisty 发表于 2015-6-14 14:26:11

本帖最后由 brealisty 于 2015-6-14 14:27 编辑

楼主为什么编译提示debugserial not declare

brealisty 发表于 2015-6-14 20:54:37

崩溃了,,怎么改都只显示AT+RST。。。yeelink也没有任何数据
用的LM35,0模拟口读取温度。因为debugserial提示有错,所以改成了serial。麻烦帮看看啊~~~实在是感激不尽~~~!!!
#define SSID       "323"                //type your own SSID name
#define PASSWORD   "abc123abc123"                              //type your own WIFI password


#include "uartWIFI.h"
#include <SoftwareSerial.h>
WIFI wifi;

extern int chlID;      //client id(0-4)

// for yeelink api
#define APIKEY         "f9722******4d5fece00" //省略了

//replace the device ID and sensor ID for temperature sensor.
#define DEVICEID0       35782 // replace your device ID
#define SENSORID0       52997 // replace your sensor ID

char server[] = "api.yeelink.net";   // name address for yeelink API

unsigned long lastConnectionTime = 0;          // last time you connected to the server, in milliseconds
boolean lastConnected = false;               // state of the connection last time through the main loop
const unsigned long postingInterval = 5*1000; // delay between 2 datapoints, 5s
String returnValue = "";
boolean ResponseBegin = false;


int LM35PIN=0;                        //Connect D25 to data pin of DHT11

int temperature;


void setup()
{

wifi.begin();
bool b = wifi.Initialize(STA, SSID, PASSWORD);
if(!b)
{
    Serial.println("Init error");
}
delay(5000);//make sure the module can have enough time to get an IP address
String ipstring= wifi.showIP();
Serial.println(ipstring);                //show the ip address of module

}

void loop()
{
char message;
   // if you're not connected, and ten seconds have passed since
// your last connection, then connect again and send data:
if((millis() - lastConnectionTime > postingInterval)) {

//read dht11
int chk = lm35_read(0);
if(chk==0)
{

                sendData(DEVICEID0,SENSORID0,temperature);
      

}

}

// if there's incoming data from the net connection.
// send it out the Serial port.This is for debugging
// purposes only:
if(wifi.ReceiveMessage(message))
{
      Serial.println(message);   
}


delay(10);

}

// this method makes a HTTP connection to the server:
void sendData(int device_id,int sensor_id,int thisData) {
// if there's a successful connection:
if (wifi.ipConfig(TCP,server, 80)) {
    Serial.println("connecting...");
    // send the HTTP PUT request:
    String cmd;
      cmd = "POST /v1.1/device/";          //我的这里是1.1
      cmd += String(device_id);
      cmd += "/sensor/";
      cmd += String(sensor_id);
      cmd += "/datapoints";
      cmd += " HTTP/1.1\r\n";
      cmd += "Host: api.yeelink.net\r\n";
      cmd += "Accept: *";
      cmd += "/";
      cmd += "*\r\n";
      cmd += "U-ApiKey: ";
      cmd += APIKEY;
      cmd += "\r\n";
      cmd += "Content-Length: ";
      int thisLength = 10 + getLength(thisData);
    cmd += String(thisLength);
      cmd += "\r\n";
      cmd += "Content-Type: application/x-www-form-urlencoded\r\n";
      cmd += "Connection: close\r\n";
      cmd += "\r\n";
      cmd += "{\"value\":";
      cmd += String(thisData);
      cmd += "}\r\n";


      Serial.println(cmd);

    wifi.Send(cmd);
    // note the time that the connection was made:
    lastConnectionTime = millis();
}
else {
    // if you couldn't make a connection:
    Serial.println("connection failed");
    Serial.println("disconnecting.");
    wifi.closeMux();
}
}

int getLength(int someValue) {
// there's at least one byte:
int digits = 1;
// continually divide the value by ten,
// adding one to the digit count for each
// time you divide, until you're at 0:
int dividend = someValue /10;
while (dividend > 0) {
    dividend = dividend /10;
    digits++;
}
// return the number of digits:
return digits;
}




int lm35_read(int pin)
{
int data = analogRead(0);
temperature = (125*data)>>8;
Serial.print(temperature);
return true;
}

lyngao 发表于 2015-6-29 11:25:08

ITEADLIB_Arduino_WeeESP8266-master库例子中,Serial1是定义了什么?
ESP8266 wifi(Serial1);这句啥意思?

Saoskywalker 发表于 2015-7-3 19:12:09

请问楼主,我用STC80C58尝试写ESP8266的驱动文件,我将AT指令用串口发出(参照你给ESP8266库的设置过程),能是能连上网络,但是wifi串口调试软件不能连上ESP8266,你给的安卓遥控软件也不用连接,请问是什么回事:'(:'(:'(

木夕子 发表于 2015-8-3 14:40:13


请问大家一个问题,我在测试 “(二)ESP8266 wifi模块上传数据到yeelink平台“ 的程序的时候,发生mega2560可以采集到温湿度传感器的数据,但是不能将数据传上yeelink的情况,这是为什么呢?有没有什么解决方案。串口数据如图所示,我使用的元件和推荐的一样。

木夕子 发表于 2015-8-4 10:23:55

各位大神,我在测试“(二)ESP8266 wifi模块上传数据到yeelink平台“ 的程序的时候,发现用版主的设备号和传感器号可以将数据成功传到网上,但是将APIKEY、设备号和传感器号换成自己申请的,就发现无法传到网上,这是为什么呢?哪位可以给我解答一下,急。。。。。,下图是串口反馈信息。

wz13625550312 发表于 2015-9-29 13:35:37

大神,想问下你分享的视频中,一键配置是怎么做的?求分享谢谢
页: 1 2 3 4 5 6 [7] 8
查看完整版本: 【库和教程】ESP8266 WIFI模块实现远程wifi控制(持续更新)