Go Down

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

turhake

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.


CraigKC

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.

turhake

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.begin(9600);
  Serial.println("Goodnight moon!");

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

void loop() // run over and over
{
  if (mySerial.available())
    Serial.write(mySerial.read());
  if (Serial.available())
    mySerial.write(Serial.read());
}

Tijean

Hey,
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
TiJean

Go Up