SoftwareSerial listen() not availabe for UNO R4 WiFi?

Hi

I have a sketch that use two softwareserial ports
It works fine on UNO R3 but when migrating to R4 WiFi I get this error message

"error: 'class SoftwareSerial' has no member named 'listen'
MySerial.listen();
exit status 1
'class SoftwareSerial' has no member named 'listen'"

It seems as the listen class is not included for SoftwareSerial for R4 Wifi
To me this seems strange.
Anyone experiencing the same problem or have a solution on how to use two softwareserial ports on R4 WiFi?

Welcome to the forum

Are you aware that the R4 Unos have two hardware UARTs ? The Serial interface is used by the Serial monitor and to upload code. The completely separate Serial1 interface uses pins 0 and 1 on the board

Are you sure that even a single instance of SoftwareSerial forks on the Uno R4 ?

1 Like

Hi @jonwall ,

Welcome to the forum..
No worries, it's just a very different board..
Linkk below to your core..
ArduinoCore-renesas/tree/main/libraries/SoftwareSerial

and yes, board does have 2 hardware serials, so can probably just do one software..

good luck.. ~q

1 Like

It doesn't really have two usable hardware serials though, because one is used for the serial monitor and upload code.

Also, the hardwareSerial library for the R4 is buggy, I found it critically so. So there are a couple good reasons to use the softwareSerial.

Where are the bugs in the hardware serial implementation documented ?

Hi, I just want to say thank you for the fast response.
To use the Serial1 hardware serial solved the problem.
I am still surprised that the support for multiple software serial is gone on the R4.
:smiley:

1 Like

Removing support for multiple SoftwareSerial instances sounds like a good move as it is a nightmare to use

If your problem was with the flush() function then using SoftwareSerial won't help because the function does not exist in the SoftwareSerial library

It exists in Stream, which softwareSerial is derived from.

Indeed it does, so should be available in SoftwareSerial, but it appears not to be documented

The SoftwareSerial they implemented for the UNO R4 is much more complex than what we are used to on AVRs and other MCUs ... suffice it to say that they use DMA for data transfer ... so I understand the difficulties they might have in implementing multiple instances and those related to implementing other methods. :roll_eyes:

Guglielmo

Hi All, After reading the comments, Is the implication that the Uno R4 WiFi is incapable of more then 1 (or 2) Softserial objects?

I have a project that needs at least 6 DFPlayer MP3 players to operate, and each uses a serial connection. Along with a lot of other pins being used for various reasons, I am using a series of MCP23X17 Io extender boards. Without the Softerial.Listen() command, how can I set this up on the UNO R4 WiFi board? If this board is incapable, what is a good replacement for it that is capable?

Hi Jonwall, I was ripping my hair out trying to get DFPlayer Mini to work with the r4. Only to realize it works fine with the R3. What did you adjust to serial connection to work?

Sample code for library uses SoftwareSerial mySoftwareSerial(10,11);

Use Serial1 on pins 0 and 1 instead of SoftwareSerial.

1 Like

Thanks! How do I tell Serial to use 0 and 1? I.e. what is the equivalent of SoftwareSerial mySoftwareSerial(10,11); using 0 and 1 if not using software serial?]

Thanks!

There is no equivalent. You dont need to create it. Its already there. Use it just like regular Serial.

Serial1.begin(115200);

The Arduino UNO R4 have more physical serials so you don't need a software emulation. The serial port on pin 0 and 1 is identified as Serial1 instead of Serial (which is the one via USB) :wink:

Guglielmo

Thanks, that worked!

If you had read post #2 in this topic then you would not needed to ask the question, but I am glad that you got there in the end