BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Problems getting Blynk to compile using PlatformIO IDE

arduino
esp8266

#1

Hello everyone,

So far I have tested over a dozen of custom firmwares for ESP8266 module. I believe this project is what I have been looking for for my own product and I’m very excited to give it a try on my ESP8266 module. Unfortunately, I have had a bunch of errors as I have been trying to compile the project using PlatformIO IDE. I do not have the Arduino IDE and I don’t know much about Arduino platform as I have never used it before.

I have downloaded all the dependencies and libraries, and Arduino extension has been installed, as well.

These are the problems I got off the terminal:

fatal error: PubSubClient.h: No such file or directory
error: no matching function for call to ‘PubSubClient::publish(char [50], String&)’
error: ‘MQTT’ does not name a type
error: expected unqualified-id before ‘&’ token
error: expected ‘)’ before ‘&’ token
error: expected initializer before ‘pub’

And by the way, why Blynk is not available in a pre-built binary format for those who want to test drive the firmware quickly without bothering much about compiling and its related stuff?

Thank you!


#2

its sounds like you’re missing a library. what did they say on the PlatformIO forums? They have any hints?


#3

Well, I have reported this on their forum and looks like someone has replied. Hopefully their answer could solve it.


#4

You simply need to install a PubSub client library in your Arduino IDE. The most popular one is this:

If you’re looking at using MQTT then you might want to consider a slightly different approach with Blynk, which is to use Node-Red and the Blynk plug-in. More info here:

As to why there are no pre-built binaries for Blynk, I guess it would be possible to do that, but it would need a very specific set of hardware, and it would need to have Wi-Fi provisioning built-in to allow that hardware to connect to the local network and use the appropriate Blynk auth code.
Much better to have the Sketch Builder to generate your code for you:
https://examples.blynk.cc/?board=ESP8266&shield=ESP8266%20WiFi&example=GettingStarted%2FBlynkBlink

Pete.


#5

Hi Pete,

Thank you very much. I have received help on PlatformIO’s forum and now the project compiles successfully.

Regards