Arduino w/Sparkfun WiFi shield will not connect


#1

My Arduino Uno with Sparkfun ESP8266 WiFi shield will not connect to the Cayenne web dashboard. The Arduino sketch (downloaded from Cayenne) sends a message to the serial port: “WiFi shield not present”. No compile errors or warnings and I believe all appropriate libraries are in place. The Arduino/Shield works fine with Sparkfun examples. Also the Cayenne web dashboard works fine with my Raspberry Pi.

Any help would be appreciated.

John


#2

you have to use software serial for arduino uno. can you post the code you are using.


#3

Thanks for the quick reply. Here is the sketch.

The esp8266.begin function returns good status. The cayenne.begin function returns “WiFi shield not present”. I couldn’t find any software serial selection on the cayenne website; only hardware which I don’t want to use so I can use the arduino debug monitor.

/*
Cayenne WiFi Example

This sketch connects to the Cayenne server using an Arduino WiFi shield
and runs the main communication loop.

The Cayenne Library is required to run this sketch. If you have not already done so you can install it from the Arduino IDE Library Manager.

Steps:
1. Set the token variable to match the Arduino token from the Dashboard.
2. Set the network name and password.
3. Compile and upload this sketch.

For Cayenne Dashboard widgets using digital or analog pins this sketch will automatically
send data on those pins to the Cayenne server. If the widgets use Virtual Pins, data
should be sent to those pins using virtualWrites. Examples for sending and receiving
Virtual Pin data are under the Basics folder.
*/

#include <SoftwareSerial.h> // Include software serial library, ESP8266 library dependency
#include <SparkFunESP8266WiFi.h> // Include the ESP8266 AT library

#define CAYENNE_DEBUG         // Uncomment to show debug messages
#define CAYENNE_PRINT Serial  // Comment this out to disable prints and save space
#include <CayenneWiFi.h>

// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token[] = "xxxxxxx";
// Your network name and password.
char ssid[] = "yyyyy";
char password[] = "zzzzzz";

void setup()
{
  Serial.begin(9600);
if (esp8266.begin()) // Initialize the ESP8266 and check it's return status
    Serial.println("ESP8266 ready to go!"); // Communication and setup successful
else
    Serial.println("Unable to communicate with the ESP8266 :(");

  Serial.println("Calling Cayenne.begin fcn");
  Cayenne.begin(token, ssid, password);
}

void loop()
{
  Cayenne.run();
}

#4

Sorry - the second void.loop is a typo & not in the sketch.


#5

Have a look at this thread New Cayenne Support: ESP8266 as a WiFi Shield!


#6

Thanks, that may work altho I’m not sure of the hardware serial comment in the sketch. I do want to use software serial for the communication to the WiFi shield board so the arduino serial monitor can be used for debug. Is there an arduino sketch to use for communication to the Cayenne dashboard with this configuration? I didn’t see one.


#7

Sorry, I it’s not possible right now unless you go with an Arduino Mega.


#8

Thanks, just as I suspected. I’m using an UNO which does not have the extra RxTx pins. I think I’ll try something else, either Photon or Sparkfun Thing.