Use thingspeak interface to set Arduino parametes | Arduino | 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
Use thingspeak interface to set Arduino parametes
No permission to create posts
November 4, 2018
10:31 am
Avatar
adolfoe
New Member
Members
Forum Posts: 2
Member Since:
November 4, 2018
sp_UserOfflineSmall Offline

Hello,

I am new to Thingspeak I am using it to log temperature and humidity for a project.
I am usin Arduino Mega with ESP8266

I would like to know if there is a way to set Thingspeak fields to be filled on the web page and have the Arduino device read the parameters in order to configure Arduino settings over online interface.

If this is not viable via Thingspeak could you suggest any other free web service that can be used to set Arduino variables online?

If possible using the Arduino as a client rather than as a server.

Thanks in advance for your help.

November 5, 2018
4:06 pm
Avatar
cstapels
Moderator
Members


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

Welcome to ThingSpeak!

Can you clarify what you mean by "set Thingspeak fields to be filled on the web page"?

You can use the Metadata field to provide parameters to your device.

You can read the metadata using a REST call to read data ( see https://www.mathworks.com/help/thingspeak/readdata.html)

Here are a few examples using the metadata:

https://blogs.mathworks.com/iot/2014/07/11/thingspeak-data-channels-now-with-more-metadata/

https://github.com/dmawrey/thingspeak-metadata

You can write to metadata from your device or from the web interface.

I would recommend writing the metadata as a JSON object and then using the Arduino JSON parser library to extract the parameters you need. That will allow you to reuse the code for other purposes. Please consider sharing your code if you get a good working example.

November 6, 2018
11:09 pm
Avatar
adolfoe
New Member
Members
Forum Posts: 2
Member Since:
November 4, 2018
sp_UserOfflineSmall Offline

Hello,

Thanks for your feedback.

What i meant is for example have a textbox called pH on a field, so that I can define a minimum or maximum ph level, and have the arduino consult this field, every certain time.

I am not sure your metadata approach is suitable for my project as this need to be done in a way that is easy for the final user, and entering on the channel configuration to change metadata in a JSON object doesn't sounds easy for the average Joe.

I reaaly appreciate your welcoming into the forum

November 7, 2018
11:10 am
Avatar
cstapels
Moderator
Members


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

Yeah, I overshot that one, sorry.
Right now we do not have an option for text entry to a channel from the channel view.

You can have the user update a field with a REST call, its still hairy but not as bad as the metadata.
https://api.thingspeak.com/update?api_key=XXXXXXXXXXXXXXXX&field8=(yourPH value)

Then the arduino can read that field for the value when it is doing its configuration.
If you wanted to make it easier on the user, you could create a webpage with a button and a text box on it, and give the web page to the user to run locally.

I can help you with the javascript for such a page if you want to go that route. I wrote such a page to control the color of the lights in my office.

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
42 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:

JerilynDernnida, JaketripDernnida, KenterDernnida, AlisaMiz, AriurinDernnida, KabinaDernnida

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457