# About the usage of Rev2 esp8266 at command

**URL:** <https://bbs.aprbrother.com/t/about-the-usage-of-rev2-esp8266-at-command/676>\
**Category:** Arduino\
**Created:** [August 5, 2016, 7:58am UTC](https://bbs.aprbrother.com/t/about-the-usage-of-rev2-esp8266-at-command/676 "2016-08-05T07:58:20Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![owen](https://bbs.aprbrother.com/letter_avatar_proxy/v4/letter/o/b2d939/32.png) [@owen](https://bbs.aprbrother.com/u/owen)\
**Post date:** [August 5, 2016, 7:58am UTC](https://bbs.aprbrother.com/t/about-the-usage-of-rev2-esp8266-at-command/676/1 "2016-08-05T07:58:20Z")

</div>

I recently got into this field of arduino , and I bought the espduino to send some messages up to the thingspeak . I download the smaple code on github from [https://github.com/AprilBrother/espduino](https://github.com/AprilBrother/espduino) .  
And I try to use the thingspeak sample . But I didn’t got a dht . So I just type the numbers on and try to modify it . But It just didn’t send it up . Here is my code .

```auto
#include <espduino.h>
#include <rest.h>

#define PIN_ENABLE_ESP 13
#define SSID "dlink3f"
#define PASS "fang752612345"

ESP esp(&Serial1, &Serial, PIN_ENABLE_ESP);

REST rest(&esp);

boolean wifiConnected = false;

void wifiCb(void* response)
{
  uint32_t status;
  RESPONSE res(response);

  if(res.getArgc() == 1) {
    res.popArgs((uint8_t*)&status, 4);
    if(status == STATION_GOT_IP) {
      Serial.println("WIFI CONNECTED");
     
      wifiConnected = true;
    } else {
      wifiConnected = false;
    }
    
  }
}

void setup() {
  Serial1.begin(19200);
  Serial.begin(19200);
  esp.enable();
  delay(500);
  esp.reset();
  delay(500);
  while(!esp.ready());

  Serial.println("123");
  if(!rest.begin("api.thingspeak.com")) {
    Serial.println("ARDUINO: failed to setup rest client");
    while(1);
  }

  /*setup wifi*/
  Serial.println("ARDUINO: setup wifi");
  esp.wifiCb.attach(&wifiCb);

  esp.wifiConnect(SSID, PASS);
  Serial.println("ARDUINO: system started");
}

void loop() {
  char response[266];
  esp.process();
  if(wifiConnected) {
      char buff[64];
      sprintf(buff, "/update?api_key=Y9RPPYEVNVDJGN8R&field1=%s&field2=%s", 2, 3);
      Serial.println(buff);
      rest.get((const char*)buff);
      Serial.println("ARDUINO: send get");

      if(rest.getResponse(response, 266) == HTTP_STATUS_OK){
        Serial.println("ARDUINO: GET successful");
        Serial.println(response);
      }
      delay(30000);
      
    } else {
      Serial.print("error,\r\n"); 
    }
    
    
  }

```

![](https://bbs.aprbrother.com/uploads/default/original/1X/3c93b453437f8912a68fe453bbbc7a66f953a98e.png)

and the result can i got some help?

---

<div class="post-metadata">

**Author:** ![aprilpea](https://bbs.aprbrother.com/user_avatar/bbs.aprbrother.com/aprilpea/32/9_2.png) [@aprilpea](https://bbs.aprbrother.com/u/aprilpea)\
**Post date:** [August 5, 2016, 8:03am UTC](https://bbs.aprbrother.com/t/about-the-usage-of-rev2-esp8266-at-command/676/2 "2016-08-05T08:03:36Z")

</div>

Please change the baud rate at serial monitor to 19200 first.

---

<div class="post-metadata">

**Author:** ![owen](https://bbs.aprbrother.com/letter_avatar_proxy/v4/letter/o/b2d939/32.png) [@owen](https://bbs.aprbrother.com/u/owen)\
**Post date:** [August 5, 2016, 8:18am UTC](https://bbs.aprbrother.com/t/about-the-usage-of-rev2-esp8266-at-command/676/3 "2016-08-05T08:18:20Z")

</div>

i changed but nothing have shown ![](https://bbs.aprbrother.com/uploads/default/original/1X/78ed206d78e497eade1954b6f2e370586b22f8b8.png)  
like this

---

<div class="post-metadata">

**Author:** ![owen](https://bbs.aprbrother.com/letter_avatar_proxy/v4/letter/o/b2d939/32.png) [@owen](https://bbs.aprbrother.com/u/owen)\
**Post date:** [August 5, 2016, 12:12pm UTC](https://bbs.aprbrother.com/t/about-the-usage-of-rev2-esp8266-at-command/676/4 "2016-08-05T12:12:22Z")

</div>

This is the latest result ![](https://bbs.aprbrother.com/uploads/default/original/1X/27118828327ef1d236d89b9eb5f991ef978235f5.png)

could anyone help me out with this  
P.S my board is Cactus Micro Rev2 Arduino compatible plus esp8266

---

<div class="post-metadata">

**Author:** ![aprilpea](https://bbs.aprbrother.com/user_avatar/bbs.aprbrother.com/aprilpea/32/9_2.png) [@aprilpea](https://bbs.aprbrother.com/u/aprilpea)\
**Post date:** [August 8, 2016, 2:08am UTC](https://bbs.aprbrother.com/t/about-the-usage-of-rev2-esp8266-at-command/676/5 "2016-08-08T02:08:06Z")

</div>

Hi,

Did you re-flash the firmware for esp8266 module? Please check the topic “[about cactus micro r2 recently](https://bbs.aprbrother.com/t/about-cactus-micro-r2-recently/493/2)”

Please make sure which firmware you choose. The sketch you post can only work with the firmware espduino. It can’t work with AT firmware.

---

<div class="post-metadata">

**Author:** ![owen](https://bbs.aprbrother.com/letter_avatar_proxy/v4/letter/o/b2d939/32.png) [@owen](https://bbs.aprbrother.com/u/owen)\
**Post date:** [August 8, 2016, 8:12am UTC](https://bbs.aprbrother.com/t/about-the-usage-of-rev2-esp8266-at-command/676/6 "2016-08-08T08:12:43Z")

</div>

I’m sorry I’m not sure how to upload the sketch . Infact , I only want to upload to thingspeak . Is there any way I can upload to thingspeak with the board Cactus Micro Rev2 Arduino compatible plus esp8266 . Is there any easy explanation ?

---

<div class="post-metadata">

**Author:** ![aprilpea](https://bbs.aprbrother.com/user_avatar/bbs.aprbrother.com/aprilpea/32/9_2.png) [@aprilpea](https://bbs.aprbrother.com/u/aprilpea)\
**Post date:** [August 8, 2016, 8:18am UTC](https://bbs.aprbrother.com/t/about-the-usage-of-rev2-esp8266-at-command/676/7 "2016-08-08T08:18:04Z")

</div>

The default firmware for esp8266 module is espduino. If you haven’t re-flashed the esp8266 module, the firmware should be espduino.

I’ve tested the sketch you posted here. It works. Have you made any other change to the board?

---

<div class="post-metadata">

**Author:** ![owen](https://bbs.aprbrother.com/letter_avatar_proxy/v4/letter/o/b2d939/32.png) [@owen](https://bbs.aprbrother.com/u/owen)\
**Post date:** [August 8, 2016, 9:04am UTC](https://bbs.aprbrother.com/t/about-the-usage-of-rev2-esp8266-at-command/676/8 "2016-08-08T09:04:40Z")

</div>

I didn’t made any change to the board . Is it the same sketch ? I don’t know , the board just don’t reply to me .

---

<div class="post-metadata">

**Author:** ![owen](https://bbs.aprbrother.com/letter_avatar_proxy/v4/letter/o/b2d939/32.png) [@owen](https://bbs.aprbrother.com/u/owen)\
**Post date:** [August 8, 2016, 9:07am UTC](https://bbs.aprbrother.com/t/about-the-usage-of-rev2-esp8266-at-command/676/9 "2016-08-08T09:07:07Z")

</div>

Is it the same board ?  
The Micro Rev2 one .

---

<div class="post-metadata">

**Author:** ![aprilpea](https://bbs.aprbrother.com/user_avatar/bbs.aprbrother.com/aprilpea/32/9_2.png) [@aprilpea](https://bbs.aprbrother.com/u/aprilpea)\
**Post date:** [August 8, 2016, 9:07am UTC](https://bbs.aprbrother.com/t/about-the-usage-of-rev2-esp8266-at-command/676/10 "2016-08-08T09:07:55Z")

</div>

Could you please take a photo for the board?

---

<div class="post-metadata">

**Author:** ![owen](https://bbs.aprbrother.com/letter_avatar_proxy/v4/letter/o/b2d939/32.png) [@owen](https://bbs.aprbrother.com/u/owen)\
**Post date:** [August 8, 2016, 9:14am UTC](https://bbs.aprbrother.com/t/about-the-usage-of-rev2-esp8266-at-command/676/11 "2016-08-08T09:14:45Z")

</div>

![](https://bbs.aprbrother.com/uploads/default/original/1X/3e660f41504ff4b32d9c111ee34a2a53e39d1836.jpg)

---

<div class="post-metadata">

**Author:** ![owen](https://bbs.aprbrother.com/letter_avatar_proxy/v4/letter/o/b2d939/32.png) [@owen](https://bbs.aprbrother.com/u/owen)\
**Post date:** [August 8, 2016, 9:16am UTC](https://bbs.aprbrother.com/t/about-the-usage-of-rev2-esp8266-at-command/676/12 "2016-08-08T09:16:45Z")

</div>

And I came to the site on the box to look for help .

---

<div class="post-metadata">

**Author:** ![owen](https://bbs.aprbrother.com/letter_avatar_proxy/v4/letter/o/b2d939/32.png) [@owen](https://bbs.aprbrother.com/u/owen)\
**Post date:** [August 8, 2016, 9:37am UTC](https://bbs.aprbrother.com/t/about-the-usage-of-rev2-esp8266-at-command/676/13 "2016-08-08T09:37:11Z")

</div>

with this sketch . I can connect to my wifi .

```auto
 * @example ConnectWiFi.ino
 * @brief The ConnectWiFi demo of library WeeESP8266. 
 * @author Wu Pengfei<pengfei.wu@itead.cc> 
 * @date 2015.03
 * 
 * @par Copyright:
 * Copyright (c) 2015 ITEAD Intelligent Systems Co., Ltd. \n\n
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version. \n\n
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
#include "ESP8266.h"

#define SSID "dlink3f"
#define PASSWORD "fang752612345"

ESP8266 wifi(Serial1);

void setup(void)
{
    pinMode(13, OUTPUT);
     digitalWrite(13, HIGH); 
    Serial.begin(9600);
    Serial.print("setup begin\r\n");

    Serial.print("FW Version: ");
    Serial.println(wifi.getVersion().c_str());
    
    
    if (wifi.setOprToStation()) {
        Serial.print("to station ok\r\n");
    } else {
        Serial.print("to station err\r\n");
    }

    if (wifi.joinAP(SSID, PASSWORD)) {
        Serial.print("Join AP success\r\n");
        Serial.print("IP: ");       
        Serial.println(wifi.getLocalIP().c_str());
    } else {
        Serial.print("Join AP failure\r\n");
    }
    
    Serial.print("setup end\r\n");
}

void loop(void)
{
}

```

 ![](https://bbs.aprbrother.com/uploads/default/original/1X/a407f5b9d50775b6b5958a7a551b091cffe3a153.png)

---

<div class="post-metadata">

**Author:** ![aprilpea](https://bbs.aprbrother.com/user_avatar/bbs.aprbrother.com/aprilpea/32/9_2.png) [@aprilpea](https://bbs.aprbrother.com/u/aprilpea)\
**Post date:** [August 9, 2016, 1:40am UTC](https://bbs.aprbrother.com/t/about-the-usage-of-rev2-esp8266-at-command/676/14 "2016-08-09T01:40:55Z")

</div>

Hi,

The sketch from itead work with at command firmware. Please check [the section “For esp8266 AT firmware”](http://wiki.aprbrother.com/wiki/Cactus_Micro_R2_Tutorial#For_eps8266_AT_firmware) for more examples.

---

<div class="post-metadata">

**Author:** ![owen](https://bbs.aprbrother.com/letter_avatar_proxy/v4/letter/o/b2d939/32.png) [@owen](https://bbs.aprbrother.com/u/owen)\
**Post date:** [August 9, 2016, 6:27am UTC](https://bbs.aprbrother.com/t/about-the-usage-of-rev2-esp8266-at-command/676/15 "2016-08-09T06:27:00Z")

</div>

HI ,  
Now I can run with these examples [https://github.com/AprilBrother/cactus-micro-r2/tree/master/libraries/CactusMicro/examples](https://github.com/AprilBrother/cactus-micro-r2/tree/master/libraries/CactusMicro/examples) , so how should I do to make it send on to the thingspeak .

Thanks for your help

---

<div class="post-metadata">

**Author:** ![aprilpea](https://bbs.aprbrother.com/user_avatar/bbs.aprbrother.com/aprilpea/32/9_2.png) [@aprilpea](https://bbs.aprbrother.com/u/aprilpea)\
**Post date:** [August 9, 2016, 7:31am UTC](https://bbs.aprbrother.com/t/about-the-usage-of-rev2-esp8266-at-command/676/16 "2016-08-09T07:31:27Z")

</div>

You need re-flash the firmware to espduino.

Please check our wiki [Cactus Micro R2 Tutorial](http://wiki.aprbrother.com/wiki/Cactus_Micro_R2_Tutorial). There’s a link for How to made Cactus Micro R2 as ESP8266 programmer.

Here’s [the espduino firmware](https://github.com/AprilBrother/espduino/tree/master/esp8266/release).

---

<div class="post-metadata">

**Author:** ![owen](https://bbs.aprbrother.com/letter_avatar_proxy/v4/letter/o/b2d939/32.png) [@owen](https://bbs.aprbrother.com/u/owen)\
**Post date:** [August 9, 2016, 8:39am UTC](https://bbs.aprbrother.com/t/about-the-usage-of-rev2-esp8266-at-command/676/17 "2016-08-09T08:39:42Z")

</div>

HI ,  
I follow the instruction and done .  
but I still can’t get the code I type on top run .  
What should I do next.

 ![](https://bbs.aprbrother.com/uploads/default/original/1X/9c4fe9f7876bcda14d7162e64a05188b451157ef.png)

---

<div class="post-metadata">

**Author:** ![aprilpea](https://bbs.aprbrother.com/user_avatar/bbs.aprbrother.com/aprilpea/32/9_2.png) [@aprilpea](https://bbs.aprbrother.com/u/aprilpea)\
**Post date:** [August 9, 2016, 8:50am UTC](https://bbs.aprbrother.com/t/about-the-usage-of-rev2-esp8266-at-command/676/18 "2016-08-09T08:50:57Z")

</div>

Please also take a screenshot for “Config” and “Advanced” page.

---

<div class="post-metadata">

**Author:** ![owen](https://bbs.aprbrother.com/letter_avatar_proxy/v4/letter/o/b2d939/32.png) [@owen](https://bbs.aprbrother.com/u/owen)\
**Post date:** [August 9, 2016, 9:23am UTC](https://bbs.aprbrother.com/t/about-the-usage-of-rev2-esp8266-at-command/676/19 "2016-08-09T09:23:22Z")

</div>

![](https://bbs.aprbrother.com/uploads/default/original/1X/43e754816682ccae6c0e256e502a47136554c8b2.png)

here it is

---

<div class="post-metadata">

**Author:** ![aprilpea](https://bbs.aprbrother.com/user_avatar/bbs.aprbrother.com/aprilpea/32/9_2.png) [@aprilpea](https://bbs.aprbrother.com/u/aprilpea)\
**Post date:** [August 10, 2016, 2:09am UTC](https://bbs.aprbrother.com/t/about-the-usage-of-rev2-esp8266-at-command/676/20 "2016-08-10T02:09:08Z")

</div>

Please change these:

- Flash size - 1MByte or 512KByte
- SPI Mode - QIO

[Next page](https://bbs.aprbrother.com/t/about-the-usage-of-rev2-esp8266-at-command/676.md?page=2)
