arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
21.98k stars 4.77k forks source link

Compiling Error #2703

Closed phcella closed 6 years ago

phcella commented 6 years ago

Hello,

I'm trying to compile and upload the tasmota firmiware to my sonoff pow, but I'm getting this error:

` D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\sonoff\xdrv_03_energy.ino: In function 'void EnergySnsInit()':

xdrv_03_energy:1046: error: no matching function for call to 'TasmotaSerial::TasmotaSerial(uint8_t&, uint8_t&, int)'

 PzemSerial = new TasmotaSerial(pin[GPIO_PZEM_RX], pin[GPIO_PZEM_TX], 1);

                                                                       ^

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\sonoff\xdrv_03_energy.ino:1046:75: note: candidates are:

In file included from D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\sonoff\xdrv_03_energy.ino:415:0:

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:40:5: note: TasmotaSerial::TasmotaSerial(int, int)

 TasmotaSerial(int receive_pin, int transmit_pin);

 ^

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:40:5: note: candidate expects 2 arguments, 3 provided

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: constexpr TasmotaSerial::TasmotaSerial(const TasmotaSerial&)

class TasmotaSerial : public Stream {

   ^

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: candidate expects 1 argument, 3 provided

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: constexpr TasmotaSerial::TasmotaSerial(TasmotaSerial&&)

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: candidate expects 1 argument, 3 provided

xdrv_03_energy:1048: error: 'class TasmotaSerial' has no member named 'hardwareSerial'

   if (PzemSerial->hardwareSerial()) { ClaimSerial(); }

                   ^

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\sonoff\xsns_15_mhz19.ino: In function 'void MhzInit()':

xsns_15_mhz19:287: error: no matching function for call to 'TasmotaSerial::TasmotaSerial(uint8_t&, uint8_t&, int)'

 MhzSerial = new TasmotaSerial(pin[GPIO_MHZ_RXD], pin[GPIO_MHZ_TXD], 1);

                                                                      ^

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\sonoff\xsns_15_mhz19.ino:287:74: note: candidates are:

In file included from D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\sonoff\xdrv_03_energy.ino:415:0:

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:40:5: note: TasmotaSerial::TasmotaSerial(int, int)

 TasmotaSerial(int receive_pin, int transmit_pin);

 ^

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:40:5: note: candidate expects 2 arguments, 3 provided

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: constexpr TasmotaSerial::TasmotaSerial(const TasmotaSerial&)

class TasmotaSerial : public Stream {

   ^

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: candidate expects 1 argument, 3 provided

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: constexpr TasmotaSerial::TasmotaSerial(TasmotaSerial&&)

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: candidate expects 1 argument, 3 provided

xsns_15_mhz19:289: error: 'class TasmotaSerial' has no member named 'hardwareSerial'

   if (MhzSerial->hardwareSerial()) { ClaimSerial(); }

                  ^

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\sonoff\xsns_17_senseair.ino: In function 'void SenseairInit()':

xsns_17_senseair:196: error: no matching function for call to 'TasmotaSerial::TasmotaSerial(uint8_t&, uint8_t&, int)'

 SensairSerial = new TasmotaSerial(pin[GPIO_SAIR_RX], pin[GPIO_SAIR_TX], 1);

                                                                          ^

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\sonoff\xsns_17_senseair.ino:196:78: note: candidates are:

In file included from D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\sonoff\xdrv_03_energy.ino:415:0:

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:40:5: note: TasmotaSerial::TasmotaSerial(int, int)

 TasmotaSerial(int receive_pin, int transmit_pin);

 ^

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:40:5: note: candidate expects 2 arguments, 3 provided

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: constexpr TasmotaSerial::TasmotaSerial(const TasmotaSerial&)

class TasmotaSerial : public Stream {

   ^

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: candidate expects 1 argument, 3 provided

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: constexpr TasmotaSerial::TasmotaSerial(TasmotaSerial&&)

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: candidate expects 1 argument, 3 provided

xsns_17_senseair:198: error: 'class TasmotaSerial' has no member named 'hardwareSerial'

   if (SensairSerial->hardwareSerial()) { ClaimSerial(); }

                      ^

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\sonoff\xsns_18_pms5003.ino: In function 'void PmsInit()':

xsns_18_pms5003:105: error: no matching function for call to 'TasmotaSerial::TasmotaSerial(uint8_t&, int, int)'

 PmsSerial = new TasmotaSerial(pin[GPIO_PMS5003], -1, 1);

                                                       ^

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\sonoff\xsns_18_pms5003.ino:105:59: note: candidates are:

In file included from D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\sonoff\xdrv_03_energy.ino:415:0:

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:40:5: note: TasmotaSerial::TasmotaSerial(int, int)

 TasmotaSerial(int receive_pin, int transmit_pin);

 ^

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:40:5: note: candidate expects 2 arguments, 3 provided

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: constexpr TasmotaSerial::TasmotaSerial(const TasmotaSerial&)

class TasmotaSerial : public Stream {

   ^

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: candidate expects 1 argument, 3 provided

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: constexpr TasmotaSerial::TasmotaSerial(TasmotaSerial&&)

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: candidate expects 1 argument, 3 provided

xsns_18_pms5003:107: error: 'class TasmotaSerial' has no member named 'hardwareSerial'

   if (PmsSerial->hardwareSerial()) { ClaimSerial(); }

                  ^

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\sonoff\xsns_20_novasds.ino: In function 'void NovaSdsInit()':

xsns_20_novasds:87: error: no matching function for call to 'TasmotaSerial::TasmotaSerial(uint8_t&, int, int)'

 NovaSdsSerial = new TasmotaSerial(pin[GPIO_SDS0X1], -1, 1);

                                                          ^

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\sonoff\xsns_20_novasds.ino:87:62: note: candidates are:

In file included from D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\sonoff\xdrv_03_energy.ino:415:0:

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:40:5: note: TasmotaSerial::TasmotaSerial(int, int)

 TasmotaSerial(int receive_pin, int transmit_pin);

 ^

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:40:5: note: candidate expects 2 arguments, 3 provided

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: constexpr TasmotaSerial::TasmotaSerial(const TasmotaSerial&)

class TasmotaSerial : public Stream {

   ^

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: candidate expects 1 argument, 3 provided

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: constexpr TasmotaSerial::TasmotaSerial(TasmotaSerial&&)

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: candidate expects 1 argument, 3 provided

xsns_20_novasds:89: error: 'class TasmotaSerial' has no member named 'hardwareSerial'

   if (NovaSdsSerial->hardwareSerial()) { ClaimSerial(); }

                      ^

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\sonoff\xsns_23_sdm120.ino: In function 'void SDM120Init()':

xsns_23_sdm120:200: error: no matching function for call to 'TasmotaSerial::TasmotaSerial(uint8_t&, uint8_t&, int)'

 SDM120Serial = new TasmotaSerial(pin[GPIO_SDM120_RX], pin[GPIO_SDM120_TX], 1);

                                                                             ^

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\sonoff\xsns_23_sdm120.ino:200:81: note: candidates are:

In file included from D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\sonoff\xdrv_03_energy.ino:415:0:

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:40:5: note: TasmotaSerial::TasmotaSerial(int, int)

 TasmotaSerial(int receive_pin, int transmit_pin);

 ^

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:40:5: note: candidate expects 2 arguments, 3 provided

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: constexpr TasmotaSerial::TasmotaSerial(const TasmotaSerial&)

class TasmotaSerial : public Stream {

   ^

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: candidate expects 1 argument, 3 provided

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: constexpr TasmotaSerial::TasmotaSerial(TasmotaSerial&&)

D:\Documentos\Torrent\Hass IO\Arduino\Tasmota-Arduino Software\portable\sketchbook\libraries\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: candidate expects 1 argument, 3 provided

xsns_23_sdm120:202: error: 'class TasmotaSerial' has no member named 'hardwareSerial'

   if (SDM120Serial->hardwareSerial()) { ClaimSerial(); }

                     ^

exit status 1 no matching function for call to 'TasmotaSerial::TasmotaSerial(uint8_t&, uint8_t&, int)' `

Does someone know how to fix it?

Thanks Pedro

per1234 commented 6 years ago

It looks like you're using the beta version of Sonoff-Tasmota but you either didn't install the required TasmotaSerial-2.0.0 library or else you have both TasmotaSerial-1.2.0 and TasmotaSerial-2.0.0 installed and the Arduino IDE used the file from TasmotaSerial-1.2.0.

As you can see, this issue should be resolved by using the latest version of TasmotaSerial-2.0.0: https://github.com/arendst/Sonoff-Tasmota/commit/c51bcd77d151aa22dbb7c58fa9a8575c59192818

It seems like poor practice for the library author to append the library version to the library folder names. This will only make version control less effective and make it more likely for people to have multiple versions of the library installed. The library version is already documented in library.properties and library.json.

phcella commented 6 years ago

Thanks, I thought that I had copied the libraries, but I did not. I just copied then, and it worked