0

so I am new to arduino and coding in general, I am trying to use the arduino to remotely survey plants, I am using this guide: https://create.arduino.cc/projecthub/arduino/plant-communicator-7ea06f. The entire code is:

#include <WiFi101.h>
#include<WiFiSSLClient.h>
const char* ssid = SKY1C9D0;    //  your network SSID (name)
const char* password = SYDTSTQR;  // your network password
String httpsRequest = https://hooks.zapier.com/hooks/catch/2821422/84ehn1/;     
// 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");
 }
}

The error is specifically highlighted here: const char* ssid = SECRET_SSID; // your network SSID (name). The error is that the ssid has not been declared. I am unsure of what to do to fix this and any other possible errors that have gone unnoticed. I would highly appreciate any help or guidance. Thank you

7
  • 1
    const char* ssid = "myAP"; and const char* password = "myAP passworld"; is not working? You have to REPLACE it with correct credentials.
    – KIIV
    Commented Dec 25, 2017 at 17:06
  • I have tried using correct credentials, still does not work, I removed credentials only so I could post the code online
    – user41174
    Commented Dec 25, 2017 at 17:16
  • Also the httpsRequest have to be a string, you can't just put the https address like this.
    – KIIV
    Commented Dec 25, 2017 at 17:20
  • have you replaced SECRET_SSID with the actual SSID or defined a value for a variable SECRET_SSID? The error seems to be saying that SECRET_SSID is not defined or declared so the compiler doesn't know what that text is. This looks like C so is there a #define missing? Commented Dec 25, 2017 at 17:21
  • I have now edited it with the actual ssid and password, it still does not work
    – user41174
    Commented Dec 25, 2017 at 17:23

2 Answers 2

1

A problem in the include file on the line previous could cause the following line to be misinterpreted. To test that try moving the ssid after the password and see if the error changes. Obviously make sure all strings are properly quoted.

#include <WiFi101.h>
#include <WiFiSSLClient.h>

const char* password = "SYDTSTQR";  // your network password
const char* ssid = "SKY1C9D0";    //  your network SSID (name)
String httpsRequest = "https://hooks.zapier.com/hooks/catch/2821422/84ehn1/";
0

You need quotes around literal string values.

const char* ssid = "SKY1C9D0" ; // your network SSID (name)
const char* password = "SYDTSTQR" ;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.