nisco1106 / xbee-arduino

Automatically exported from code.google.com/p/xbee-arduino
GNU General Public License v2.0
0 stars 0 forks source link

can't use xbee-arduino (API) from a software serial console #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Function is not made for software serial usage : 

void    setSerial (HardwareSerial serial)

What version of the product are you using? On what operating system?
Arduino Nano v3 (ATMEGA 348)
Software Serial Library from http://arduiniana.org/libraries/newsoftserial/

Please provide any additional information below.

The library functions assume to use the "serial" implementation of Arduino. 
To be able to use a software serial, from the new software serial library, the 
code have to be 
changed.

Original issue reported on code.google.com by prune...@gmail.com on 3 Jan 2010 at 11:49

GoogleCodeExporter commented 9 years ago
Sample code :

#include <NewSoftSerial.h>
#include <XBee.h>

// use digital pins 7 and 8 for serial communication
int xbeeRXPin = 7;
int xbeeTXPin = 8;

// create the serial interface
NewSoftSerial xbeeSerial = NewSoftSerial(xbeeTXPin,xbeeRXPin);

// Create an XBee object at the top of your sketch
XBee xbeeObject = XBee(xbeeSerial);

Original comment by prune...@gmail.com on 3 Jan 2010 at 11:56

GoogleCodeExporter commented 9 years ago
I've actually modified the library to accept a NewSoftSerial object in the XBee 
constructor.  I'd be happy to share the code, just let me know.

Original comment by gdr...@gmail.com on 9 Aug 2010 at 2:36

GoogleCodeExporter commented 9 years ago
I would like to see the modification needed to use the NewSoftSerial library. I 
been currently using NewSoftSerial with my Xbee since the Arduino USB to TTL is 
hardwired to the UART and it allows me to use both the USB serial and Xbee at 
the same time. 

Original comment by esalazar...@gmail.com on 5 Oct 2010 at 9:44

GoogleCodeExporter commented 9 years ago
I am waiting on this modification as well, please publish the new code

Original comment by marijnoosterveld on 19 Oct 2010 at 8:06

GoogleCodeExporter commented 9 years ago
Waiting too :)
How do you plane to share the code ? Let me know if I can help...

Regards

Original comment by prune...@gmail.com on 19 Oct 2010 at 5:55

GoogleCodeExporter commented 9 years ago
I have posted a modified XBee library that includes NSS port XBee comm here: 
http://code.google.com/p/xbee-arduino/issues/detail?id=2.  Be sure to read the 
caveats as mentioned in the thread.  It hope it helps.
  --LC

Original comment by xdowboc@gmail.com on 19 Oct 2010 at 8:35

GoogleCodeExporter commented 9 years ago
Please see latest code (untested), which adds support for NSS 
http://code.google.com/p/xbee-arduino/source/browse/#svn%2Ftrunk

Original comment by andrew.rapp@gmail.com on 3 Apr 2011 at 2:50

GoogleCodeExporter commented 9 years ago
Dear Andrew,
will the April code be release as stable any time soon?

And is the call to the constructor different, or is it always the same? 
(assuming using the hardware serial)

Thanks for the excellent work,
Fabio

Original comment by fa...@devergy.com on 29 Nov 2011 at 12:41

GoogleCodeExporter commented 9 years ago
hi every one 
am trying to use mega serials to send data from matlab arduino by Xbee 
how can i do this ?? 
i hade tray this code
#include <NewSoftSerial.h>
#include <XBee.h>

// use digital pins 7 and 8 for serial communication
int xbeeRXPin = 7;
int xbeeTXPin = 8;

// create the serial interface
NewSoftSerial xbeeSerial = NewSoftSerial(xbeeTXPin,xbeeRXPin);

// Create an XBee object at the top of your sketch
XBee xbeeObject = XBee(xbeeSerial); 

but it keep say " no matching function " 
is there is any one to help plz ??

Original comment by huda....@gmail.com on 27 Jun 2012 at 6:21

GoogleCodeExporter commented 9 years ago
If you are using the new Arduino IDE (1.0+) they got rid of the old Soft Serial 
Library and replaced it with NewSoftSerial. They also renamed NewSoftSerial to 
SoftSerial...That is probably your issue. However, I'm trying to figure out if 
the XBee library updated for this change...

Original comment by rjbezdi...@gmail.com on 16 Aug 2012 at 2:17

GoogleCodeExporter commented 9 years ago
Andrew has uploaded a new experimental version, using a patch I wrote to enable 
using SoftwareSerial.

It needs beta testing.  Please, if you're interested in SoftwareSerial support, 
give it a try and report your results?

Original comment by paul.sto...@gmail.com on 16 Oct 2012 at 8:29

GoogleCodeExporter commented 9 years ago
Seems to work fine, but one potential bug.

This code:

// Contributed by Paul Stoffregen for Teensy support
#if defined(__AVR_ATmega32U4__) || defined(__MK20DX128__)
        _serial = &Serial1;
#else
        _serial = &Serial;
#endif

Requires HardwareSerial.h to be loaded (which it is), and requires a Serial 
object. Furthermore, it looks like this will cause an override of _serial when 
data is received?

Any any rate, compiling code for an ATTiny85 which doesn't have a hardware 
serial (and therefore no Serial object) trips up on this line as there's 
undefined reference to Serial.

Removing these lines everything compiles and runs perfectly.

Original comment by n...@fishy.net.nz on 25 Aug 2013 at 6:29

GoogleCodeExporter commented 9 years ago
This was fixed a while ago but I must have missed it. Since version 0.4 beta 
you can use Software Serial

Original comment by andrew.rapp@gmail.com on 2 Feb 2014 at 6:32