Bernard
November 2, 2017, 10:17pm
1
Hi,
I was trying to run the ESP32 example given by bestpika that send millis() to Cayenne and got every time [51] WiFi shield not present
My board is ESP32 exotic Module from China with HW-607 printed on.
I added WiFi.begin(ssid, password) ; and it works
Thank you bestpika
Salutations.
1 Like
adam
November 6, 2017, 1:07am
2
Can you post your sketch? I donβt think Iβve seen anyone get an ESP32 connected yet!
Bernard
November 6, 2017, 10:57am
3
Hi,
I just modified CayenneMQTTESP8266 according bestpika github
Renamed library to CayenneMQTTESP32
Here is my code β¦ Tested milis and a LED switch.
// Tested: China exotic board HW-607
#define CAYENNE_DEBUG
#define CAYENNE_PRINT Serial
#include <CayenneMQTTESP32.h>
//#include <WiFi.h> // finally not necessary
char ssid = ββ;
char wifiPassword = ββ;
// Cayenne authentication info.
char username = βfβ;
char password = ββ;
char clientID = ββ;
unsigned long lastMillis = 0;
void setup()
{
Serial.begin(115200);
pinMode(17, OUTPUT);
WiFi.begin(ssid, password);
Cayenne.begin(username, password, clientID, ssid, wifiPassword);
}
void loop()
{
Cayenne.loop();
if (millis() - lastMillis > 10000)
{
lastMillis = millis();
Cayenne.virtualWrite(0, lastMillis);
}
}
CAYENNE_IN(1)
{
int currentValue = getValue.asInt();
if (currentValue == 1)
{
digitalWrite(17, HIGH);
}
else {
digitalWrite(17, LOW);
}
}
CAYENNE_IN_DEFAULT()
{
CAYENNE_LOG(βCAYENNE_IN_DEFAULT(%u) - %s, %sβ, request.channel, getValue.getId(), getValue.asString());
}
Salutations