Hi guys i’m currently working with a raspberry Pi and 1 Arduino UNO and 1 Mega connected to it. Im using Blynk Serial connection and my project works perfectly. im executing the blynk-ser.sh and the arduino connects to the app.
All im trying to do now is log the data coming from the arduino to mysql database on the Pi. To do that i should use Serial.print in my sketch but it doesn’t display anything in the serial monitor, all i get is my token getting repeated over and over.
Im sorry im not that knowledgeable when it comes to serial connections, i hope someone can give me some tips.
Im using this simple sketch:
#define BLYNK_PRINT Serial1
char auth = "YourAuthToken";
int pinValue = param.asInt();
Serial1.print("V1 Slider value is: ");
A Serial port can only be used by one thing at a time. Using the USB serial link effectively turns your PC (or in your csee, RPi) into a USB to Ethernet adapter, but the Arduinos can not simultaneously use the serial monitor (or program the Arduino) while also linking to the Blynk Server via the Serial port
On the Mega you can use one of the other three hardware serial ports and a TTL-USB adapter, along with another terminal program to get serial data, but on the UNO you have to use SoftwareSerial with a TTL-USB adapter.
Thanks for your feedback, if understood correctly, i will have 2 connections coming from the UNO to the PI, 1 as a softserial (using TTL) and the other main Arduino connection, so now the arduino IDE will see both serial coms seperatly and i will choose the non TTL connection for the serial monitor?
I have never ran the Arduino IDE on an RPi, so I have no idea if/how it works, but on a PC using same USB-Serial Blynk link concept, then the IDE and the
Blynk-ser.bat will alternate as to which one connects to the UNO, via its main USB port. (E.G. shut the link off in order to program, turn the link on to connect to server, and don’t use the IDE serial monitor for anything)
Meanwhile, using SoftSerial and a TTL-USB adapter, you can see all UNO Serial output on another terminal program… I use Termite for the PC.