mymqtt not defined

8 years 3 months ago #3471 by alyons12
mymqtt not defined was created by alyons12
ok so i did the easiot could switch loaded the file for mqtt. tried three times removing file and such and still getting myMqtt not named when i compile

Arduino: 1.6.11 (Windows 7), Board: "Adafruit HUZZAH ESP8266, 80 MHz, 115200, 4M (3M SPIFFS)"

switch2:27: error: 'MQTT' does not name a type

MQTT myMqtt("", EIOT_CLOUD_ADDRESS, 1883);

^

C:\Users\Andy\Documents\Arduino\switch2\switch2.ino: In function 'String macToStr(const uint8_t*)':

switch2:80: error: call of overloaded 'String(const uint8_t*&, int)' is ambiguous

result += String(mac, 16);

^

C:\Users\Andy\Documents\Arduino\switch2\switch2.ino:80:29: note: candidates are:

In file included from C:\Users\Andy\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Arduino.h:243:0,

from sketch\switch2.ino.cpp:1:

C:\Users\Andy\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.h:68:18: note: String::String(long unsigned int, unsigned char) <near match>

explicit String(unsigned long, unsigned char base = 10);

^

C:\Users\Andy\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.h:68:18: note: no known conversion for argument 1 from 'const uint8_t* {aka const unsigned char*}' to 'long unsigned int'

C:\Users\Andy\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.h:67:18: note: String::String(long int, unsigned char) <near match>

explicit String(long, unsigned char base = 10);

^

C:\Users\Andy\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.h:67:18: note: no known conversion for argument 1 from 'const uint8_t* {aka const unsigned char*}' to 'long int'

C:\Users\Andy\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.h:66:18: note: String::String(unsigned int, unsigned char) <near match>

explicit String(unsigned int, unsigned char base = 10);

^

C:\Users\Andy\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.h:66:18: note: no known conversion for argument 1 from 'const uint8_t* {aka const unsigned char*}' to 'unsigned int'

C:\Users\Andy\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.h:65:18: note: String::String(int, unsigned char) <near match>

explicit String(int, unsigned char base = 10);

^

C:\Users\Andy\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.h:65:18: note: no known conversion for argument 1 from 'const uint8_t* {aka const unsigned char*}' to 'int'

C:\Users\Andy\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.h:64:18: note: String::String(unsigned char, unsigned char) <near match>

explicit String(unsigned char, unsigned char base = 10);

^

C:\Users\Andy\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.h:64:18: note: no known conversion for argument 1 from 'const uint8_t* {aka const unsigned char*}' to 'unsigned char'

C:\Users\Andy\Documents\Arduino\switch2\switch2.ino: In function 'void myConnectedCb()':

switch2:96: error: 'myMqtt' was not declared in this scope

myMqtt.subscribe("/Db/" + instanceId + "/" + String(storage.moduleId) + "/Sensor.Parameter1");

^

C:\Users\Andy\Documents\Arduino\switch2\switch2.ino: In function 'void myDisconnectedCb()':

switch2:104: error: 'myMqtt' was not declared in this scope

myMqtt.connect();

^

C:\Users\Andy\Documents\Arduino\switch2\switch2.ino: In function 'void setup()':

switch2:207: error: 'myMqtt' was not declared in this scope

myMqtt.setClientId((char*) clientName.c_str());

^

C:\Users\Andy\Documents\Arduino\switch2\switch2.ino: In function 'void loop()':

switch2:298: error: 'myMqtt' was not declared in this scope

result = myMqtt.publish(topic, valueStr);

^

exit status 1
'MQTT' does not name a type

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Please Log in or Create an account to join the conversation.

8 years 3 months ago #3473 by alyons12
Replied by alyons12 on topic mymqtt not defined
ok forget that last post got that to go away now i have this

Arduino: 1.6.11 (Windows 7), Board: "Adafruit HUZZAH ESP8266, 80 MHz, 115200, 4M (3M SPIFFS)"

C:\Users\Andy\Documents\Arduino\switch2\switch2.ino: In function 'String macToStr(const uint8_t*)':

switch2:70: error: call of overloaded 'String(const uint8_t*&, int)' is ambiguous

result += String(mac, 16);

^

C:\Users\Andy\Documents\Arduino\switch2\switch2.ino:70:29: note: candidates are:

In file included from C:\Users\Andy\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Arduino.h:243:0,

from sketch\switch2.ino.cpp:1:

C:\Users\Andy\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.h:68:18: note: String::String(long unsigned int, unsigned char) <near match>

explicit String(unsigned long, unsigned char base = 10);

^

C:\Users\Andy\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.h:68:18: note: no known conversion for argument 1 from 'const uint8_t* {aka const unsigned char*}' to 'long unsigned int'

C:\Users\Andy\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.h:67:18: note: String::String(long int, unsigned char) <near match>

explicit String(long, unsigned char base = 10);

^

C:\Users\Andy\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.h:67:18: note: no known conversion for argument 1 from 'const uint8_t* {aka const unsigned char*}' to 'long int'

C:\Users\Andy\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.h:66:18: note: String::String(unsigned int, unsigned char) <near match>

explicit String(unsigned int, unsigned char base = 10);

^

C:\Users\Andy\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.h:66:18: note: no known conversion for argument 1 from 'const uint8_t* {aka const unsigned char*}' to 'unsigned int'

C:\Users\Andy\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.h:65:18: note: String::String(int, unsigned char) <near match>

explicit String(int, unsigned char base = 10);

^

C:\Users\Andy\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.h:65:18: note: no known conversion for argument 1 from 'const uint8_t* {aka const unsigned char*}' to 'int'

C:\Users\Andy\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.h:64:18: note: String::String(unsigned char, unsigned char) <near match>

explicit String(unsigned char, unsigned char base = 10);

^

C:\Users\Andy\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.h:64:18: note: no known conversion for argument 1 from 'const uint8_t* {aka const unsigned char*}' to 'unsigned char'

exit status 1
call of overloaded 'String(const uint8_t*&, int)' is ambiguous

Please Log in or Create an account to join the conversation.

8 years 3 months ago #3476 by alyons12
Replied by alyons12 on topic mymqtt not defined
arg :evil: got it to compile and load ......gets on to mqtt server logs in and every thing but........switch has not shown up on web interface

Please Log in or Create an account to join the conversation.

6 years 1 month ago #3995 by precise
Replied by precise on topic mymqtt not defined
I am having the same issue. How could you managed to solve it? Please advice me the solution.
Thanks

Please Log in or Create an account to join the conversation.

Time to create page: 0.224 seconds

Forum latest

  • No posts to display.