Plant Communicator

Ever wished you could talk with your plants?

Nov 23, 2017

178434 views

194 respects

Components and supplies

1

Arduino MKR IoT Bundle

Apps and platforms

1

ThingSpeak API

1

Zapier

Project description

Code

Downloadable files

Wiring

Wiring

Wiring

Wiring

Comments

Only logged in users can leave comments

jaidev2208

2 years ago

guys my zapier is not receiving anything at all when I upload my code neither is the graph site. when I upload my code the serial monitor shows "Connecting to wifi:wifi name" and then nothing.

Anonymous user

2 years ago

This project is great but I am a beginner. I have an issue at the beginning : just after the wifi connection is etablished, I see : "HTTP/1.1 404 Not Found Content-Type: text/html; charset=utf-8 Date: Wed, 09 May 2018 21:47:46 GMT P3P: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT" Response-Id: 5af36c82-2bbd-490f-a527-644410ca40c0 Server: nginx Set-Cookie: zapsession=8t217gvgf81jtes8cfol6tw4mhit9o61; expires=Wed, 16-May-2018 21:47:46 GMT; httponly; Max-Age=604800; Path=/; secure Set-Cookie: zapforeversession=hdp32cpq9t7akq047ox4snb0cdz4mkju; expires=Thu, 09-May-2019 21:47:46 GMT; Max-Age=31536000; Path=/; secure Vary: X-Session-Key X-Frame-Options: SAMEORIGIN X-Session-Key: 8t217gvgf81jtes8cfol6tw4mhit9o61 X-Zapier-Jobs: Woooo, a hacker like yourself should consider working at Zapier! X-Zapier-Jobs-Link: https://zapier.com/blog/help-automate-business-zapier-jobs-and-careers/ X-Zapier-Revision: 8905d3b9f0ffe657fa013a94dce527fb8d65b4d9 Content-Length: 38248 Connection: Close" Could you help me please ? Thanks :)

Anonymous user

2 years ago

I'm receiving the same error. Were you able to resolve the issue?

Arduino_Genuino

2 years ago

The Project has been revised with new Zapier screen captures and Skeches fixes to avoid ambiguities. Tested for compilation and full functionalities.

Anonymous user

2 years ago

Is it okay to use Arduino Uno baord for this circuit ?, provided I am not damaging the uno board.

Aelocf

2 years ago

I Have the Same Error, i can´t connect with zapier. I think because the catch hook does not confirm the test, but I dont know how to close this cicle. My web hook only shows: Here is a sample we‘ve collected so far.Pick 1 to set up your zap Help!

Anonymous user

2 years ago

I finally solved out the message error ("Failed to connect to client" ) There was a little syntax error in the following line: Line with error: client.println("POST " + httpsRequest + "temperature=" + _temperature + "&moisture=" + _moisture + "&light=" + _light + "&warning=" + _warning + " HTTP/1.1"); The character ? was forgotten before temperature ===> so you must write: ?temperature instead of temperature: So the full code line with good syntax is finally: The solution is: client.println("POST " + httpsRequest + "?temperature=" + _temperature + "&moisture=" + _moisture + "&light=" + _light + "&warning=" + _warning + " HTTP/1.1"); httpsRequest is the given url by zapper: example for httpsRequest https://hooks.zapier.com/hooks/catch/55555/66666RI/ This solution worked great for me i hope my solution will help someone

Anonymous user

2 years ago

if there is still an "client connection" message error after you applied the solution: client.println("POST " + httpsRequest + "?temperature=" + _temperature + "&moisture=" + _moisture + "&light=" + _light + "&warning=" + _warning + " HTTP/1.1"); it must be because you did not upload the certificate" hooks.zapier.com:443" Solution : In arduino IDE click===> Tools===>Wifi01 Firmware Updater ===> click Add domain ==>and write hooks.zapier.com:443" Finally ===> click on "Upload the certificated to the Wifi Module" Conclusion: The problem is either a syntax error in the http request or a problem with uploading the ssl certificate to your arduino board

Anonymous user

2 years ago

Yeah, I am also getting the same issue with the Zapier, the "Failed to connect to client" for the wifi hook up is the error message. Let me know if anyone figured it out.

lllla

2 years ago

I keep getting "Failed to connect to client" and I have tried everything.

Anonymous user

2 years ago

On ThinkSpeak and Zapier I receive data only twice after I upload the sketch. I want to upload data every minute, the first two minutes are successful, after that my Serial monitor shows "message sent to cloud" every minute but nothing new shows up on TS. On Zapier the serial plotter shows failed to connect to client. If I unplug it and start again then I get 2 values before it stops again, please Help!

Anonymous user

2 years ago

Same is happening to me! Any clue?

Anonymous user

2 years ago

The problem seems to be that client closes before sending message, currently I don't use ThinkSpeak library because it is buggy. Old version works better with added delay ```c #include <WiFi101.h> char server[] = "api.thingspeak.com"; // name address for Google (using DNS) WiFiClient client; const String myWriteAPIKey1 = SECRET_WRITE_API; void SendToThingspeakOld(float temperature, int moisture, int light) { if (client.connect(server, 80)) { Serial.println("Connected to server"); String tsData = "field1=" + (String)light + "&field2=" + (String)moisture + "&field3=" + (String)temperature; client.print(F("POST ")); client.print("/update?key=apiKey&" + tsData); client.print("POST /update HTTP/1.1\ "); client.print("Host: api.thingspeak.com\ "); client.print("Connection: close\ "); client.print("X-THINGSPEAKAPIKEY: " + myWriteAPIKey1 + "\ "); client.print("Content-Type: application/x-www-form-urlencoded\ "); client.print("Content-Length: "); client.print(tsData.length()); //send out data string legth to ts client.print("\ \ "); client.print(tsData); } else { Serial.println("Unable to connect to server, retry ..."); } delay(4000); // THIS IS CRUTIAL !!!!! client.stop(); Serial.println("Done sending"); } ``` Maybe library could work as well with this delay, but i don't need it anymore :)

Anonymous user

2 years ago

My bad, after restart it doesn't work again .. only 2 times send. Guess ThingSpeak as a platform doesn't work and I am currently looking for alternatives.

Anonymous user

2 years ago

Hi all, I am having trouble updating the certificates to Wifi module using hooks.zapier.com:433. I have checked and updated the firmware version when setting up the MKR1000 board. I keep getting the following messages: - Connection timed out: connect - Upload error: hook.zapier.com - Upload error: arduino.cc Can anyone please offer any help/advice here? Thanks Joe

Anonymous user

2 years ago

Sorted now. Just stuck on Zapier now...Find Data issue, struggling to find a sample.

Anonymous user

2 years ago

Sorted, great project, thanks

Anonymous user

2 years ago

Great project - thanks Arduino! Does anyone know I can change the frequency of the emails from every second to once every 10mins? Thanks

Anonymous user

2 years ago

The 'ProTip: Plot Values Using ThingSpeak' sample code to send data to ThingSpeak is missing the client initialisation in the setup() function. (it's only missing in the 'ProTip: Plot Values Using ThingSpeak' section, it's correct in the 'complete sketch' code) You'll need to add ```ThingSpeak.begin(ThingSpeakClient); ``` to the setup() function

Anonymous user

2 years ago

SORRY, CAN I REPLACE MKR1000 BY ESP8266??

Anonymous user

2 years ago

Amazing Project

Anonymous user

2 years ago

There's a typo in the example code. Line 27 shows as `moistue` rather than `moisture`

Anonymous user

2 years ago

Right I was just going to bring that up again, still is there.

Anonymous user

2 years ago

Hi i am trying this project out and there is a problem. Every time i try to let arduino connect to zapier or other website like zapier, the arduino always said that it failed to send the data any help?

Anonymous user

2 years ago

I have the same problem. Did you resolve your issue ? Thanks

Anonymous user

2 years ago

It always said something like "Failed to connect to cilent"

Anonymous user

2 years ago

Same here, "Failed to connect to cilent"... Any clues? Thanks

Anonymous user

2 years ago

I get an the error message: "ssid" was not declared in the in scope. I am at the "Sending HTTP Request" stage. THere are a couple more that say the same thing... Any help is appreciated. Here's my code: I update it with my WIFI info and custom URL. #include <WiFi101.h> #include<WiFiSSLClient.h> const char* ssid = SECRET_SSID; // your network SSID (name) const char* password = SECRET_PSWD; // your network password String httpsRequest = SECRET_REQUEST; // your Zapier URL const char* host = "hooks.zapier.com"; WiFiSSLClient client; void setup() { Serial.begin(9600); while (!Serial); delay(2000); Serial.print("Connecting Wifi: "); Serial.println(ssid); while (WiFi.begin(ssid, password) != WL_CONNECTED) { Serial.print("."); delay(500); } Serial.println(""); Serial.println("WiFi connected"); } void loop() { float temperature = 22; int moisture = 150; int light = 40; String warning = "This is a warning message"; warning.replace(" ", "%20"); send_email(temperature, moistue, light, warning ); delay(20000) } void send_email(float temperature, int moisture, int light, String warning) { // convert values to String String _temperature = String(temperature); String _moisture = String(moisture); String _light = String(light); String _warning = warning; if (client.connect(host, 443)) { client.println("POST " + httpsRequest + "?temperature=" + _temperature + "&moisture=" + _moisture + "&light=" + _light + "&warning=" + _warning + " HTTP/1.1"); client.println("Host: " + String(host)); client.println("Connection: close"); client.println(); delay(1000); while (client.available()) { // Print on the console the answer of the server char c = client.read(); Serial.write(c); } client.stop(); // Disconnect from the server } else { Serial.println("Failed to connect to client"); } }

Anonymous user

2 years ago

Did anyone ever figure out why the program cannot connect to the client ("Failed to connect to client" error message)?

Anonymous user

2 years ago

Hi Unfortunately I'm stuck while trying to upload the certificates to the wifi module. I get this error: "error while erasing flash memory" Any ideas how to solve this? Thanks!!

Anonymous user

2 years ago

Im stuck in the "sending HTTP request" step. I run the code and the connection succeeds, but it only sends mail to me once, it was supposed to do it every 20s. After that I get no second mail and Serial prints "Failed to connect the client". Any suggestions? Thank you.

Anderson-Bricker

2 years ago

I am also having problems trying to set up the webhook in Zapier. Each time I try to complete the Sample to Set Up Your Zap, after sending the URL request on another fresh webpage, the test always comes back with a “We had trouble finding a sample” message. Additionally, if I add on the extra Arduino request to the Zapier sample URL request given_URL?temperature=0&moisture=0&light=0&warning=0 on a new webpage it comes back with a 404 - error message. I have tried using Google Chrome, Firefox and Explorer and each server has the same problems. Because Arduino is selling this bundled kit, it would be good if their tutorial designers or support resolved some of these obstacles.

Anonymous user

2 years ago

Hi, it works You need to replace "given_URL" with the URL generated by Zapier. the complete string to test in the browser should be like "https://hooks.zapier.com/hooks/catch/BLABLA/BLABLA?temperature=34&moisture=16&light=5&warning=1 " be sure to remove the trailing slash "/" from the url generated by Zapier.

Anonymous user

2 years ago

Have you tried to use a capacitive soil sensor? The "Giesomat" sensor will be your friend. No more metal ions in the soil.

Anonymous user

2 years ago

Assuming is Sense the temperature and the temperature is too much what's going to happen and how to correct it. Please urgently answer

Anonymous user

2 years ago

On ThinkSpeak I receive data only 2 times after I upload the sketch. I want to upload data every minute, the first two minutes are successful, after that my Serial monitor shows "message sent to cloud" every minute but nothing new shows up on TS. I also tried with another sketch that just generates numbers and uploads them on TS to make sure that there is nothing wrong with the sensors that I use in this project. With the sketch that generates random numbers and sends them to TS, I get the same outcome: data is uploaded first and second time, after that nothing. (Both sketches compiled without errors. Instead of using WiFi I also tried to make a hotspot from my phone - doesn't help either.) Thanks for any help!

Anonymous user

2 years ago

Hi, did you resolve this? I have the same problem, both with the ThingSpeak and Zapier I only get it to send twice and then I have to turn it off and on again for anything else to happen

pkosmass

3 years ago

Im stuck in the "sending HTTP request" step. I run the code and the connection succeeds, but it only sends mail to me once, it was supposed to do it every 20s. After that I get no second mail and Serial prints "Failed to connect the client". Any suggestions? Thank you.

solcipanda

3 years ago

me encanto increivle no lo prove pero se ve chevere

Anonymous user

4 years ago

Assuming is Sense the temperature and the temperature is too much what's going to happen and how to correct it. Please urgently answer

Anonymous user

4 years ago

I get an the error message: "ssid" was not declared in the in scope. I am at the "Sending HTTP Request" stage. THere are a couple more that say the same thing... Any help is appreciated. Here's my code: I update it with my WIFI info and custom URL. #include <WiFi101.h> #include<WiFiSSLClient.h> const char* ssid = SECRET_SSID; // your network SSID (name) const char* password = SECRET_PSWD; // your network password String httpsRequest = SECRET_REQUEST; // your Zapier URL const char* host = "hooks.zapier.com"; WiFiSSLClient client; void setup() { Serial.begin(9600); while (!Serial); delay(2000); Serial.print("Connecting Wifi: "); Serial.println(ssid); while (WiFi.begin(ssid, password) != WL_CONNECTED) { Serial.print("."); delay(500); } Serial.println(""); Serial.println("WiFi connected"); } void loop() { float temperature = 22; int moisture = 150; int light = 40; String warning = "This is a warning message"; warning.replace(" ", "%20"); send_email(temperature, moistue, light, warning ); delay(20000) } void send_email(float temperature, int moisture, int light, String warning) { // convert values to String String _temperature = String(temperature); String _moisture = String(moisture); String _light = String(light); String _warning = warning; if (client.connect(host, 443)) { client.println("POST " + httpsRequest + "?temperature=" + _temperature + "&moisture=" + _moisture + "&light=" + _light + "&warning=" + _warning + " HTTP/1.1"); client.println("Host: " + String(host)); client.println("Connection: close"); client.println(); delay(1000); while (client.available()) { // Print on the console the answer of the server char c = client.read(); Serial.write(c); } client.stop(); // Disconnect from the server } else { Serial.println("Failed to connect to client"); } }

Anonymous user

4 years ago

On ThinkSpeak and Zapier I receive data only twice after I upload the sketch. I want to upload data every minute, the first two minutes are successful, after that my Serial monitor shows "message sent to cloud" every minute but nothing new shows up on TS. On Zapier the serial plotter shows failed to connect to client. If I unplug it and start again then I get 2 values before it stops again, please Help!

Anonymous user

2 years ago

Same is happening to me! Any clue?

vecpe

2 years ago

The problem seems to be that client closes before sending message, currently I don't use ThinkSpeak library because it is buggy. Old version works better with added delay ```c #include <WiFi101.h> char server[] = "api.thingspeak.com"; // name address for Google (using DNS) WiFiClient client; const String myWriteAPIKey1 = SECRET_WRITE_API; void SendToThingspeakOld(float temperature, int moisture, int light) { if (client.connect(server, 80)) { Serial.println("Connected to server"); String tsData = "field1=" + (String)light + "&field2=" + (String)moisture + "&field3=" + (String)temperature; client.print(F("POST ")); client.print("/update?key=apiKey&" + tsData); client.print("POST /update HTTP/1.1\ "); client.print("Host: api.thingspeak.com\ "); client.print("Connection: close\ "); client.print("X-THINGSPEAKAPIKEY: " + myWriteAPIKey1 + "\ "); client.print("Content-Type: application/x-www-form-urlencoded\ "); client.print("Content-Length: "); client.print(tsData.length()); //send out data string legth to ts client.print("\ \ "); client.print(tsData); } else { Serial.println("Unable to connect to server, retry ..."); } delay(4000); // THIS IS CRUTIAL !!!!! client.stop(); Serial.println("Done sending"); } ``` Maybe library could work as well with this delay, but i don't need it anymore :)

vecpe

2 years ago

My bad, after restart it doesn't work again .. only 2 times send. Guess ThingSpeak as a platform doesn't work and I am currently looking for alternatives.

Anonymous user

5 years ago

On ThinkSpeak I receive data only 2 times after I upload the sketch. I want to upload data every minute, the first two minutes are successful, after that my Serial monitor shows "message sent to cloud" every minute but nothing new shows up on TS. I also tried with another sketch that just generates numbers and uploads them on TS to make sure that there is nothing wrong with the sensors that I use in this project. With the sketch that generates random numbers and sends them to TS, I get the same outcome: data is uploaded first and second time, after that nothing. (Both sketches compiled without errors. Instead of using WiFi I also tried to make a hotspot from my phone - doesn't help either.) Thanks for any help!

Anonymous user

2 years ago

Hi, did you resolve this? I have the same problem, both with the ThingSpeak and Zapier I only get it to send twice and then I have to turn it off and on again for anything else to happen

Anonymous user

5 years ago

SORRY, CAN I REPLACE MKR1000 BY ESP8266??

Anonymous user

5 years ago

Great project - thanks Arduino! Does anyone know I can change the frequency of the emails from every second to once every 10mins? Thanks

Arduino_Genuino

5 years ago

The Project has been revised with new Zapier screen captures and Skeches fixes to avoid ambiguities. Tested for compilation and full functionalities.

Anonymous user

5 years ago

Hi all, I am having trouble updating the certificates to Wifi module using hooks.zapier.com:433. I have checked and updated the firmware version when setting up the MKR1000 board. I keep getting the following messages: - Connection timed out: connect - Upload error: hook.zapier.com - Upload error: arduino.cc Can anyone please offer any help/advice here? Thanks Joe

Anonymous user

2 years ago

Sorted, great project, thanks

Anonymous user

2 years ago

Sorted now. Just stuck on Zapier now...Find Data issue, struggling to find a sample.

Anonymous user

5 years ago

I finally solved out the message error ("Failed to connect to client" ) There was a little syntax error in the following line: Line with error: client.println("POST " + httpsRequest + "temperature=" + _temperature + "&moisture=" + _moisture + "&light=" + _light + "&warning=" + _warning + " HTTP/1.1"); The character ? was forgotten before temperature ===> so you must write: ?temperature instead of temperature: So the full code line with good syntax is finally: The solution is: client.println("POST " + httpsRequest + "?temperature=" + _temperature + "&moisture=" + _moisture + "&light=" + _light + "&warning=" + _warning + " HTTP/1.1"); httpsRequest is the given url by zapper: example for httpsRequest https://hooks.zapier.com/hooks/catch/55555/66666RI/ This solution worked great for me i hope my solution will help someone

Anonymous user

2 years ago

if there is still an "client connection" message error after you applied the solution: client.println("POST " + httpsRequest + "?temperature=" + _temperature + "&moisture=" + _moisture + "&light=" + _light + "&warning=" + _warning + " HTTP/1.1"); it must be because you did not upload the certificate" hooks.zapier.com:443" Solution : In arduino IDE click===> Tools===>Wifi01 Firmware Updater ===> click Add domain ==>and write hooks.zapier.com:443" Finally ===> click on "Upload the certificated to the Wifi Module" Conclusion: The problem is either a syntax error in the http request or a problem with uploading the ssl certificate to your arduino board

Anonymous user

5 years ago

Did anyone ever figure out why the program cannot connect to the client ("Failed to connect to client" error message)?

Anonymous user

5 years ago

The 'ProTip: Plot Values Using ThingSpeak' sample code to send data to ThingSpeak is missing the client initialisation in the setup() function. (it's only missing in the 'ProTip: Plot Values Using ThingSpeak' section, it's correct in the 'complete sketch' code) You'll need to add ```ThingSpeak.begin(ThingSpeakClient); ``` to the setup() function

Anonymous user

6 years ago

Hi Unfortunately I'm stuck while trying to upload the certificates to the wifi module. I get this error: "error while erasing flash memory" Any ideas how to solve this? Thanks!!

Anderson-Bricker

6 years ago

I am also having problems trying to set up the webhook in Zapier. Each time I try to complete the Sample to Set Up Your Zap, after sending the URL request on another fresh webpage, the test always comes back with a “We had trouble finding a sample” message. Additionally, if I add on the extra Arduino request to the Zapier sample URL request given_URL?temperature=0&moisture=0&light=0&warning=0 on a new webpage it comes back with a 404 - error message. I have tried using Google Chrome, Firefox and Explorer and each server has the same problems. Because Arduino is selling this bundled kit, it would be good if their tutorial designers or support resolved some of these obstacles.

Anonymous user

2 years ago

Hi, it works You need to replace "given_URL" with the URL generated by Zapier. the complete string to test in the browser should be like "https://hooks.zapier.com/hooks/catch/BLABLA/BLABLA?temperature=34&moisture=16&light=5&warning=1 " be sure to remove the trailing slash "/" from the url generated by Zapier.

Aelocf

6 years ago

I Have the Same Error, i can´t connect with zapier. I think because the catch hook does not confirm the test, but I dont know how to close this cicle. My web hook only shows: Here is a sample we‘ve collected so far.Pick 1 to set up your zap Help!

Anonymous user

7 years ago

Have you tried to use a capacitive soil sensor? The "Giesomat" sensor will be your friend. No more metal ions in the soil.

Anonymous user

7 years ago

Yeah, I am also getting the same issue with the Zapier, the "Failed to connect to client" for the wifi hook up is the error message. Let me know if anyone figured it out.

Anonymous user

7 years ago

Is it okay to use Arduino Uno baord for this circuit ?, provided I am not damaging the uno board.

Anonymous user

7 years ago

There's a typo in the example code. Line 27 shows as `moistue` rather than `moisture`

Anonymous user

2 years ago

Right I was just going to bring that up again, still is there.

Anonymous user

7 years ago

This project is great but I am a beginner. I have an issue at the beginning : just after the wifi connection is etablished, I see : "HTTP/1.1 404 Not Found Content-Type: text/html; charset=utf-8 Date: Wed, 09 May 2018 21:47:46 GMT P3P: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT" Response-Id: 5af36c82-2bbd-490f-a527-644410ca40c0 Server: nginx Set-Cookie: zapsession=8t217gvgf81jtes8cfol6tw4mhit9o61; expires=Wed, 16-May-2018 21:47:46 GMT; httponly; Max-Age=604800; Path=/; secure Set-Cookie: zapforeversession=hdp32cpq9t7akq047ox4snb0cdz4mkju; expires=Thu, 09-May-2019 21:47:46 GMT; Max-Age=31536000; Path=/; secure Vary: X-Session-Key X-Frame-Options: SAMEORIGIN X-Session-Key: 8t217gvgf81jtes8cfol6tw4mhit9o61 X-Zapier-Jobs: Woooo, a hacker like yourself should consider working at Zapier! X-Zapier-Jobs-Link: https://zapier.com/blog/help-automate-business-zapier-jobs-and-careers/ X-Zapier-Revision: 8905d3b9f0ffe657fa013a94dce527fb8d65b4d9 Content-Length: 38248 Connection: Close" Could you help me please ? Thanks :)

Anonymous user

2 years ago

I'm receiving the same error. Were you able to resolve the issue?

AliKhan12

7 years ago

Amazing Project

Anonymous user

7 years ago

Hi i am trying this project out and there is a problem. Every time i try to let arduino connect to zapier or other website like zapier, the arduino always said that it failed to send the data any help?

Anonymous user

2 years ago

Same here, "Failed to connect to cilent"... Any clues? Thanks

Anonymous user

2 years ago

I have the same problem. Did you resolve your issue ? Thanks

Anonymous user

2 years ago

It always said something like "Failed to connect to cilent"