Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: call of overloaded Wire.begin(int&, int, int)' is ambiguous #85

Closed
platypii opened this issue May 13, 2022 · 8 comments
Closed

Comments

@platypii
Copy link
Contributor

The code in BMP180.cpp does not compile after upstream arduino-esp32 library was updated.

.pio/libdeps/heltec_wifi_lora_32_V2/Heltec ESP32 Dev-Boards/src/BMP180.cpp:13:29: error: call of overloaded 'begin(int&, int, int)' is ambiguous
   Wire.begin(sda, 12, 100000);
                             ^
In file included from .pio/libdeps/heltec_wifi_lora_32_V2/Heltec ESP32 Dev-Boards/src/BMP180.h:5,
                 from .pio/libdeps/heltec_wifi_lora_32_V2/Heltec ESP32 Dev-Boards/src/BMP180.cpp:1:
.platformio/packages/framework-arduinoespressif32/libraries/Wire/src/Wire.h:79:10: note: candidate: 'bool TwoWire::begin(int, int, uint32_t)'
     bool begin(int sda=-1, int scl=-1, uint32_t frequency=0); // returns true, if successful init of i2c bus
          ^~~~~
.platformio/packages/framework-arduinoespressif32/libraries/Wire/src/Wire.h:80:10: note: candidate: 'bool TwoWire::begin(uint8_t, int, int, uint32_t)'
     bool begin(uint8_t slaveAddr, int sda=-1, int scl=-1, uint32_t frequency=0);
          ^~~~~

I'm trying to use this library via platformio. My code worked, and was unchanged for more than 1 year. I just went back to the project, updated library versions, and now I'm getting a compile error from this library.

Specifically, in BMP180.cpp there is a call to Wire.begin.

This used to be fine. But then the underlying framework-arduinoespressif32 library was updated to add an overloaded Wire.begin function, which makes the call here ambiguous.

     bool begin(int sda=-1, int scl=-1, uint32_t frequency=0); // returns true, if successful init of i2c bus
+    bool begin(uint8_t slaveAddr, int sda=-1, int scl=-1, uint32_t frequency=0);

I tried some changes to the BMP180.cpp in this repo to see if I could fix it, but I couldn't figure out how to make the compiler know which Wire.begin function to use. I also left a comment on the arduino-esp32 repo to see if they have any suggestions.

@platypii
Copy link
Contributor Author

platypii commented May 13, 2022

Sorry, just saw this was fixed in commit 494d6b9c. Closing.

@platypii platypii reopened this May 13, 2022
@platypii
Copy link
Contributor Author

Reopening: seems like there hasn't been a release since June 2020, and so I can't use the fix that is already merged.

Any chance of publishing a new version 1.1.1? 🙏

@giukio
Copy link

giukio commented May 17, 2022

I agree this fix is necessary.

Compiling .pio\build\heltec_wireless_stick_lite\libcc3\Heltec ESP32 Dev-Boards\heltec.cpp.o
.pio/libdeps/heltec_wireless_stick_lite/Heltec ESP32 Dev-Boards/src/BMP180.cpp: In member function 'boolean BMP085::begin(uint8_t)':
.pio/libdeps/heltec_wireless_stick_lite/Heltec ESP32 Dev-Boards/src/BMP180.cpp:12:28: error: call of overloaded 'begin(int, int, int)' is ambiguous
Wire.begin(13, 12, 100000);

@platypii
Copy link
Contributor Author

Version 1.1.1 was published last night to the Arduino Library by @Heltec-Aaron-Lee. Thank you Aaron!!
https://www.arduino.cc/reference/en/libraries/heltec-esp32-dev-boards/

Still waiting for it to be published to the PlatformIO Registry.
https://registry.platformio.org/libraries/heltecautomation/Heltec%20ESP32%20Dev-Boards

Aaron said: "platformio is maintained by their official team for us, and I have notified them to upgrade accordingly". So I hope it will update soon. 🤞

@platypii
Copy link
Contributor Author

Package 1.1.1 is published to PlatformIO registry! And my project now works with the latest espressif32 and Heltec ESP32 Dev-Boards packages!

THANK YOU HELTEC!! 💜 Awesome customer service

@johannes-777
Copy link

You mean you can compile with the PlatformIO Espressif 32 V4.3.0?
How is this possible? This issue is still open:
http://community.heltec.cn/t/error-compiling-example-esp32-v2/10327/3
HelTecAutomation/ESP32_LoRaWAN#79

@platypii
Copy link
Contributor Author

Yes I am still able to compile with espressif32 4.3.0. Maybe because I'm not actually using LoRaWAN in my project?

@johannes-777
Copy link

You are right. I just compiled a minimal project with espressrif V4.3 as well.
My impression is, that heltec has pretty much deserted its roots, i.e. the boards that support LoRaWAN. I am trying to get LMIC running directly (https://github.com/mcci-catena/arduino-lmic).
To my surprise, there is already a config for Heltec boards:
https://github.com/mcci-catena/arduino-lmic/tree/master/src/hal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants