Skip to content

"Too few arguments to function 'esp_err_t esp_ble_gattc_open(esp_gatt_if_t, uint8_t*, esp_ble_addr_type_t, bool)'" when trying to run any of the examples #472

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

Open
pgrlopes opened this issue Apr 12, 2018 · 14 comments

Comments

@pgrlopes
Copy link

Hey guys.

I've been looking to get my esp32 ble component to send some information to my smartphone for the past couple days and I'm now trying to use this repository as a base for my code. However, none of the examples for the server or client work because of the error in the title.

I've googled it and found some answers pointing to some errors introduced with new updates to the libraries and that I should revert to a previous version but I'm new here and I just don't know how to do it.

Any help would be appreciated.
Thank you.

@chegewara
Copy link
Collaborator

Arduino-ide or esp-idf?

@pgrlopes
Copy link
Author

Sorry, i'm using arduino IDE

@chegewara
Copy link
Collaborator

chegewara commented Apr 12, 2018

If you are working on windows then go to folder:
C:\Users\USER\Documents\Arduino\hardware\espressif\esp32
execute command:
git status

if you get result other than:

On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

then execute:

git pull
git submodule update --init

Maybe there is something i am missing because i did not check before update, but with updated stack first example i tested (BLE_server) works.

@pgrlopes
Copy link
Author

Yeah I had tried this solution previously as it was suggested in another thread and it didn't work. I tried it now and it's working now. My issue is that when I installed the esp32 modules it wasn't on the c:\users directory but instead in the arduino ide directory itself (C:\Program and files\Arduino...) and the libraries were in conflict.

Could you just tell me what is the directory that I should be using for the esp32 folder? Is it the C:\users one?

Thank you very much for your help.

@chegewara
Copy link
Collaborator

chegewara commented Apr 12, 2018

It does not matter where you install Arduino-ide, i have it installed in E:\Program Files (x86)\Arduino, the point is that arduino is keeping by default files here:
C:\Users\USER\Documents\Arduino

You can change it in Preferences->sketchbook location. Now in this folder you have hardware subfolder with esp32 subfolder and so on. More important is that you can install BLE library with arduino-esp32, then it will be in this folder by default:
C:\Users\USER\Documents\Arduino\hardware\espressif\esp32\libraries\BLE and you will need to update it from time to time with procedure from this post, or you can install it from Plugins manager or zip file.

@pgrlopes
Copy link
Author

Yeah that's the thing, my ESP32 folder is actually in the arduino ide directory hence all the issues, I was applying the solutions to the users/arduino folder but forgetting about the libraries not updated in the esp32 folder. Thank you once again for the help

@MajicCat
Copy link

MajicCat commented Apr 25, 2018

Just hit the same issue. I did not use Git, just the regular install. Any thoughts on how to correct?

Arduino: 1.8.5 (Windows 10), Board: "Nano32, 80MHz, 921600"

C:\Users\xxx\Documents\Arduino\libraries\ESP32_BLE_Arduino-master\src\BLEClient.cpp: In member function 'bool BLEClient::connect(BLEAddress)':

C:\Users\xxx\Documents\Arduino\libraries\ESP32_BLE_Arduino-master\src\BLEClient.cpp:115:2: error: too many arguments to function 'esp_err_t esp_ble_gattc_open(esp_gatt_if_t, uint8_t*, bool)'

);

^

In file included from C:\Users\xxx\Documents\Arduino\libraries\ESP32_BLE_Arduino-master\src\BLEClient.cpp:13:0:

C:\Users\xxx\Documents\Arduino\hardware\espressif\esp32/tools/sdk/include/bluedroid/esp_gattc_api.h:293:11: note: declared here

esp_err_t esp_ble_gattc_open(esp_gatt_if_t gattc_if, esp_bd_addr_t remote_bda, bool is_direct);

       ^

exit status 1
Error compiling for board Nano32.

@MajicCat
Copy link

MajicCat commented Apr 26, 2018

Got it, was outdated ESP lib./

The demo consume a huge amount of memory. Is that expected?

Sketch uses 1232701 bytes (94%) of program storage space. Maximum is 1310720 bytes.
Global variables use 46624 bytes (15%) of dynamic memory, leaving 248288 bytes for local variables. Maximum is 294912 bytes.

@chegewara
Copy link
Collaborator

chegewara commented Apr 26, 2018

Yes, i dont know why, it was about 900kB some time ago, but now its a lot more. You can change Partition to No OTA

@MajicCat
Copy link

MajicCat commented Apr 26, 2018 via email

@pana216
Copy link

pana216 commented Jun 12, 2019

Arduino-ide or esp-idf?

I'm working with the esp-idf and am getting that error - any suggestions?

EDIT sorry, edited by mistake, wanted to quote

@chegewara
Copy link
Collaborator

I'm working with the esp-idf and am getting that error - any suggestions?

Yes, after a year its so many changes in esp-idf so i suggest to open new issue and provide esp-idf version you are using and logs.

@VijitSingh97
Copy link

VijitSingh97 commented Jun 12, 2019

@pana216 @chegewara I fixed by changing lines in BLEDevice.cpp with:

line 494: esp_err_t errRc = esp_ble_gap_update_whitelist(true, *address.getNative(), BLE_WL_ADDR_TYPE_PUBLIC); // True to add an entry.

line 508: esp_err_t errRc = esp_ble_gap_update_whitelist(false, *address.getNative(), BLE_WL_ADDR_TYPE_PUBLIC); // False to remove an entry.

that last argument can be public or random, idk what it does though

https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/bluetooth/esp_bt_defs.html#_CPPv422esp_ble_wl_addr_type_t

@pana216
Copy link

pana216 commented Jun 12, 2019

@pana216 @chegewara I fixed by changing lines in BLEDevice.cpp with:

line 494: esp_err_t errRc = esp_ble_gap_update_whitelist(true, *address.getNative(), BLE_WL_ADDR_TYPE_PUBLIC); // True to add an entry.

line 508: esp_err_t errRc = esp_ble_gap_update_whitelist(false, *address.getNative(), BLE_WL_ADDR_TYPE_PUBLIC); // False to remove an entry.

that last argument can be public or random, idk what it does though

https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/bluetooth/esp_bt_defs.html#_CPPv422esp_ble_wl_addr_type_t

This resolved to some other errors and warning, but these were easily to handle, just googled and fixed them. Thank you very much I really appreciate it!!

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

5 participants