Heltec ESP32 WiFi with OLED screen

Hey everybody,

Looking for someone who has done some work with an esp32 wifi dev board. I cant get the simple code for mqtt to compile. I get error compiling for board heltec_wifi_kit_32. This is new territory for me. Just trying to connect for now.

Thanks,
William

#include <WiFiEsp.h>
#include <WiFiEspClient.h>
#include <WiFiEspServer.h>
#include <WiFiEspUdp.h>

#include <CayenneArduinoDefines.h>
#include <CayenneArduinoMQTTClient.h>
#include <CayenneHandlers.h>
#include <CayenneMessage.h>
//#include <CayenneMQTTEthernet.h>
//#include <CayenneMQTTEthernetClient.h>
//#include <CayenneMQTTEthernetW5200.h>
//#include <CayenneMQTTEthernetW5500.h>
#include <CayenneMQTTWiFi.h>
//#include <CayenneMQTTWiFi101.h>
#include <CayenneMQTTWiFiClient.h>
#include <CayenneMQTTYun.h>
#include <CayenneMQTTYunClient.h>
#include <DetectDevice.h>
#include <dummy.h>
#include <CayenneESP8266Shield.h>

char username = “0fd05b20-a6c5-11e6-839f-8b”;
char password = “e3d25bad21a57e27ccc6b081a76cb”;
char clientID = “9ac12a70-a89a-11e7-b177-”;
char ssid = “free”;
char password = “”;

void setup() {
// put your setup code here, to run once:

EspSerial.begin(115200);
Cayenne.begin(ssid,password);
delay(4000)
Cayenne.begin(username,password,clientID);
}

void loop() {
// put your main code here, to run repeatedly:

}

Arduino: 1.8.1 (Windows 10), Board: “Heltec_WIFI_Kit_32, 80MHz, 512000”

Build options changed, rebuilding all
C:\Users\Pancho\Documents\Arduino\libraries\arduino_716846\src\utility\EspDrv.cpp:20:26: fatal error: avr/pgmspace.h: No such file or directory

compilation terminated.

Multiple libraries were found for “CayenneArduinoDefines.h”
Used: C:\Users\Pancho\Documents\Arduino\libraries\arduino_90267
Not used: C:\Users\Pancho\Documents\Arduino\libraries\Cayenne-MQTT-Arduino
Not used: C:\Users\Pancho\Documents\Arduino\libraries\Cayenne-MQTT-Arduino
Not used: C:\Users\Pancho\Documents\Arduino\libraries\Cayenne-MQTT-Arduino
Not used: C:\Users\Pancho\Documents\Arduino\libraries\Cayenne-MQTT-Arduino
Multiple libraries were found for “WiFi.h”
Used: C:\Users\Pancho\Documents\Arduino\hardware\espressif\esp32\libraries\WiFi
Not used: C:\Program Files (x86)\Arduino\libraries\WiFi
exit status 1
Error compiling for board Heltec_WIFI_Kit_32.
Invalid library found in C:\Users\Pancho\Documents\Arduino\libraries\Cayenne-MQTT-mbed: C:\Users\Pancho\Documents\Arduino\libraries\Cayenne-MQTT-mbed
Invalid library found in C:\Users\Pancho\Documents\Arduino\libraries\OLED-128x64-ssd1306-SPI-Tests: C:\Users\Pancho\Documents\Arduino\libraries\OLED-128x64-ssd1306-SPI-Tests
Invalid library found in C:\Users\Pancho\Documents\Arduino\libraries\Cayenne-MQTT-mbed: C:\Users\Pancho\Documents\Arduino\libraries\Cayenne-MQTT-mbed
Invalid library found in C:\Users\Pancho\Documents\Arduino\libraries\OLED-128x64-ssd1306-SPI-Tests: C:\Users\Pancho\Documents\Arduino\libraries\OLED-128x64-ssd1306-SPI-Tests

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

1 Like

Good to see you again @wmontg5988 !

@eptak any ideas ?

~B

I’m getting closer. I’m not sure how to connect wifi first then MQTT user, pass, id.

char username = “0fd05b20-a6c5-11e6-839f-676”;
char password = “e3d25bad21a57e27ce0d13c2d99”;
char clientID = “9ac12a70-a89a-179293954599”;
char ssid = “free”;
char password //getting redefinition error. need a way to differentiate the 2.

BTW I successfully loaded wifiscan sketch so I’m past the compile for board problem

William

update: changed sketch

char username = “0fd05b20-a6c5-11e6-839f-8bfd46afe676”;
char password2 = “e3d25bad21a57e27ccc6b081a76cb0e0d13c2d99”;
char clientID = “9ac12a70-a89a-11e7-b177-579293954599”;
char ssid = “free”;
char password1 = “”;

void setup() {
// put your setup code here, to run once:

Serial.begin(115200);
Cayenne.begin(ssid,password1,username,password2,clientID);

And then error compiling again? Shall I copy paste the error? it’s quite long

Did you install the board in the IDE? GitHub - espressif/arduino-esp32: Arduino core for the ESP32

@eptak may be able to give some advice on how to connect ESP32 to Cayenne. We just receive some of these boards so we’ll be testing them soon :slight_smile:

In the meantime, please let us know if you make some progress!

The board does come up on the list as heltec esp-32 and esp-32 dev board seems to works as well for simple non-cayenne examples. I feel like every time I try that I get a little closer. Some files I have found needed to be commented out of a library when there was no source available on github or the net. Like hash.h being the only one I can’t find anywhere. Waiting with baited breath for some news on your esp-32 ventures

William

I’m flagging this thread. I’ll give you some update soon.

1 Like

Hi there @eptak,

Got the following message on compiling. Not sure why, because that file is in the directory mentioned in the error message. If I knew what was calling for that file I might get a better sense of finding out if it’s really necessary. I have commented out lines in libraries that are legacy .h files and not needed anyway. This file is found in espressif / arduino-esp32 on github

Thanks

Arduino: 1.8.4 (Windows 10), Board: “Heltec_WIFI_Kit_32, 80MHz, 921600”

Build options changed, rebuilding all
exec: “C:\Users\pancho\Documents\Arduino\hardware\arduino\arduino-esp32-master/tools/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++”: file does not exist
Error compiling for board Heltec_WIFI_Kit_32.

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.