Sever44
Member
Добрый день.
Использую W7, Arduino 1.8.2 b Witty Cloud.
Пытался использовать скетчи для общения с CloudMQTT.
Например такие:
Нужна помощь - Библиотека PubSubClient
Esp8266 управление через интернет по протоколу MQTT
ESP8266 programming for Cloud MQTT using Pubsubclient- Part 3 - CodeKrypt
esp8266-pubsubclient-cloudmqtt/esp8266-mqtt-pubsubclient.ino at master · arjunsk/esp8266-pubsubclient-cloudmqtt · GitHub
помогите "подружить" ESP и arduino | Аппаратная платформа Arduino
Во всех присутствуют строки:
WiFiClient wclient;
PubSubClient client(wclient, mqtt_server, mqtt_port);
При проверке скетча ругается (библиотека PubSubClient версия 2.5 установлена).
Прошу помочь!
Использую W7, Arduino 1.8.2 b Witty Cloud.
Пытался использовать скетчи для общения с CloudMQTT.
Например такие:
Нужна помощь - Библиотека PubSubClient
Esp8266 управление через интернет по протоколу MQTT
ESP8266 programming for Cloud MQTT using Pubsubclient- Part 3 - CodeKrypt
esp8266-pubsubclient-cloudmqtt/esp8266-mqtt-pubsubclient.ino at master · arjunsk/esp8266-pubsubclient-cloudmqtt · GitHub
помогите "подружить" ESP и arduino | Аппаратная платформа Arduino
Во всех присутствуют строки:
WiFiClient wclient;
PubSubClient client(wclient, mqtt_server, mqtt_port);
При проверке скетча ругается (библиотека PubSubClient версия 2.5 установлена).
Прошу помочь!
MQTT_2:26: error: no matching function for call to 'PubSubClient:ubSubClient(WiFiClient&, const char*&, const int&)'
PubSubClient client(wclient, mqtt_server, mqtt_port);
^
C:\Users\Rivex\Documents\Arduino\My_Project\MQTT\MQTT_2\MQTT_2.ino:26:52: note: candidates are:
In file included from C:\Users\Rivex\Documents\Arduino\My_Project\MQTT\MQTT_2\MQTT_2.ino:2:0:
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:116:4: note: PubSubClient:ubSubClient(const char*, uint16_t, std::function<void(char*, unsigned char*, unsigned int)>, Client&, Stream&)
PubSubClient(const char*, uint16_t, MQTT_CALLBACK_SIGNATURE,Client& client, Stream&);
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:116:4: note: candidate expects 5 arguments, 3 provided
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:115:4: note: PubSubClient:ubSubClient(const char*, uint16_t, std::function<void(char*, unsigned char*, unsigned int)>, Client&)
PubSubClient(const char*, uint16_t, MQTT_CALLBACK_SIGNATURE,Client& client);
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:115:4: note: candidate expects 4 arguments, 3 provided
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:114:4: note: PubSubClient:ubSubClient(const char*, uint16_t, Client&, Stream&)
PubSubClient(const char*, uint16_t, Client& client, Stream&);
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:114:4: note: candidate expects 4 arguments, 3 provided
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:113:4: note: PubSubClient:ubSubClient(const char*, uint16_t, Client&)
PubSubClient(const char*, uint16_t, Client& client);
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:113:4: note: no known conversion for argument 1 from 'WiFiClient' to 'const char*'
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:112:4: note: PubSubClient:ubSubClient(uint8_t*, uint16_t, std::function<void(char*, unsigned char*, unsigned int)>, Client&, Stream&)
PubSubClient(uint8_t *, uint16_t, MQTT_CALLBACK_SIGNATURE,Client& client, Stream&);
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:112:4: note: candidate expects 5 arguments, 3 provided
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:111:4: note: PubSubClient:ubSubClient(uint8_t*, uint16_t, std::function<void(char*, unsigned char*, unsigned int)>, Client&)
PubSubClient(uint8_t *, uint16_t, MQTT_CALLBACK_SIGNATURE,Client& client);
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:111:4: note: candidate expects 4 arguments, 3 provided
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:110:4: note: PubSubClient:ubSubClient(uint8_t*, uint16_t, Client&, Stream&)
PubSubClient(uint8_t *, uint16_t, Client& client, Stream&);
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:110:4: note: candidate expects 4 arguments, 3 provided
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:109:4: note: PubSubClient:ubSubClient(uint8_t*, uint16_t, Client&)
PubSubClient(uint8_t *, uint16_t, Client& client);
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:109:4: note: no known conversion for argument 1 from 'WiFiClient' to 'uint8_t* {aka unsigned char*}'
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:108:4: note: PubSubClient:ubSubClient(IPAddress, uint16_t, std::function<void(char*, unsigned char*, unsigned int)>, Client&, Stream&)
PubSubClient(IPAddress, uint16_t, MQTT_CALLBACK_SIGNATURE,Client& client, Stream&);
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:108:4: note: candidate expects 5 arguments, 3 provided
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:107:4: note: PubSubClient:ubSubClient(IPAddress, uint16_t, std::function<void(char*, unsigned char*, unsigned int)>, Client&)
PubSubClient(IPAddress, uint16_t, MQTT_CALLBACK_SIGNATURE,Client& client);
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:107:4: note: candidate expects 4 arguments, 3 provided
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:106:4: note: PubSubClient:ubSubClient(IPAddress, uint16_t, Client&, Stream&)
PubSubClient(IPAddress, uint16_t, Client& client, Stream&);
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:106:4: note: candidate expects 4 arguments, 3 provided
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:105:4: note: PubSubClient:ubSubClient(IPAddress, uint16_t, Client&)
PubSubClient(IPAddress, uint16_t, Client& client);
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:105:4: note: no known conversion for argument 1 from 'WiFiClient' to 'IPAddress'
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:104:4: note: PubSubClient:ubSubClient(Client&)
PubSubClient(Client& client);
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:104:4: note: candidate expects 1 argument, 3 provided
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:103:4: note: PubSubClient:ubSubClient()
PubSubClient();
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:103:4: note: candidate expects 0 arguments, 3 provided
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:83:7: note: PubSubClient:ubSubClient(const PubSubClient&)
class PubSubClient {
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:83:7: note: candidate expects 1 argument, 3 provided
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:83:7: note: PubSubClient:ubSubClient(PubSubClient&&)
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:83:7: note: candidate expects 1 argument, 3 provided
C:\Users\Rivex\Documents\Arduino\My_Project\MQTT\MQTT_2\MQTT_2.ino: In function 'void loop()':
MQTT_2:57: error: 'MQTT' has not been declared
if (client.connect(MQTT::Connect("arduinoClient1")
^
MQTT_2:60: error: 'class PubSubClient' has no member named 'set_callback'
client.set_callback(callback);
^
MQTT_2:60: error: 'callback' was not declared in this scope
client.set_callback(callback);
^
exit status 1
no matching function for call to 'PubSubClient:ubSubClient(WiFiClient&, const char*&, const int&)'
PubSubClient client(wclient, mqtt_server, mqtt_port);
^
C:\Users\Rivex\Documents\Arduino\My_Project\MQTT\MQTT_2\MQTT_2.ino:26:52: note: candidates are:
In file included from C:\Users\Rivex\Documents\Arduino\My_Project\MQTT\MQTT_2\MQTT_2.ino:2:0:
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:116:4: note: PubSubClient:ubSubClient(const char*, uint16_t, std::function<void(char*, unsigned char*, unsigned int)>, Client&, Stream&)
PubSubClient(const char*, uint16_t, MQTT_CALLBACK_SIGNATURE,Client& client, Stream&);
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:116:4: note: candidate expects 5 arguments, 3 provided
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:115:4: note: PubSubClient:ubSubClient(const char*, uint16_t, std::function<void(char*, unsigned char*, unsigned int)>, Client&)
PubSubClient(const char*, uint16_t, MQTT_CALLBACK_SIGNATURE,Client& client);
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:115:4: note: candidate expects 4 arguments, 3 provided
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:114:4: note: PubSubClient:ubSubClient(const char*, uint16_t, Client&, Stream&)
PubSubClient(const char*, uint16_t, Client& client, Stream&);
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:114:4: note: candidate expects 4 arguments, 3 provided
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:113:4: note: PubSubClient:ubSubClient(const char*, uint16_t, Client&)
PubSubClient(const char*, uint16_t, Client& client);
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:113:4: note: no known conversion for argument 1 from 'WiFiClient' to 'const char*'
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:112:4: note: PubSubClient:ubSubClient(uint8_t*, uint16_t, std::function<void(char*, unsigned char*, unsigned int)>, Client&, Stream&)
PubSubClient(uint8_t *, uint16_t, MQTT_CALLBACK_SIGNATURE,Client& client, Stream&);
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:112:4: note: candidate expects 5 arguments, 3 provided
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:111:4: note: PubSubClient:ubSubClient(uint8_t*, uint16_t, std::function<void(char*, unsigned char*, unsigned int)>, Client&)
PubSubClient(uint8_t *, uint16_t, MQTT_CALLBACK_SIGNATURE,Client& client);
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:111:4: note: candidate expects 4 arguments, 3 provided
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:110:4: note: PubSubClient:ubSubClient(uint8_t*, uint16_t, Client&, Stream&)
PubSubClient(uint8_t *, uint16_t, Client& client, Stream&);
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:110:4: note: candidate expects 4 arguments, 3 provided
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:109:4: note: PubSubClient:ubSubClient(uint8_t*, uint16_t, Client&)
PubSubClient(uint8_t *, uint16_t, Client& client);
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:109:4: note: no known conversion for argument 1 from 'WiFiClient' to 'uint8_t* {aka unsigned char*}'
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:108:4: note: PubSubClient:ubSubClient(IPAddress, uint16_t, std::function<void(char*, unsigned char*, unsigned int)>, Client&, Stream&)
PubSubClient(IPAddress, uint16_t, MQTT_CALLBACK_SIGNATURE,Client& client, Stream&);
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:108:4: note: candidate expects 5 arguments, 3 provided
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:107:4: note: PubSubClient:ubSubClient(IPAddress, uint16_t, std::function<void(char*, unsigned char*, unsigned int)>, Client&)
PubSubClient(IPAddress, uint16_t, MQTT_CALLBACK_SIGNATURE,Client& client);
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:107:4: note: candidate expects 4 arguments, 3 provided
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:106:4: note: PubSubClient:ubSubClient(IPAddress, uint16_t, Client&, Stream&)
PubSubClient(IPAddress, uint16_t, Client& client, Stream&);
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:106:4: note: candidate expects 4 arguments, 3 provided
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:105:4: note: PubSubClient:ubSubClient(IPAddress, uint16_t, Client&)
PubSubClient(IPAddress, uint16_t, Client& client);
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:105:4: note: no known conversion for argument 1 from 'WiFiClient' to 'IPAddress'
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:104:4: note: PubSubClient:ubSubClient(Client&)
PubSubClient(Client& client);
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:104:4: note: candidate expects 1 argument, 3 provided
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:103:4: note: PubSubClient:ubSubClient()
PubSubClient();
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:103:4: note: candidate expects 0 arguments, 3 provided
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:83:7: note: PubSubClient:ubSubClient(const PubSubClient&)
class PubSubClient {
^
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:83:7: note: candidate expects 1 argument, 3 provided
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:83:7: note: PubSubClient:ubSubClient(PubSubClient&&)
C:\Users\Rivex\Documents\Arduino\libraries\PubSubClient\src/PubSubClient.h:83:7: note: candidate expects 1 argument, 3 provided
C:\Users\Rivex\Documents\Arduino\My_Project\MQTT\MQTT_2\MQTT_2.ino: In function 'void loop()':
MQTT_2:57: error: 'MQTT' has not been declared
if (client.connect(MQTT::Connect("arduinoClient1")
^
MQTT_2:60: error: 'class PubSubClient' has no member named 'set_callback'
client.set_callback(callback);
^
MQTT_2:60: error: 'callback' was not declared in this scope
client.set_callback(callback);
^
exit status 1
no matching function for call to 'PubSubClient:ubSubClient(WiFiClient&, const char*&, const int&)'