r-map / rmap

rete monitoraggio ambientale partecipativo documentation at https://doc.rmap.cc
https://rmap.cc
53 stars 42 forks source link

no matching function for call to 'PubSubClient::PubSubClient(char [8], int, void (&)(char*, byte*, unsigned int), sim800Client&)' #74

Closed dmsherazi closed 8 years ago

dmsherazi commented 8 years ago

I am trying to compile sim800/mqtt_basic.ino and am getting this error

no matching function for call to 'PubSubClient::PubSubClient(char [8], int, void (&)(char, byte, unsigned int), sim800Client&)'

pat1 commented 8 years ago

In: libraries/PubSubClient/PubSubClient.h you have to use those definitions:

// if use sim800 client

include "sim800Client.h"

define TCPCLIENT sim800Client

// if use arduino_uip or etherclient //#include "Client.h" //#include "Stream.h" //#define TCPCLIENT Client

dmsherazi commented 8 years ago

I did change the define and include requirements. I am still getting this error.


mqtt_basic:38: error: no matching function for call to 'PubSubClient::PubSubClient(char [8], int, void (&)(char*, byte*, unsigned int), sim800Client&)'

 PubSubClient client(server, 1883, callback, s800);```

If I include #include <Ethernet.h> and EthernetClient ethClient; isntead of s800 in  PubSubClient  client(... ) it compiles!
pat1 commented 8 years ago

Are you sure that you are using rmap specific PubSubClient and not the main stream standard library? The main stream standard library cannot work with sim800 library.

dmsherazi commented 8 years ago

I guess there was an issue with arduino IDE not rebuilding the library files and using old .o files. Problem solved after forcing the IDE to rebuild files by changing the board