Pages: [1] 2   Go Down
Author Topic: Where has SoftwareSerial gone?  (Read 7559 times)
0 Members and 1 Guest are viewing this topic.
UK
Offline Offline
God Member
*****
Karma: 0
Posts: 710
Arduino is Genius
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I haven't even noticed SoftwareSerial for more than a year, but I wanted to use it today (after half a dozen versions of Arduino IDE), and it isn't on the Examples menu.

I looked in the Arduino.app Package Contents (on my Mac) and SoftwareSerial is in the Libraries directory. BUT, there are no examples!

I had a search of the site and forum, but didn't find anything specific except this:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1289515297/1
which said it was obsolete, but there is nothing in the release notes about removing it:
http://arduino.cc/en/Main/ReleaseNotes
(I haven't been read much for a while, so I may have missed something).

Is their something weird going on?
« Last Edit: January 17, 2011, 02:36:41 pm by gbulmer » Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 210
Posts: 13037
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Use NewSoftSerial instead.
Logged

UK
Offline Offline
God Member
*****
Karma: 0
Posts: 710
Arduino is Genius
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for the recommendation.

So what happened to SoftSerial?

I can't find anything in the Release Notes, about SoftSerial being removed.
http://arduino.cc/en/Main/ReleaseNotes

SoftSerial is listed in the libraries:
http://arduino.cc/en/Reference/Libraries
and it does not say it is obsolete/deprecated/dead/...

NewSoftSerial is listed on the libraries but not as a replacement, just an improvement.

How are folks supposed to figure this out?

Based on the libraries documentation, I'd expect to see it. I'll go raise this as a bug.
« Last Edit: January 17, 2011, 03:03:49 pm by gbulmer » Logged

Left Coast, USA
Offline Offline
Sr. Member
****
Karma: 7
Posts: 499
Sometimes I just can't help myself.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
So what happened to SoftSerial?
.
.
.
listed in the libraries
.
.
.
figure this out?
.
.
.
a bug

If something is listed in the "libraries" directory of the distribution and not the "core" section, you have to include the header for that library.  (As is noted in user comments on the site where you got your code.)  This has not changed.  Ya still gotta include the library header.  It's still not a "bug."

So: In the IDE, with the sketch opened, click the Sketch->Import Library menu item and select SoftwareSerial  (See Footnote.)

The proper #include statement will be inserted at the beginning of your sketch.


Regards,

Dave

Footnote:
The reason that I like to use the Import Library thingie from the Sketch menu rather than typing the #include statement myself is that you can see exactly what the compiler will see when it compiles your program.  The library you are talking about is "SoftwareSerial," not "SoftSerial."
« Last Edit: January 17, 2011, 04:45:07 pm by davekw7x » Logged

UK
Offline Offline
God Member
*****
Karma: 0
Posts: 710
Arduino is Genius
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks. I have never bothered doing that. I have always opened a file or #include'd it by hand, so that is a useful bit of information.

For some reason, the IDE won't open the .cpp file.
I used to just open create or open .cpp/.c files in a tab, back in Arduino-0012-ish, and it all worked fine.
Logged

Left Coast, USA
Offline Offline
Sr. Member
****
Karma: 7
Posts: 499
Sometimes I just can't help myself.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
IDE won't open the .cpp file.

I wouldn't to put words in anyone's mouth, but I think the Arduino developers may have reasoned that people who want to look at .cpp (library) files would use a "real" programmers text editor rather than the toy editor built into the iDE.  (So you can't open just any old .cpp file in any old directory).

You can still create tabs in your own sketch and name them something.cpp or something.h and Arduino will create the files and save them in the sketch directory, but I think the IDE only lets you open "sketches" (by navigating to a directory that contains a .pde file) in the IDE File menu).

You can also create .cpp and .h files in a sketch directory with an external editor.

Anyhow...

Once you open a sketch, then the .pde and the .cpp and .h files in that directory appear on tabs in the IDE.  Since a library directory is not a sketch (has no .pde file), I don't think you can open a library .cpp directly in the IDE.  (I could be wrong.)

I've not been around long enough to know anything about releases older than about six or seven months, so I don't know if or when the functionality changed.


Regards,

Dave
« Last Edit: January 18, 2011, 01:34:58 pm by davekw7x » Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 4401
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
NewSoftSerial is listed on the libraries but not as a replacement, just an improvement.
How are folks supposed to figure this out?
The prefix 'new' should provide a clue.

Don
« Last Edit: January 18, 2011, 09:59:29 am by floresta » Logged

UK
Offline Offline
God Member
*****
Karma: 0
Posts: 710
Arduino is Genius
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The prefix 'new' should provide a clue.

Maybe I have seen the use of the word 'new' too often to believe it means anything other than 'new set of bugs' :-)

There have been several servo libraries, is one with 'New' in its name the one to use ?-)

Have you read NewSoftSerial? It is significantly more complex for a beginner to get to grips with and understand. So it may be technically superior (in some dimensions), but significantly inferior for other purposes i.e. learning.

I don't see why the SoftwareSerial library example referenced on that library page is not included in the Arduino IDE download, on the Examples menu. It looks like an error to miss it.

If someone has decided to make SoftwareSerial obsolete or deprecated, then there should be a clear statement in the code, and documentation (library and release notes) to say so.

If the recommended library is NewSoftSerial, put a clear statement at the top of the SoftwareSerial library page and the library reference page.

Then, everything is clear. No 'clues', or 'hints', or making things so awkward that it looks like a bug.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 642
Posts: 50366
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I don't see why the SoftwareSerial library example referenced on that library page is not included in the Arduino IDE download, on the Examples menu. It looks like an error to miss it.
The library IS included in the Arduino 0022 download for windows. The fact that examples are not should be a clue for you to stop using it.
« Last Edit: January 18, 2011, 10:40:21 am by PaulS » Logged

UK
Offline Offline
God Member
*****
Karma: 0
Posts: 710
Arduino is Genius
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The library IS included in the Arduino 0022 download for windows.
Understood
Quote
The fact that examples are not should be a clue for you to stop using it.
No. IMHO that is an awful, bad, bad way to handle obsolete or deprecated components.
As my old boss used to say "Assume makes an ASS of U and ME" :-)
We need to strive to be clear about boundaries and scope.

IMHO, removing the example, so that anyone gets to this state where they have to ask about it (already wasted time), and then responding "you can guess what status it must be when the example is missing" is not a Quality Approach (TM:-).

As I wrote, if it is obsolete or deprecated, it should be clear and unambiguous.

Write that it is obsolete or deprecated in the Libraries/Reference documentation, Release Notes and the code and example.

If it is not obsolete or deprecated, include the example so that folks can test it to get some confidence that it works, and see how it works. This is what usually happens for libraries included with the Arduino IDE, and it is very, very helpful.

IMHO Folks should never need to guess at the status of code included in the Arduino IDE.

If there is a library with some better features, include that comment right next to SoftwareSerial in the Libraries/Reference page, and even in the SoftwareSerial code example.

Otherwise bugs are even harder to find, and beginners are left wondering what to do.

I thought the lack of the SoftwareSerial example code (from the Library reference page) being included in the IDE download was a bug, and I still think it is a bug.

It is either a bug in :
- the contents of the download because the example code is missing, or
- in the reference documentation which should say it is deprecated and will be obsolete at some date or status, or
- in the process around deprecating components prior to making them obsolete, because IMHO it shouldn't ever be unclear.
« Last Edit: January 18, 2011, 01:24:08 pm by gbulmer » Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17303
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

But, but, but the Uno Punto Zero project is going to fix all that.  smiley-wink

Quote
Forum to discuss about the official release of Arduino's conglomerate. This is both for hardware, software, examples, and documentation. If it is needed we will expand this forum board into a category by itself
.



Lefty
« Last Edit: January 18, 2011, 01:28:00 pm by retrolefty » Logged

UK
Offline Offline
God Member
*****
Karma: 0
Posts: 710
Arduino is Genius
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
But, but, but the Uno Punto Zero project is going to fix all that.  
:-)

Of course!
I have been a fool.
You have enlightened me. Thank you, thank you.
The scales have fallen from my eyes :-)

IMHO, making stuff obsolete, and the process around removing things is a thorny issue. IMHO the Arduino team has made an astonishingly, good, tasteful job of dealing with thorny issues. I have total confidence in their ability to do this well too.

I don't feel pre-pending 'New' to a name is good. Do we get NewNewSoftSerial next, then NewNewNewSoftSerial, maybe New4SoftSerial? Where do the previous versions get archived?

I don't think failing to include library example code, which clearly exist, in the download is a good approach to clearly announcing that a library is deprecated. That feels wrong.

Anyway, I've tried to contribute what I can.
« Last Edit: January 18, 2011, 01:40:18 pm by gbulmer » Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 642
Posts: 50366
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I don't feel pre-pending 'New' to a name is good.
The Arduino team didn't do that. A member of the forum saw a need for a better software serial class, and developed a new one. What to call it? Well, SoftwareSerial2 seems kind of clunky.

The library was posted on the forum and playground, got good reviews, and was acknowledged to be better than SoftwareSerial. So, support for SoftwareSerial was dropped. It has not been the preferred software serial class for many versions of the IDE.

Quote
I don't think failing to include library example code, which clearly exist, in the download is a good approach to clearly announcing that a library is deprecated. That feels wrong.
How would you do it? Keep in mind that paperwork and documentation always tends to take a back seat to new development. I know. I've been a developer for 30+ years, and I don't do documentation unless I'm bored out of my skull. There is always something new to work on, learn, or explore.
Logged

UK
Offline Offline
God Member
*****
Karma: 0
Posts: 710
Arduino is Genius
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

[glow]Edit:[/glow]
Quote
The Arduino team didn't do that. A member of the forum saw a need for a better software serial class, and developed a new one. What to call it? Well, SoftwareSerial2 seems kind of clunky.

The library was posted on the forum and playground, got good reviews, and was acknowledged to be better than SoftwareSerial. So, support for SoftwareSerial was dropped. It has not been the preferred software serial class for many versions of the IDE.

Okay, I have no problem with it being deprecated. I am only asking for a clear, simple way to know the status of the stuff that is included in the IDE download.

Quote
How would you do it?

0. Decide how libraries/language will be deprecated and made obsolete, then publish that on the Arduino.cc web site.

I have total confidence in the Arduino team to develop a good approach. They have very good taste.

Here is my cut, assuming that information exists, and this is in-line with that approach:
1. Write in the Library/Reference page that NewSoftSerial is recommended over SoftwareSerial in the line describing SoftwareSerial. Add a link to hop down the page to the NewSoftSerial entry.
2. Write in the Library/Reference/SoftwareSerial page, at the top, very clearly, NewSoftSerial is recommended, and that SoftwareSerial is deprecated, but still supplied for those people who have already committed to using it. Say if/when SofwareSerial will no longer be included in the Arduino IDE download. Add a link to the Arduino.cc page which explains the general process of deprecating and obsoleting components.
3. While SoftwareSerial is included in the download with the IDE, include the example program that exercises it. Include in the comment at the top, the note that SoftwareSerial is deprecated, and refer to the Arduino.cc Libraries/Reference/SoftwareSerial page
4. When SoftwareSerial becomes deprecated (if it isn't already), add a note to the Release Notes to say that.
5. When SoftwareSerial stops being included in the Arduino IDE download, add a note to the Release Notes to say that.

Quote
I've been a developer for 30+ years
And so?
I wrote my first commercial, professional code in 1978. I learned C on XENIX in 1983, and BSD UNIX 1984. My friend Mark had the first C++ compiler in Europe, from a tape made by Bjarne Stroustrup, and he taught me C++. I have taught Software Engineering to post graduate level to industrial and full time students. I have been responsible for the post graduate software engineering training of near 1000 graduates/year, as well as some of the software engineering quality processes for a development shop of several thousand people. So what?

I am thrilled that there are a growing stream of talented folks with only a few years experience coming up with great ideas, fabulous approaches, and teaching me a thing or two.

I think good, simple, lightweight processes to deprecate and obsolete code help make our development activities easier and more enjoyable.
« Last Edit: January 18, 2011, 03:52:27 pm by gbulmer » Logged

UK
Offline Offline
God Member
*****
Karma: 0
Posts: 710
Arduino is Genius
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry I had to pop-out to buy dinner ...

Quote
I don't do documentation unless I'm bored out of my skull. There is always something new to work on, learn, or explore.
I don't like writing documentation either. That doesn't mean that I should be satisfied with the status quo simply because it involves something I don't like doing. That doesn't seem to me an adequate criteria.

A successful strategy to handle our human imperfections is to use a 'process'.

'Process' has got a bad name, but IMHO that is because many processes I see are quite poor. This is partly because it is difficult to develop good processes. IMHO it is also because some of the people who create process are weak at developing good processes, and the objectives of the process are not well thought out (IMHO significant social institutions have been severely damaged this way, but that's an illustration of the difficulty, and not the success).

I'd use something very simple, easy to explain, understand, and do, to handle obsolescence.

IMHO the Arduino team are unusually good at developing good processes, but I am more than happy to contribute if it would help.
Logged

Pages: [1] 2   Go Up
Jump to: