How to send data from ThingSpeak to ESP8266 (arduino) using ThingHTTP | ESP Wi-Fi | 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
How to send data from ThingSpeak to ESP8266 (arduino) using ThingHTTP
No permission to create posts
January 4, 2016
6:37 am
Avatar
Syed Rafay
New Member
Members
Forum Posts: 2
Member Since:
January 4, 2016
sp_UserOfflineSmall Offline

Hi. I have made Arduino Kit acting as weather station. It sends data of the sensors connected (DHT11 & LDR) to the ThingSpeak web-server.

Now I want to perform some actions according to data on ThingSpeak Server ( like if temperature exceeds turn on fan e.t.c).

I've searched and I found that there's a React App on thingspeak which will trigger event if data exceeds some values,

The problem where I got stuck is that I want to send signal from thingspeak webserver to my ESP8266 (arduino) kit to turn on/off the device connected to relay on arduino.

I've figured out that there's also a ThingHTTP feature which sends HTTP request
But don't know how to send request/signal to my kit to perform some actions.

I've already spent my 2 months building this project, and now just stuck in the last part . Please give your valuable suggestions and solutions.

January 7, 2016
1:05 pm
Avatar
lballaty
New Member
Members
Forum Posts: 2
Member Since:
January 7, 2016
sp_UserOfflineSmall Offline

If your kit is behind a NAT then you'll need to know the IP address on the public side and have your GW/NAT forward to your device from the outside.

I think ... I'm new to this particular tech but that is how I solved it before.

January 7, 2016
11:33 pm
Avatar
rw950431

Top
Members
Forum Posts: 279
Member Since:
January 29, 2014
sp_UserOfflineSmall Offline

Alternatively you can consider the Talkback app- this allows you to send a text string in response to a POST command from the ESP8266. This will require the ESP8266 to poll thingSpeak rather than listen for an incoming request. Whether this is more convenient than the suggestion by Iballaty depends on your application.

If your esp8266 is doing updates anyway you can combine an update with a talkback response.

https://au.mathworks.com/help/thingspeak/talkback-app.html#update_and_execute

You may need to write a matlab analysis app to interface your React with your Talkback. Matlab's "webwrite" command is useful as I dont think there is a thingspeak wrapper function for talkback like there is for channel read and update.

January 8, 2016
11:01 pm
Avatar
bubba198

Silver
Members
Forum Posts: 8
Member Since:
November 16, 2015
sp_UserOfflineSmall Offline

What you are asking for is a game changer. You would need mqtt

https://learn.adafruit.com/adafruit-io/arduino

It's a totally different game; although library does exist the entire back-end is a different concept from ThingSpeak. Again this mqtt business is the only way to send data to IoT devices without being able to reach them via IP (behind NAT).

For example that will automatically qualify all mobile IoT things since the cell carriers, although assigning public IPs to the customer do block any and all incoming traffic from the "outside" world and my ESP8266 connected to an AT&T hot spot is basically unreachable from the Internet directly. So with mqtt the thing maintains persistent connection to the mqtt broker and when I send a message via the broker that live connection is how the message gets delivered to the ESP in real time without the thing having to poll some php script all the time for "new data"

January 9, 2016
1:54 am
Avatar
rw950431

Top
Members
Forum Posts: 279
Member Since:
January 29, 2014
sp_UserOfflineSmall Offline

MQTT still requires a internet connection between client and broker- it avoids the NAT issues by having the client (behind NAT) initiate the connection. Last time I looked at MQTT the code required to maintain the connection, handle drop-outs etc seemed harder than it should be- perhaps things are better now.

Whilst its possible to write a Thingspeak to MQTT bridge it would be great if Thingspeak supported this natively..

Forum Timezone: America/New_York

Most Users Ever Online: 166

Currently Online:
15 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 272

Vinod: 240

piajola: 95

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 8665

Moderators: 1

Admins: 2

Forum Stats:

Groups: 3

Forums: 14

Topics: 1600

Posts: 5760

Newest Members:

titan83, Svetoslav, abubakar, shindepavan551@gmail.com, fet61-fakohse, Mario Marquez

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457