Using C++ on a Raspberry Pi with Blynk

@esa.attia Sorry no timeline for that.
As it is already fixed in the latest master branch: https://github.com/blynkkk/blynk-library/commit/4eca7ddbe1c21b3c58970ddc35500f253917b655

Cheers :slight_smile:

Thank you !

I seem to be having the same issues … running 0.4.8

getting flood errors . currently using the RP3

How can flood errors be the same issues? you’ll have to search how to fight flood errors now.

Just because I’ve followed the instructions Costas and it hasn’t worked. I’m having a similar to the issue werewolflabs is having. Which is what this thread is about “getting started with C++ implementation”

I would be nice to have a Docs page support which have a set of instructions (checked and verified) on how to get C++ running on a standard Rpi setup and not have to resort to a forum post to find all this info.

@esa.attia - Yes you’re right! It would be nice - and we are ready to accept your contributions and help spreading them among the community! :wink:
If you’re working on a commercial project - you can get support from our highly qualified developers @ Blynk for Business.
Cheers.

1 Like

3 posts were merged into an existing topic: Push button notification on Raspberry Pi 3

Hi all,

I tried to compile Blynk library 4.10 on my raspberry pi 3.
But unfortunately compilation is not working…

I have an error on “BlynkOnDisconnected” function that has not been found in sources file.

Does anyone can help Me?
What I’m doing wrong?

Is it possible to compile using CygWin?
Is it mandatory install WiringPi?

Thanks a lot

Hello, Did someone tried to run RTC from examples on Raspberry Pi Zero? For push data it works (uptime in sec % min), but when I try for RTC I receive this error:
In file included from main.cpp:13:0:
…/src/WidgetRTC.h:15:6: error: #error WidgetRTC is not available on this platform!
#error WidgetRTC is not available on this platform!

Can you help?

You would need to link the required libraries etc that’s why I used millis() in the example provided.

can you be more specific what I need to do (one example); I’m using Raspbian on RI Zero and a local server; Blynk libraries were installed yesterday. Here are some other error received while compiling:
In file included from …/src/WidgetRTC.h:18:0,
from main.cpp:13:
…/src/Blynk/BlynkWidgetBase.h: In member function ‘void BlynkWidgetBase::setLabel(Args …)’:
…/src/Blynk/BlynkWidgetBase.h:27:9: error: ‘Blynk’ was not declared in this scope
Blynk.setProperty(mPin, “label”, args…);
^~~~~
…/src/Blynk/BlynkWidgetBase.h: In member function ‘void BlynkWidgetBase::setColor(Args …)’:
…/src/Blynk/BlynkWidgetBase.h:32:9: error: ‘Blynk’ was not declared in this scope
Blynk.setProperty(mPin, “color”, args…);
^~~~~
In file included from main.cpp:13:0:
…/src/WidgetRTC.h: In static member function ‘static time_t WidgetRTC::requestTimeSync()’:
…/src/WidgetRTC.h:37:5: error: ‘Blynk’ was not declared in this scope
Blynk.sendInternal(“rtc”, “sync”);
^~~~~
main.cpp: In function ‘void clockDisplay()’:
main.cpp:29:3: error: ‘String’ was not declared in this scope
String currentTime = String(hour()) + “:” + minute() + “:” + second();
^~~~~~
main.cpp:30:10: error: expected ‘;’ before ‘currentDate’
String currentDate = String(day()) + " " + month() + " " + year();

I’m not able to run DHT too; is there a tutorial to show how to setup libraries to be able to execute C++ programs? I’m trying to run programs from examples:
https://examples.blynk.cc/?board=Raspberry%20Pi&shield=System%20default&example=More%2FDHT11

All the examples in the Sketch Builder are for Arduino, Arduino like and ESP based MCUs

FYI, RPi can work with Blynk using WiringPi (C++) or Node.js, but as stated in the Help Center, anything beyond the basic direct pin control with options require much more experience…

http://help.blynk.cc/how-to-connect-different-hardware-with-blynk/raspberry-pi/nodejs-vs-c-library

Use Blynk with C++
If you want just to toggle a pin, it will simply work out-of-the-box.
But if you want to add more functionality, it will require some Linux, threading, sockets knowledge, modifying Makefile, etc.
So, C++ is generally for advanced developers.

In the examples pages there are raspberry pi programs to be build

I know… I have mentioned that in the past to the Developers :wink: … and it has gotten better.

In theory most can be used with the WiringPi method, as it is C++ based… but not all as drop-in solutions, as many 3rd party libraries may not actually be supported on the RPi or WiringPi, syntax for workarounds may be different, and well, an RPi is not an Arduino… period.

Personally I started with WiringPi and quickly moved toward Node.js… I found more references available with Google… but still a lot of trial and error discovering the correct way to use Blynk with it.

ok…thx…I have to move back to ESP

Don’t give up entirely… there are a few others here who have some WiringPi experience.

And search here for NodeJS stuff… there are a few small examples… plus what is available on the Help Center document I linked to. I have been actively learning to control many things on my RPi3 with Blynk and quite like the power of the RPi :smiley:

basic functionality for buttons works ok, but I want to try simple things like RTC or DHT 22 - and not able to solve it. Basically I want to be able to connect sensors to RPI (movement, Temp, Light, distance, magnetic etc…RPI is much better due to flexibility to update the program, connectivity etc. I have elimitated a lot of errors during the build, but still errors I cannot fix, so I cannot enjoy RTC or DHT on my RPI Zero. Switching to NodeJS…it’s like starting with the left foot…

Hello @Costas first thank you for the post.

Do you have any C++ example that fits in this case using the serial.read?

Example: I want to read serial information from Arduino which is connected to the Raspberry USB port and put on Blynk virtual pin?

@Clucas this is what I always recommend for MCU to MCU interfacing https://forum.arduino.cc/index.php?topic=396450.0