Go Down

Topic: SoftwareSerial library not working on Arduino 1.0, NewSoftSerial on 0023 works (Read 7316 times) previous topic - next topic


I can't get SoftwareSerial library working with Arduino 1.0. Even if I use the included example (Examples/SoftwareSerial/SoftwareSerialExample) I can't receive anything, but when I start Arduino 0023 and use NewSoftSerial with same settings and ports as in SoftwareSerial on Arduino 1.0, everything is working and I'm receiving data from a module that uses rx/tx to communicate.


I think the lack of replies is because of the lack of information provided.  "I can't get _______ working" doesn't go far and at best you'll be asked to provide more information.  Post your code and describe your problem's symptoms in much more detail and I'll bet it's a quick and easy fix.  Also make sure to post what version of NewSoftSerial you were using on Arduion 23.  You can access this using the library_version() function.

I can't tell from your post if you're aware or not, but Mikal changed the library in version 11 beta to actually be used as "SoftwareSerial" from "NewSoftSerial" in preparation for it's integration into Arduino 1.0 as the new standard software serial library.  So again, make sure you post the versions you're talking about and it'll be a lot easier to sort all of that out.

That said, I'm preparing to convert a newer project over to Arduino 1.0 "SoftwareSerial" just like a lot of other people so if anything odd comes up I'll check back here and see what other help I can offer.


This code is from the SoftwareSerial example folder. I've changed RX/TX ports to the right ones, which works on my other project file in the earlier version of Arduino. I'm 100% sure that this is not a hardware problem since the other project is working and receiving data from my serial device.

"Goodnight moon!" prints to Serial output but I'm not able to receive anything from mySerial.

Code: [Select]

#include <SoftwareSerial.h>

SoftwareSerial mySerial(8, 9);

void setup() 
  Serial.println("Goodnight moon!");

  // set the data rate for the SoftwareSerial port
  mySerial.println("Hello, world?");

void loop() // run over and over
  if (mySerial.available())
  if (Serial.available())


I have ( i think ) the same issue.
Here is the situation for a project using Arduino-Uno

in my arduino-0023 environment:
I used the NewSoftSerial10c version of Arduiniana and everything works fine (mainly reading data on pin2) .

I noticed that there was a new version of this library "NewSoftSerial11" and I tried for the exact same project and environment for a potential move to the Mega [http://arduiniana.org/2011/01/newsoftserial-11-beta/].
But I did not get it to work.

I am currently also migrating to the new arduino-1.0 environment and I noticed the same issue with the almost similar library SoftwareSerial (standard arduino-1.0)

After a quick check, it seems that available() does not become true. But I did not had the time to dig deeper.
Anyone facing the same issues and has the solution or a hint?

Thanks in advance


Ok I found it:
In the blog post: "This allows for multiple simultaneous instances, although only one can receive at a time."

So actually I needed to first call "mySerial.listen()" before receiving any data on each Serial Instance.
Seems to work now for me.

Hope it helps.


I'm having the same problem when I attempt to compile the latest GPS_DATALOGGER from Adafruit. 

My error code is: " error: 'class SoftwareSerial' has no member named 'available'  "

Works fine under 0023 and NewSoftSerial10c.

Not sure how or where to use the solution you said fixed your problem? 

Do you have some sample code with the "listen" and "available" members being called/used?



I was having the same problem.... couldn't even get the sample code to compile.  Found that you need to remove the NewSoftSerial folder out of the "sketch folders:library" which by default is in your "mydocuments/arduino/library" folder (if you made one) OR wherever you put the NewSoftSerial folder (could be in your "Arduino-1/library" folder.  Either way it needs to be out of the path that Arduino-1 looks for 'h' files.  I found this out by going to a virgin computer and loading Arduino-1 and the sample compiled with no problems. :smiley-mr-green:


Nov 19, 2012, 12:49 pm Last Edit: Feb 11, 2013, 04:49 am by Coding Badly Reason: 1
Hi guys! I am a beginner for this certain hobby, I am using my Arduino Dueminalove with Xbee shield and the Bluetooth Bee V2.0+EDR and fortunately I can/'t configure it. I already used the puTTy to connect my PC and the Bluetooth through USb, it doesn't work.. then I downloaded the Arduino 0023 that contains the NewSoftSerial Lib, I Compiled a code below :

Code: [Select]
#include <SoftwareSerial.h>   //Software Serial Port
#define RxD 9
#define TxD 10
#define DEBUG_ENABLED  1

SoftwareSerial blueToothSerial(RxD,TxD);
char incoming;

void setup()
 pinMode(RxD, INPUT);
 pinMode(TxD, OUTPUT);
 pinMode(4, OUTPUT);    
 pinMode(5, OUTPUT);
 pinMode(6, OUTPUT);
 pinMode(7, OUTPUT);


void setupBlueToothConnection()
 blueToothSerial.begin(38400); //Set BluetoothBee BaudRate to default baud rate 38400
 sendBlueToothCommand("\r\n +STPIN=0000\r\n");
 delay(2000); // This delay is required.
 delay(2000); // This delay is required.

//Checks if the response "OK" is received
void CheckOK()
 char a,b;
     a = blueToothSerial.read();

     if('O' == a)
       // Wait for next character K. available() is required in some cases, as K is not immediately available.
         b = blueToothSerial.read();
       if('K' == b)

 while( (a = blueToothSerial.read()) != -1)
   //Wait until all other response chars are received

void sendBlueToothCommand(char command[])

void loop()
 // get character sent from Android device
 // decide what to do with it
 switch (incoming)
 case '1':
   digitalWrite(4, HIGH);
   blueToothSerial.println("pin 4 HIGH");    

 case '2':
   digitalWrite(5, HIGH);
   blueToothSerial.println("pin 5 HIGH");    

 case '3':
   digitalWrite(6, HIGH);
   blueToothSerial.println("pin 6 HIGH");    

 case '4':
   digitalWrite(7, HIGH);
   blueToothSerial.println("pin 7 HIGH");    

 case '5':
   digitalWrite(4, LOW);
   blueToothSerial.println("pin 4 LOW");    

 case '6':
   digitalWrite(5, LOW);
   blueToothSerial.println("pin 5 LOW");    

 case '7':
   digitalWrite(6, LOW);
   blueToothSerial.println("pin 6 LOW");    

 case '8':
   digitalWrite(7, LOW);
   blueToothSerial.println("pin 7 LOW");    


btb1.cpp: In function 'void CheckOK()':
btb1:66: error: 'class SoftwareSerial' has no member named 'available'
btb1:73: error: 'class SoftwareSerial' has no member named 'available':

Can anyone can help to fix them all out?

Moderator edit: [code] [/code] tags added.


I am using my Arduino Dueminalove with Xbee shield and the Bluetooth Bee V2.0+EDR and fortunately I can/'t configure it.

There is something fortunate about that?

then I downloaded the Arduino 0023 that contains the NewSoftSerial Lib, I Compiled a code below :

So? You didn't change SoftwareSerial to NewSoftSerial, so the obsolete SoftwareSerial is being used, which, as the compiler is telling you, doesn't have an available method.

The art of getting good answers lies in asking good questions.


Several months ago, I tried using SoftSerial and AltSoftSerial, and you can see the results here,


Basically, even Nick Gammon couldn't get the darn thing to work. I eventually gave up completely
on it, even though some people seem to have no problems.

I guess there are 2 kinds of SoftSerial people in the world. I'm still hoping I can someday move into
the world of the-haves.


NewsoftSerial didn't want to work. I've just tried with different ports, and it's working even they are not agreed by the documentation.

Code: [Select]
#include <SoftwareSerial.h>
//SoftwareSerial debugSerial (48, 46); // RX/TX
SoftwareSerial debugSerial (47, 48); // RX/TX

I have a Seeduino Mega 1280.


At which school are they teaching people to write these ridiculous case statements ?

Go Up