Skip to content

Arduino BLE: Compilation failures - missing ESP_GATTC_CONNECT_EVT and others #59

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

Closed
nkolban opened this issue Sep 14, 2017 · 1 comment

Comments

@nkolban
Copy link
Owner

nkolban commented Sep 14, 2017

When building an Arduino based BLE application, if you find that you fail at compilation with errors similar to:

ESP_GATTC_CONNECT_EVT was not declared in this scope

or similar issues relating to constants not found we can explain this and the solution is relatively simple.

First, let us review the Arduino ESP32 support story. The goal is to write an Arduino sketch, compile it and then flash it to an ESP32.

A native ESP32 has its own development environment called the ESP-IDF (Espressif IoT Development Framework). The ESP-IDF is what a C or C++ programmer would use to write applications to natively run on an ESP32. It is a "lower" level API than the Arduino framework and is designed specifically for ESP32 programming. This means that an ESP32 application can't be recompiled for other platforms.

Arduino on the other hand is a development tool (IDE) plus a set of libraries that have common implementations across a number of physical devices. A program (a sketch) written to use the Arduino APIs can be compiled for at ATMel processor, an ESP32, and a whole host of other platforms.

The Arduino environment for ESP32 augments the Arduino IDE to provide support for compilation for ESP32s. Specifically, this means three primary things:

  1. A compiler that compiler source code to ESP32 native code
  2. Arduino libraries that map source code calls to Arduino API to ESP32 code
  3. A copy of the ESP-IDF that implements the foundation of ESP32 access

All of this is summary ... let us now get back to the described problem.

The puzzle is to caused by release maintenance for the Arduino ESP32 package. Every few months, Espressif release a new version of the ESP-IDF. Some time after this, the Arduino ESP32 package is then refreshed to include the new ESP-IDF level. At that time, there is now a later version of the Arduino support for ESP32 available beyond what you currently have installed.

The Arduino BLE library (this project) is built to use the latest Arduino ESP32 framework. The latest framework provided extra functions that the Arduino BLE library implementation utilized. The error you are seeing is caused because you are building an Arduino BLE library application on a version of the Arduino ESP32 support that is back level.

What you must do is upgrade/re-install your Arduino ESP32 environment into your Arduino IDE. Once done, you will find that the compilations proceed smoothly.

See the following for Arduino ESP32 installation instructions:

https://github.com/espressif/arduino-esp32#installation-instructions

@AmrutaCh
Copy link

AmrutaCh commented Sep 23, 2017

@nkolban Thanks for your work and support. I am also facing type of the same issues.I already have done everything mentioned in the link. I tried this with BLE lib versions 0.4.1 and 0.4.2 and latest ESP32 Dev board version
image
Attached is a snap of part of the errors.

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

2 participants