I have an Arduino Nano 33 IoT that uses the Blynk.Edgent MKR1010 example as template from the v1.0.1 release (which is consistent with the library I have installed).
Everything is working fine except there is one thing I can’t seem to figure out. I’d like to send and receive serial data using the Tx and Rx pins associated with the Serial1 port (pins 1 and 2 on the board).
I’m able to send data perfectly, but I run into trouble when trying to read incoming data. NOTE: I am not writing anything to any virtual pins, so I don’t believe it is an issue related to flooding the Blynk server requests. Also, I’m almost certain it’s not an issue with the hardware itself because I’m able to use the same Serial1.read() function without Blynk and that also works perfectly.
Is there anything in the Blynk library that might be redefining something related to the Serial1 port, causing it to miss incoming data? Or is it an issue with how I’m structuring my code?
I wrote a test helper function to check if data was coming into the board without actually reading the data:
void setup(){
//Serial.begin(115200);
Serial1.begin(115200);
delay(2000);
pinMode(13, OUTPUT);
BlynkEdgent.begin();
}
void loop(){
BlynkEdgent.run();
ReadSerial();
}
void ReadSerial(){
if (Serial1.available() > 0){
digitalWrite(13, HIGH);
}
}
The LED never turns on, and I’ve tried a similar test where instead of using an LED, I used the Serial Monitor and print statements and do attempt to read the data unlike my code above, but that also did not indicate that any data was being received.
Any insight would be greatly appreciated.