Add esp8266

Hi !

I’ve new problem… Again ^^ i want add esp8266, i follow this tutorial ESP8266 IoT Control and Monitor Using Arduino, MQTT, and Cayenne - YouTube , and on mine there is this problem. WHen i verify i have this error :

Arduino : 1.8.9 (Windows 10), Carte : “Generic ESP8266 Module, 80 MHz, Flash, Disabled, All SSL ciphers (most compatible), ck, 26 MHz, 40MHz, DOUT (compatible), 512K (no SPIFFS), 2, nonos-sdk 2.2.1 (legacy), v2 Lower Memory, Disabled, None, Only Sketch, 115200”

mydevices_MQTT:5:13: error: invalid conversion from ‘const char*’ to ‘char’ [-fpermissive]

Some one know why ?

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

Ok it compilation work !

I put code on but cayenne find nothing…

I see esp on wifi

can you add #define CAYENNE_DEBUG in the code and see what is the error in the serial monitor. Share here the output of the serial monitor.

DEBUG is on code, where in find serial monitor ?

[100720] Publish: topic 1, channel 0, value 100719, subkey , key
[109753] Connection ok
[115773] Publish: topic 1, channel 0, value 115773, subkey , key
[119792] Connection ok
[129831] Connection ok
[130834] Publish: topic 1, channel 0, value 130834, subkey , key
[139869] Connection ok
[145889] Publish: topic 1, channel 0, value 145888, subkey , key
17:01:52.090 → [149900] Connection ok
[152213] Disconnected
[152213] Connecting to mqtt.mydevices.com:1883
[156368] Connected
[156511] Publish: topic 4, channel 65534, value Arduino, subkey , key
[156512] Publish: topic 6, channel 65534, value Xtensa32, subkey , key
[156530] Publish: topic 7, channel 65534, value 80000000, subkey , key
[156606] Publish: topic 5, channel 65534, value 1.3.0, subkey , key
[156679] Publish: topic 8, channel 65534, value ESP8266, subkey , key
[160764] Connection ok
[161767] Publish: topic 1, channel 0, value 161766, subkey , key
[170795] Connection ok
[176818] Publish: topic 1, channel 0, value 176818, subkey , key
[180837] Connection ok
[190872] Connection ok
[191876] Publish: topic 1, channel 0, value 191876, subkey , key
[200916] Connection ok
[206935] Publish: topic 1, channel 0, value 206934, subkey , key
[210946] Connection ok
[214257] Disconnected
[214257] Connecting to mqtt.mydevices.com:1883
[214257] Network connect failed
[215258] Network connect failed
[217348] Connected
[217470] Publish: topic 4, channel 65534, value Arduino, subkey , key
[217471] Publish: topic 6, channel 65534, value Xtensa32, subkey , key
[217488] Publish: topic 7, channel 65534, value 80000000, subkey , key
[217564] Publish: topic 5, channel 65534, value 1.3.0, subkey , key
[217637] Publish: topic 8, channel 65534, value ESP8266, subkey , key
[221722] Connection ok
[222725] Publish: topic 1, channel 0, value 222725, subkey , key

can you try adding a new device to cayenne dashboard and get a new MQTT client_id.

Wich devices ? i’ve to re add my raspberry ?

If i add new esp i’ve same id

on your cayenne dashboard go to:
add new -----> devices/widgets -----> click on arduino -----> copy the MQTT client_id -----> replace it in the code ----> upload the code -----> check serial monitor.

ok, like this it work, but i’ve same possibility than i choose esp device ?

what do you mean by this?

i don’t know, but i have ESP but on my devices list it’s writen arduino and not esp8266 maybe it’s can be problem ?

if it is working with arduino, dont do anything. You can delete the old esp device from cayenne dashboard.

ok, and one last questions, what’s the widget wich appareid by default ? it say channel 0 with this value : 1061599.00

and how i can add new widget on, if i want control relay for example, when i choose on arduino there’s no channel number. I have to write d1 for channel d1 ?

In the code, search for this function:

CAYENNE_OUT_DEFAULT()
{
	// Write data to Cayenne here. This example just sends the current uptime in milliseconds on virtual channel 0.
	Cayenne.virtualWrite(0, millis());
	// Some examples of other functions you can use to send data.
	//Cayenne.celsiusWrite(1, 22.0);
	//Cayenne.luxWrite(2, 700);
	//Cayenne.virtualWrite(3, 50, TYPE_PROXIMITY, UNIT_CENTIMETER);
}

this function publishes data (millis()) to cayenne on channel number 0.

Have a look at this topic to get started with cayenne Adding a New Device using MQTT and also go the through entire docs Cayenne Docs

i read all but i don’t find reponse… If i want put relay, i choose arduino, relay and i have to put channel but i can write what i want…

I don’t understand what y have to do for turn on or off pin D5.

I read on code one pin is high or low but wich pin on esp ?!

did you check the Step 5 : Adding a Actuator. in the link?

Yap but after button creation i don’t understand what i have to do