ThingSpeak and Arduino YUN not working | Arduino | Forum

The ThingSpeak community site has been upgraded to a new site. This site is currently in read-only mode. You can ask questions or post and read discussions on the new site.
Avatar

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
ThingSpeak and Arduino YUN not working
No permission to create posts
February 24, 2016
2:09 pm
Avatar
raxpa
New Member
Members
Forum Posts: 2
Member Since:
February 24, 2016
sp_UserOfflineSmall Offline

I've been logging my data for months now but suddenly the service stopped working.

I was using this code but even using the new library provided by thingspeak nothing seems to work...any idea?

#include //LIBRERIA BRIDGE
#include //LIBRERIA SENSORE
#include //LIBRERIA SHELL

#define DHTPIN 4 // DEFINISCO IL PIN
#define DHTTYPE DHT22 // DEFINISCO IL TIPO DI SENSORE DHT 22
DHT dht(DHTPIN, DHTTYPE);

//********************
// ThingSpeak Settings
//********************
#define ARRAY_SIZE 2 //l'array dei dati da postare su thingspeak

void setup() {

Bridge.begin();

Console.begin();
dht.begin(); //INIZIALIZZO SENSORE
}

//********************
//FUNZIONE POST VALORI
//********************

void postToThingSpeak(String key, float value[]) {
Process p;
String cmd = "curl -d \'key="+key;
for (int i=0;i<ARRAY_SIZE;i++) {
cmd = cmd + "&field"+ (i+1) + "=" + value[i];
}
cmd = cmd + "\' http://api.thingspeak.com/update&quot;;

p.runShellCommand(cmd);
Console.println(cmd);
//p.close();
}

void loop() {

float temperature = dht.readTemperature(); //LEGGO TEMPERATURA DEL SENSORE
Console.println("temperatura:");
Console.println(temperature);

float humidity = dht.readHumidity(); //LEGGO UMIDITÀ DEL SENSORE
Console.println(humidity);

float vol[ARRAY_SIZE];
vol[0] = temperature;
vol[1] = humidity;
postToThingSpeak("XXXXXXXXXX", vol); //ACCOUNT

delay(20000); // ThingSpeak will only accept updates every 15 seconds.
}

February 24, 2016
4:03 pm
Avatar
Adarsh_Murthy

MathWorks
Members
Forum Posts: 62
Member Since:
August 25, 2015
sp_UserOfflineSmall Offline

Hi,

I just checked the api.thingspeak.com/update end point and it seems to be working. Could it possible be the internet connection on the yun?

Thanks,
Adarsh

Forum Timezone: America/New_York

Most Users Ever Online: 166

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

kusmumichael, petersmith99, Rambant, blakeharriss09, optisol, Niyonzima Fils

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457