Connecting Heltec Wifi Kit 8


trying to connect my Heltec Wifi Kit 8 to Cayenne Cloud using PlatfirmIO.

Device is connected to network but connecting to cayenne fails with “Network connect failed” message

Connecting to Cayenne via MQTT Client Software (MQTTfx) works fine so im sure all my configurations are ok (Username, password, client ID)

Any Ideas what i can check to get this work.

Which code you are using ??


#define CAYENNE_PRINT Serial
#include <CayenneMQTTESP8266.h>

// WiFi network info.
char ssid = “xxxx”;
char wifiPassword = “xxxxx”;

// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username = “xxxx”;
char password = “xxxx”;
char clientID = “xxxx”;

void MQTTsetup() {

void MQTTloop() {

Is hrltec wifi kit based on esp8266? Can you share any link on the device drivers docs.

yes im quite sure it is

Can you try this code Cayenne-MQTT-Arduino/ESP8266.ino at master · myDevicesIoT/Cayenne-MQTT-Arduino · GitHub

This one throws some errors. maybe u can give me a hint whats wrong

In file included from C:\Users\admin.platformio\lib\Cayenne-MQTT-ESP_ID1451\src/CayenneArduinoDefines.h:130:0,
from C:\Users\admin.platformio\lib\Cayenne-MQTT-ESP_ID1451\src/CayenneArduinoMQTTClient.h:21,
from C:\Users\admin.platformio\lib\Cayenne-MQTT-ESP_ID1451\src/CayenneMQTTWiFiClient.h:21,
from C:\Users\admin.platformio\lib\Cayenne-MQTT-ESP_ID1451\src/CayenneMQTTESP8266.h:23,
from src\CayenneMQTT.cpp:63:
C:\Users\admin.platformio\lib\Cayenne-MQTT-ESP_ID1451\src/DetectDevice.h:234:10: warning: #warning “Cannot detect board type” [-Wcpp]
#warning “Cannot detect board type”
In file included from C:\Users\admin.platformio\lib\Cayenne-MQTT-ESP_ID1451\src/CayenneMQTTWiFiClient.h:21:0,
from C:\Users\admin.platformio\lib\Cayenne-MQTT-ESP_ID1451\src/CayenneMQTTESP8266.h:23,
from src\CayenneMQTT.cpp:63:
C:\Users\admin.platformio\lib\Cayenne-MQTT-ESP_ID1451\src/CayenneArduinoMQTTClient.h: In member function ‘void CayenneArduinoMQTTClient::connect()’:
C:\Users\admin.platformio\lib\Cayenne-MQTT-ESP_ID1451\src/CayenneArduinoMQTTClient.h:58:63: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
if (!NetworkConnect(&_network, CAYENNE_DOMAIN, CAYENNE_PORT)) {
In file included from C:\Users\admin.platformio\lib\Cayenne-MQTT-ESP_ID1451\src/CayenneMQTTESP8266.h:23:0,
from src\CayenneMQTT.cpp:63:
C:\Users\admin.platformio\lib\Cayenne-MQTT-ESP_ID1451\src/CayenneMQTTWiFiClient.h: In member function ‘void CayenneMQTTWiFiClient::begin(const char*, const char*, const char*, const char*, const char*)’:
C:\Users\admin.platformio\lib\Cayenne-MQTT-ESP_ID1451\src/CayenneMQTTWiFiClient.h:41:7: warning: unused variable ‘status’ [-Wunused-variable]
int status = WL_IDLE_STATUS;
Linking .pio\build\heltec_wifi_kit_8\firmware.elf
c:/users/admin/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/4.8.2/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\heltec_wifi_kit_8\src\main.cpp.o: in function setup': main.cpp:(.text.setup+0x38): multiple definition of setup’; .pio\build\heltec_wifi_kit_8\src\CayenneMQTT.cpp.o:CayenneMQTT.cpp:(.text.setup+0x28): first defined here
c:/users/admin/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/4.8.2/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\heltec_wifi_kit_8\src\main.cpp.o: in function loop': main.cpp:(.text.loop+0x18): multiple definition of loop’; .pio\build\heltec_wifi_kit_8\src\CayenneMQTT.cpp.o:CayenneMQTT.cpp:(.text.loop+0x8): first defined here
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\heltec_wifi_kit_8\firmware.elf] Error 1

This issue is because the device is not listed in detect device list. Let me check what can be done.

1 Like

the only difference from ur code to mine ist that u have 2 parameters more in begin function.
Why is there a failure then cause of missing board?

Cayenne.begin(username, password, clientID, ssid, wifiPassword);

Any ideas already?

Are you using platformio?

Yes I do

i am not sure if that is what producing the error, but is that board compatible with arduino IDE?

I already did a few other projects with this board… So I think it works

can you try the above code with the arduino IDE.

same here

can you try some example sketches and see if you can get data via TCP, like from Google or something.
If that works you might try a simple example MQTT sketch with some third party MQTT broker and see if that works.

Meanwhile i bougt an ESP32 and this works fine. So Thread can be closed.

Thank u for ur support.

1 Like

That’s a better alternative.