RPI Bridge widget

what I am trying to do is send some text from my ESP8266 to the RPI 3 model b+.
I found the way to send the text but I can not find how to receive the text to the RPI.
Basically I have 3 buttons, if I press the first one I want the RPI to write to a txt file the letter a, if I press the second button write b and if I press the 3rd write the letter c.
I know that to receive text from ESP to ESP I can simply add a

int pinData = param.asInt();

but it wont work with python… can you give me the same code but usable with the RPI ?
thanks a lot!

Check out the example in the Blynk Python library

Well I didn’t knew that there was python examples…
Can you please help me modify the code that can accept str values? I’m not that good with python…

If you’re not great with Python then maybe the easiest solution would be to install Node-Red on your Pi.

Node-Red is a visual programming tool and has file write (and read) nodes that are simple to configure.
It also has a Blynk plug-in, so you can connect directly to the Blynk server (cloud or local) and pick-up data directly from there, process it if necessary, and write the data to a file.
If you prefer, you could send the message from your ESP device as an MQTT message, pick that up in Node-Red and save it to your file, with some processing in between if needed. To do that you’d also need Mosquitto installed on your Pi, and the PubSubClient library on your ESP.

Personally, I use a mixture of both. The MQTT plug-in talks to the Blynk cloud server, so listens to commands that come from widgets in the app, then that’s is sent to and from ESP devices using MQTT. My devices don’t run any Blynkcode at all, that’s all handled by the Blynk plug-in in Node-Red.


Well actually that’s nice but i think that this is too much work for such a project…