ESP32 IDF with Blynk without Arduino

Hello,

I’m using ESP32-IDF (Espressif SDK based on FreeRTOS) with Eclipse-IDE, because I’m used to work in C and don’t like the Arduino coding style. But now I want to use Blynk in my project still without Arduino. I’m not very familiarize with C++ and I don’t know which interface I have to implement by myself. I tried a little but always ending at arduino.h, which I don’t have in my project :wink:

Can anyone help me or give me some hints where I can find more information about the blynk class design and interfaces?

Thank you very much…
Bastian

Blynk is very portable, the same C++ source code can be used.
You’ll have to (mostly):

  • Remove Arduino-related stuff like headers and direct pin operations. Similar to what BLYNK_NO_BUILTIN flag does.
  • Implement the connectivity transport adapter. See example in src/Adapters/BlynkSerial.h
  • Implement main include header, like src/BlynkSimpleStream.h
  • Implement utility/debug functions: src/Blynk/BlynkDebug.h, src/utility/utility.cpp
1 Like

Hey Bastian,

I’m also interested in doing the same thing for the very same reasons :wink: I was wondering if you have been able to do it.

Thanks

Hey guys, I am also very interested in using the ESP-IDF directly without Arduino. Would it be possible for the Blynk team to create a ESP-IDF example? I think it would be super helpful to many users! There was this other post where someone wrote a lightweight native C library for Blynk that looks really easy to use, but I am slightly concerned that it is not supported by the Blynk team directly and hasn’t been updated in 5 years:

@vshymanskyy mentioned that he would be interested in doing an official port of the C++ library to the ESP-IDF and supporting it. Is that still a possibility? I would be a strong advocate and would really appreciate it!

Also - I would have to say that I prefer C code as well, not C++ for embedded applications. That said, if there is a functional example project that shows how to properly mix a c++ library like this with an existing application written in C then I’d be happy!

Hey guys, any update on this? Really curious if everyone on here is using Arduino. I can’t imagine that the products that use Blynk all use Arduino… right?

I think it’s fair to say that most people use either ESP8266 or ESP32 based hardware with C++

Pete.

Ok gotcha. So I guess I’m wondering why there are tons of examples of use with Arduino but not with ESP-IDF if that’s what most people are using? Why have everyone write their own “Adapter” header to link up the ESP functions with the Blynk library?

Hey guys, any advice out there for how to develop on ESP32 using ESP-IDF with Blynk? Has someone ported it and have an example project running? I would be highly appreciative! Also, there are like a million ways to develop with esp-idf it seems. There’s the raw command line method, visual studio code, visual studio with visual gdb, eclipse, etc. What do people use on real commercial projects?

Hello again - update - I have managed to get the Blynk Libraries working with ESP-IDF based projects using the Visual GDB IDE and toolchain. The key is to make new transport classes in place of the WIFI Client ones used for Arduino. I wrote a custom one using the ESP-IDF sockets api. Seemed to work pretty well!

That said, I am still thinking of using Arduino in my product since so much work is already done for that platform, such as over the air updates, wifi based provisioning, etc.

Also - for the C only devs out there - brushing up on your C++ is recommended. It’s not to hard to join cpp and c code in a project. Just make sure to use the following to enclose C code when blending with C++:
#ifdef __cplusplus
extern “C” {
#endif

and at end:
#ifdef __cplusplus
}
#endif

Best of luck to others out there!