Updating Data In Thingspeak | ESP8266 Wi-Fi Module | Forum

Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
Updating Data In Thingspeak
No permission to create posts
March 8, 2018
10:35 am
Avatar
Athul
New Member
Members
Forum Posts: 4
Member Since:
March 8, 2018
sp_UserOfflineSmall Offline

Hi,
As part of my project, I'm uploading data to the Thingspek IOT platform. To test the wifi module and to get an idea how the whole thing works. I connected ESP8266 with a USB TTL Serial. I used Serial Prompt in Linux to send AT commands. Module gave a response to every command and connected it to a wifi network. Then I tried to update field value of Thingspeak.
1.AT+CIPMUX=0
2. AT+CIPSTART = "TCP","www.thingspeak.com",80
2.AT+CIPSEND=74

got reply as
>

then I pasted the following link
GET https://api.thingspeak.com/update?api_key=38X665EABZ5YTRW3&field1=25

SEND OK

But the Thingspeak filed values were not updated. Anyone have any idea about this.

Thanks

March 8, 2018
10:40 am
Avatar
Athul
New Member
Members
Forum Posts: 4
Member Since:
March 8, 2018
sp_UserOfflineSmall Offline

Athul said

Hi,
As part of my project, I'm uploading data to the Thingspek IOT platform. To test the wifi module and to get an idea how the whole thing works. I connected ESP8266 with a USB TTL Serial. I used Serial Prompt in Linux to send AT commands. Module gave a response to every command and connected it to a wifi network. Then I tried to update field value of Thingspeak.

    AT+CIPMUX=0
    AT+CIPSTART = "TCP","www.thingspeak.com",80
    AT+CIPSEND=74

got reply as
   >

then I pasted the following link

        GET https://api.thingspeak.com/update?api_key=38X665EABZ5YTRW3&field1=25

   SEND OK

But the Thingspeak filed values were not updated. Anyone have any idea about this.

Thanks  

March 8, 2018
10:21 pm
Avatar
cstapels
Moderator
Members


Moderators
Forum Posts: 365
Member Since:
March 7, 2017
sp_UserOfflineSmall Offline

First make sure you can update your channel by pasting the GET command into the browser.  Make sure your API key is the write API Key.  Then look at other AT command examples. There is not yet one in the ThingSpeak documentation, but there are a lot of them out there. I'm sure you didn't show all the details of your code, but there are other steps, such as sending the size of our data packet, and connecting to the server and access point. 

Even better, you can use the Arduino IDE to program your ESP 8266, and then the steps are a lot easier than using AT commands.  See the examples in the ThingSpeak Documentation, for example the temperature monitor or the soil moisture monitor.

March 9, 2018
12:09 am
Avatar
piajola

Gold
Members
Forum Posts: 90
Member Since:
October 12, 2015
sp_UserOfflineSmall Offline

Hi Athul,

please see this post in this forum

http://community.thingspeak.com/forum/esp8266-wi-fi/dns-fail-error/#p5426

I have more than 900000 records in my channel here with an arduino+esp-01 (it does not matter if the ESP8266 is esp-01 or esp-12 or nodemcu or any model)

Less than ten US dollars for esp-01+arduino nano clone+sensor-better-than-DHT-11/22 is enough to have temperature+humidity data in thingspeak

I use Win10 with Chrome, but this does not matter either, with linux is the same thing.

As cstapels suggets,

first use the IP address line in your browser, this try worked for me

http://api.thingspeak.com/update?key=16ALPHANUMBERkey&field1=30&field2=80

second try your serial software to send to ESP8266

If you need more help just askSmile

Good luck

March 9, 2018
11:58 am
Avatar
Athul
New Member
Members
Forum Posts: 4
Member Since:
March 8, 2018
sp_UserOfflineSmall Offline

Hi,

Thanks for the reply.

I am using LPC2148(ARM7) for my projects, not Arduino. I could find a lot of projects with ESP8266 and Arduino using thingspeak library. But there's no such library available for ARM(couldn't find one). I have to write all AT codes in my code and then send 

"GET https://api.thingspeak.com/update?api_key=38X665EABZ5YTRW3&field1=25
"  

I could update my Filed with directly pasting the following link in any browser with the required field value 

https://api.thingspeak.com/update?api_key=38X665EABZ5YTRW3&field1=25

 

Today I tried again,

1. configured my wifi module and connected it with a wifi network

2.Connected to "api.thingspeak.com"

3. AT+CIPSEND=74

since my GET https://api.thingspeak.com/update?api_key=38X665EABZ5YTRW3&field1=25  link has 72 characters and extra 2 for

3. then I sent the link without 
at the end and pressed enter key(
)
and ctrl+enter(
)

 

by following above method I could update my field values.

 

But the thing is if I add
at the end of the link(GET https://api.thingspeak.com/update?api_key=38X665EABZ5YTRW3&field1=25
) instead of pressing enter key(
) and ctrl+enter(
), 
  and past it to the command prompt 

 i got the following response 

>

busy s...

send

but the field value was not updated.

 

So my question is how should I write my code. 

Can i use something like this,

    char wifi[]="GET https://api.thingspeak.com/update?api_key=38X665EABZ5YTRW3&field1=25
";

    int l = strlen(wifi); 

    sprintf(b, "AT+CIPSEND=%d",l);

    UART_TX(wifi);

 

Since sending data in GET https://api.thingspeak.com/update?api_key=38X665EABZ5YTRW3&field1=25
" this format didn't update values, not sure I could use something as above

I am confused

March 9, 2018
12:05 pm
Avatar
Athul
New Member
Members
Forum Posts: 4
Member Since:
March 8, 2018
sp_UserOfflineSmall Offline

Updating answer due to missing characters

Hi,

Thanks for the reply.

I am using LPC2148(ARM7) for my projects, not Arduino. I could find a lot of projects with ESP8266 and Arduino using thingspeak library. But there's no such library available for ARM(couldn't find one). I have to write all AT codes in my code and then send 

"GET https://api.thingspeak.com/update?api_key=38X665EABZ5YTRW3&field1=25
"  

I could update my Filed with directly pasting the following link in any browser with the required field value 

https://api.thingspeak.com/update?api_key=38X665EABZ5YTRW3&field1=25

 

Today I tried again,

1. configured my wifi module and connected it with a wifi network

2.Connected to "api.thingspeak.com"

3. AT+CIPSEND=74

since my GET https://api.thingspeak.com/update?api_key=38X665EABZ5YTRW3&field1=25  link has 72 characters and extra 2 for <carraige return><new line>

3. then I sent the link without <carraige return><new line>at the end and pressed enter key(<carraige return>) and ctrl+enter(<new line>), 

by following above method I could update my field values.

 

But the thing is if I add <carraige return><new line> at the end of the link(GET https://api.thingspeak.com/update?api_key=38X665EABZ5YTRW3&field1=25<carraige return><new line>) instead of pressing enter key(<carriage return>) and ctrl+enter(<new line>),   and past it to the command prompt 

 I got the following response 

><new line>

busy s...

send

but the field value was not updated.

 

So my question is how should I write my code. 

Can i use something like this,

    char wifi[]="GET https://api.thingspeak.com/update?api_key=38X665EABZ5YTRW3&field1=25<carraige return><new line>";

    int l = strlen(wifi); 

    sprintf(b, "AT+CIPSEND=%d",l);

    UART_TX(wifi);

 

Since sending data in GET https://api.thingspeak.com/update?api_key=38X665EABZ5YTRW3&field1=25<carriage return><new line>this format didn't update values, not sure I could use something as above

I am confused

March 9, 2018
7:45 pm
Avatar
piajola

Gold
Members
Forum Posts: 90
Member Since:
October 12, 2015
sp_UserOfflineSmall Offline

Hi,
to add to the confusion ... 🙂
I tried your link in my W10 chrome ... twice and got 14 and 15 so I think I put two 25 values in your field1 channel xxxx
I am assuming you are talking your adventures with your serial software to control/use your ESP8266
so ...

><new line>

busy s...

send

must be interpreted as a failure ... if you receive busy s... the ESP826 was confused and did nothing, you must try again and differently.
Also there are differences in the different versions of the ESP "AT" firmware, there is no ONE firmware version.
Another also ESP has ATE0 NO echo from ESP
                                       ATE1 echo from ESP - more chars in RS232
I used 3 serial software: YAT, Termite and PUTTY
- in YAT I press button SEND to send the chars in the command text
- in Putty I must add ^M^J at the end of chars and press ENTER
- in Termite I put the chars in the command text and press ENTER
all 3 are GUI and choice cr only, nl only or cr+nl
I do not know your philips(NXP) compiler, but read parts of my arduino code next, note arduino has print and println (ascii 13 and ascii 13+ascii 10)

initialize ESP
Serial.println("AT+RST");
wait 5000 ms
Serial.println("ATE0");
wait 500 ms
Serial.println("AT");
wait 500 ms
if (Serial.find("OK")) {
  wait 1000 ms
  // try to connect to wifi
} else {
  there is AT error ESP is not ready
}

TCP connection to send one more time
Serial.println("AT+CIPSTART=\"TCP\",\"184.106.153.149\",80");

if (Serial.find("ERROR")) {                    // Error in other fw version
  // something very bad there is NO TS
}
// send data length
Serial.println("AT+CIPSEND=66");
if (Serial.find(">")) {
  Serial.print("GET /update?api_key=");   // 20
  Serial.print(apiKey);                                 // 16
  Serial.print("&field1=");                          // 8
  Serial.print(String(valTemperature));   // 5 00.00 adjust your style
  Serial.print("&field2=");                          // 8
  Serial.print(String(valHumidity));         // 5 98.76
  Serial.print("|r|n|r|n");                        // 4 [CR][NL][CR][NL]
} else {
  Serial.println("AT+CIPCLOSE");
}

Gooooood luckSmile

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
32 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 261

Vinod: 196

piajola: 85

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

Newest Members:

JudestAboth, concettazx4, lyndarf60, caseybo16, iodiree, emiliacz4

Administrators: Hans: 387, lee: 457